Disable formatting in table

48 views
Skip to first unread message

heusmich

unread,
Aug 24, 2021, 3:16:07 PM8/24/21
to TiddlyWiki
Hi,
I have the following problem:
I´m running some "7 Days to Die" servers and want to start creating some mods. To have some kind of guideline I want to create a table in TiddlyWiki with some example commands and the descriptions of the commands. The table has two columns, in the first column is the command and in the second column is the description.
Now I have the problem that the command will automatically be changed, so I can´t see the complete command when I save the tiddler.

Here is an example:
The command I write into the table: <set xpath="/items/item/property[@name='Stacknumber']/@value">30000</set>
What I can see when I save it: 30000

So the question is, is it possible to disable the formatting not for the complete tiddler but for some texts in the tiddler?

Eric Shulman

unread,
Aug 24, 2021, 3:35:09 PM8/24/21
to TiddlyWiki
On Tuesday, August 24, 2021 at 12:16:07 PM UTC-7 heusmich wrote:
The command I write into the table: <set xpath="/items/item/property[@name='Stacknumber']/@value">30000</set>
What I can see when I save it: 30000
So the question is, is it possible to disable the formatting not for the complete tiddler but for some texts in the tiddler?

TiddlyWiki sees any content inside angle brackets as HTML syntax, which it passes to the browser for processing.
Thus, in your example, <set xpath="...">30000</set>, only the 30000 remains to be rendered by TiddlyWiki.

You can bypass this handling by enclosing the content within single backtick characters, like this:
`<set xpath="/items/item/property[@name='Stacknumber']/@value">30000</set>`

This will tell TiddlyWiki to render the content as <code>...</code>, which prevents the browser from processing the angle-bracket enclosed content.  Note that, by default, TiddlyWiki formats "code" content using red monospaced text on a gray background with a border.  If you want to change this appearance so the content looks like normal text, you can create a tiddler, tagged with $:/tags/Stylesheet, containing the following CSS rule:
.myCode code { color:inherit; background:inherit; border:0; font-family:inherit; }

Then, you can enclose your table content within like this:
@@.myCode
|`<set xpath="/items/item/property[@name='Stacknumber']/@value">30000</set>` |Description goes here |
|`another command here` |Another description here |
@@

By doing this, any <code>...</code> within the table will appear as normal, unparsed text.  Q.E.D

enjoy,
-e

heusmich

unread,
Aug 24, 2021, 3:43:47 PM8/24/21
to TiddlyWiki
Thank you very much, it worked like a charm and now everything looks fine! :D

Best regards
heusmich
Reply all
Reply to author
Forward
0 new messages