## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
qbit
@qbit:tapenet.org
[m]
mainly openbsd
and nixos when i have to linux :D
ejmoog
@ejmoog
i have some question, we know that """ quote the long string, and if i want ' """ 'in this long string, how can i convert it?
@wisdomlight markdown is one of the tw official plugin, do you know how to find and install it? if not , see the official site.
@yanderella:sibnsk.net
[m]
@ejmoog: Making a variable instead is my most impulsive answer to this question. However, there may be better ways that I cannot think of at the moment. So until more experienced than me answer your question, you can have my idea, even if it is not much.
\define str()
Very
"""
Long
"""
String 'where' I can have any "quotes"
\end

<$text text=<<str>> /> ejmoog @ejmoog @yanderella:sibnsk.net I defined a 'copyblock'macro: \define cpblk(src) <<copy-to-clipboard """$src$""">> <pre><$text text="""$src$"""/></pre>
\endthe question is how to copy the block script itself in another tiddler?

Such as this one: <$macrocall$name="cpblk" src=<<str>> /> the <<str>> can not contain ' """ ' .
@yanderella:sibnsk.net
[m]

@ejmoog: Here is what you are missing out... You have to use the macrocall widget instead of the macro calling shorthand syntax with <<copy-to-clipboard "text">>. Additionally, you have to use macro parameter as variable which happens with <<__parametername__>> that makes it a variable/macro like, unlike the regular version of $parametername$ which is simply string substitution.

For more information, see "Parameters as Variables <<__...__>>" in this Tiddler https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText

Here is the full idea to what you told me and it works for me:

\define cpblk(src)
<$macrocall$name="copy-to-clipboard" src=<<__src__>>/>

<pre><$text text=<<__src__>>/></pre> \end \define str() Very """ Long """ String 'where' I can have any "quotes" \end <$macrocall $name="cpblk" src=<<str>> /> ejmoog @ejmoog @yanderella:sibnsk.net It works for me too, thank you very much! ejmoog @ejmoog I have a question, if a url is too long, I prefer to set a filed that called url, and set the value. But when I type [[some text|{{!!url}}]]into the content area, it is no use at all. How do I make it? ejmoog @ejmoog I figure out myself, just <$link><$view field="url"/></$link>
ejmoog
@ejmoog
Or use html directly: <a href={{!!url}}>some text</a>
ejmoog
@ejmoog
@yanderella:sibnsk.net I have tried these method above, but none of them work. The only method is type [[some text|url]]into the field value. Please tell me the correct way if you kown.
@yanderella:sibnsk.net
[m]

@ejmoog: I am not exactly sure what you are asking... Though I will say if URL is external resource, you pretty much have to use HTML anchor directly... Though it's nice to combine it with target="_blank" and rel="noopener noreferrer"

However, if it is a link to a tiddler, internally in the same Wiki, you have to use <$link to={{!!url}}>some text</$list> otherwise it will still work but it won't be that neat.

Anyway, since I am not sure what exactly you are trying to do, I will give you few examples and ideas of 2 macros that you can try to implement for yourself. Maybe your answer is somewhere there....
So here. Screenshot of the tiddler to make it easier to follow, hopefully: https://i.imgur.com/MFsIF5r.png

And the text, so that it is easier to copy/paste and modify yourself.

\define anchor(url, text) <a href=<<__url__>> target="_blank" rel="noopener noreferrer"><<__text__>></a>

\define anchorfield(fieldname, text) <a href={{!!$fieldname$}} target="_blank" rel="noopener noreferrer"><<__text__>></a>

<$link to={{!!url_internalTW}}>Internal Tiddler Link</$link>

<a href={{!!url_externalweb}} target="_blank" rel="noopener noreferrer">Link to external Web Page somewhere</a>

<<anchorfield url_externalweb "Macro field: Link to external Web Page">>

<<anchor "https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText" "Macro: Link to external Web Page">>
ejmoog
@ejmoog
@yanderella:sibnsk.net I have learn a lot, thank you!
lilx2018
@lilx2018
Hi! One question needed help. I start widdler then open http://localhost:8080/mywiki5.2.1.html#Home(which is Chinese language version). Every time it start with opened "tools"(in Chinese word 工具) page of sidebar . Can I specify the "mynote"(in Chinese word 我的笔记) page when I open http://localhost:8080/mywiki5.2.1.html#Home? I have "start", "mynote", "recent", "tools", "more" 5 pages on the sidebar.
ejmoog
@ejmoog
@lilx2018 Go to "\$:/ControlPanel"(控制), click the "info"(信息), type the tiddler title into the "default tiddlers"(默認). And every time you save it, you should switch to the "open" or other sidebar you want, the tiddlywiki would remmember the last opened tab.
lilx2018
@lilx2018
@ejmoog Thank you very much! I get it.
Abhishek Tripathi
@TwistingTwists

Hello everyone,

I customised tiddlywiki for 1,2 things here : https://twabhisheknotes.in/

Now I am thinking I should have a login system for tiddlywiki - so that people can come and login and I can save their edits at https://twabhisheknotes.in/ .
How should I go about thinking this problem ?
ejmoog
@ejmoog
I think you should build another mvc system, such as phpbb, so people can contribute to it. I do not think tiddlywiki has a login system, and it would not add this function.
Abhishek Tripathi
@TwistingTwists
If I were to have a login button , right on the corner of tiddlywiki ,
1. what file I need to look into?
ejmoog
@ejmoog
I THINK that you should learn to make a login plugin by yourself, it seems to be a big project. But if you trust them, you can install the tw saver plugin, and tell the saving password to your friends.
@yanderella:sibnsk.net
[m]

@TwistingTwists: TiddlyWiki is normally considered as personal Wiki, essentially for 1 person or at most a handful group of people. It's known that there isn't a concrete multi-user system, after all it can be saved to a single HTML file for 1 person to use with no limits.

That said, there are some basic enough options when it comes to handful group of people.

Using TiddlyWiki on node.js, there you can host a TiddlyWiki on a VPS and have read only mode and if they are logged in, to be able to edit. Keep in mind that their edits are on the same TiddlyWiki (best analogy would be to think of it as a single file, so conflicts are possible, that's why I say handful group of people who most likely won't edit the same tiddler at the same time and minimize such conflicts). From node.js you can supply a credentials.csv file that has username and password for your people to login at /login after that they will gain some access to edit the wiki.

Also I would point out to other two TiddlyWiki solutions that kinda have multi-user options as well that are worth looking into:

I recommend you to check TW5-BOB before you decide/conclude anything. If you want a tl;dr version that would be to test BOB and see if it can help your use case.

One more option to consider, you might be able to implement a reverse proxy server (nginx, apache, ect) that handles your login and then provides access to Tiddlywiki or specific instance based on the login.

And if that doesn't work, there is the long big project idea that @ejmoog suggested... which I linked to few (I think good) attempts of that.

Abhishek Tripathi
@TwistingTwists
I will look at the solutions suggested by you and see if they fit my need. Thank you for the heads up.
RaelZero
@raelzero:oddworlds.org
[m]

Hey!

I'm using a TW for a D&D campaign I'm running, and I'm keeping on the wiki all the information about the game.

One of the things I'm doing is storing characters and NPCs, one of the things I'd like to do is to be able to define relationships between characters/factions, so that I can quickly find, for example, NPCs that are friend of a certain PC. Any ideas on how I could do that? I'm thinking I could use the fields at the bottom of a Tiddler, but how does that actually work, and then how can I search by field?

Feel free to turn the whole idea on its head if you think I'm severely off track, and thanks for your time!

qbit
@qbit:tapenet.org
[m]
seems like you could use tags for it
RaelZero
@raelzero:oddworlds.org
[m]
Thanks! Will dig a bit into it. Is what you're thinking that I could define tags like "friend with X", "friend with Y", "hostile to X", "hostile to Y", etc?
qbit
@qbit:tapenet.org
[m]
I was thinking a tag for each faction, then each character could be tagged with said tag
but maybe I didn't understand completely what you were after :D
RaelZero
@raelzero:oddworlds.org
[m]
haha sure
Let me try to elaborate
Basically, what I want is something to model relationships between characters, NPCs and factions
So let's say I have Gimli the Dwarf and Legolas the Elf
And then we have Gandalf the Wizard
I'd tag Gimli as Dwarf, Legolas as Elf, Gandalf as Human, all of them as Fellowship of the Ring, etc
Then I'd like to define Sauron
And model the fact that Sauron is hostile to Fellowship of the Ring
And so I could search for "who is hostile to Legolas?" and I'd find Sauron, because he's hostile to the Fellowship
Does it make sense?
Or, even without factions, I'd like to "flag" all the NPCs that Legolas and Gimli find in their journeys as "friends to Legolas" or "friends to Gimli", and then I could search something like "friends to both Legolas and Gimli"
I guess I could do that with tags, but it doesn't seem too elegant, as I'd end up flooding each NPC's tags at the minimum
qbit
@qbit:tapenet.org
[m]
ya, fields would work well
RaelZero
@raelzero:oddworlds.org
[m]
Maybe I'm just looking for a decent tutorial about fields, then :'D
(and thanks for the help)
qbit
@qbit:tapenet.org
[m]
RaelZero
@raelzero:oddworlds.org
[m]
Great! Will dig into this now. Thanks again!