How to gracefully transclude tiddlers with titles?

79 views
Skip to first unread message

Luca Dorigo

unread,
Apr 9, 2018, 2:26:57 AM4/9/18
to tiddl...@googlegroups.com
Maybe I'm not using the feature as intended but at the moment titles really mess up my tiddlers.

For example, say I have a tiddler "Subtopic" containing the following wikitext (indented for clarity):
 

Some intro text, blablablablabla, nothing important, ....

! First Section
 
Some more explanation, blablablablablablabla

!! First Subsection

Some more explanation, blablablablablablabla

!! Second Subsection

Some more explanation, blablablablablablabla

If I transclude it in this other tiddler ("Maintopic"):

Some intro text, blablablablabla, nothing important, ....

! First Main Section

Some more explanation, blablablablablablabla

!! First Main Subsection

Some more explanation, blablablablablablabla

{{Subtopic}}

The transcluded tiddler will start with a `h1` title , which will screw up the flow of the "Maintopic" tiddler. How do you handle this?

Mat

unread,
Apr 9, 2018, 11:54:22 AM4/9/18
to TiddlyWiki
I think you can create a stylesheet that cover the cases you expect, because I do think you must predefine it manually. You can try this just to see an example for how to target things.
In your Maintopic tiddler, put this at the bottom of it;

<style>
h1
~ h1 {background:red;}
h1
~ h1 ~ h2 {background:green;}
</style>

<:-)
 

Reply all
Reply to author
Forward
0 new messages