Using HTML in one tiddler and linking to a CSS tiddler

78 views
Skip to first unread message

Cryoshakespeare

unread,
Aug 6, 2019, 2:35:39 PM8/6/19
to TiddlyWiki
Hey there,

I'm looking to use a html tiddler that refers to a css tiddler. Normally of course, I'd have a html file and a css file, and I'd just link the two in html with "<link rel="stylesheet" href="style.css">", but I don't think this can be done inside a TiddlyWiki.

For reference, the code I'm trying to import into my wiki (a personal DM notebook for any who play RPGs) can be found here: https://codepen.io/retractedhack/pen/gPLpWe

Anyone have any advice? So far, my attempt have involved linking by name using

[data-tiddler-title="statblock.AnimatedArmor"] {
 ~ css goes here
}

and having the corresponding tiddler with that name, as well as tagging the css tiddler with $:/tags/Stylesheet.

But honestly, I think it just breaks when I use html type tiddlers.

Thanks for your help!

Cryoshakespeare

unread,
Aug 6, 2019, 2:54:38 PM8/6/19
to TiddlyWiki
Well, I think I've solved my own problem - by simply having the html be in wiki text, and then just placing the css in a stylesheet. That seemed a little too easy!

Jed Carty

unread,
Aug 6, 2019, 2:58:23 PM8/6/19
to TiddlyWiki
The answer is either view templates or you tag all the tiddlers you want to have the css and then use attribute selectors for the tag.

https://tiddlywiki.com/#Custom%20styles%20by%20data-tags

In the long run I think you will find templates more useful

https://tiddlywiki.com/#TemplateTiddlers

I am not sure where a good tutorial for templates is, maybe someone else has a suggestion.

Mat

unread,
Aug 7, 2019, 4:12:15 PM8/7/19
to TiddlyWiki
On Tuesday, August 6, 2019 at 8:54:38 PM UTC+2, Cryoshakespeare wrote:
Well, I think I've solved my own problem - by simply having the html be in wiki text, and then just placing the css in a stylesheet. That seemed a little too easy!

Yeah... it was a bit unlear what you meant with a "html tiddler". While you definitely can use html in a tiddler (a typical case would be a complex table) it is generally not needed at all. The wikitext gets parsed into html (...I think).

<:-)
Reply all
Reply to author
Forward
0 new messages