Create Static Pages: Use Tiddlywiki + Node.js (Issue: The extra <p> tag in the output .html)

71 views
Skip to first unread message

Mohammad

unread,
May 2, 2020, 10:22:58 AM5/2/20
to TiddlyWiki
Hi Jeremy

Issue: the extra <p> tags in rendered .html output


Description of issue:
Rendering and generating static pages (static website) has got a lot of attention! Tiddlywiki on Node.js can simply produce static pages from selected tiddlers. but there is an issue and it is extra <p> tag in the output!


Question
From Ref[0] above: Is there any way to use --render and prevent the extra <p> tag generation? I use a grid layout for static website generated by TW-5.1.22 and these <p> tags make to destroy the grid layout.

Data: the build section of tiddlywiki.info is

"static":[
    "--rendertiddlers", "[!is[system]tag[public]]", "$:/kookma/templates/static.tiddler.html", "static", "text/plain",
"--rendertiddlers", "[!is[system]tag[public]]", "$:/kookma/mytemplate-wrapper", "static", "text/plain",
    "--rendertiddler", "$:/kookma/templates/static.template.css", "static/static.css", "text/plain" 
]

To generate the static pages, in terminal I use

tiddlywiki --build static


Answer 
From Ref[1,2]:

  • Use a wrapper template with below contents. It is called $:/kookma/templates/static.tiddler-wrapper.html
                         <$view tiddler="$:/kookma/templates/static.tiddler.html" format="htmlwikified" mode="inline”/>

  • Correct the build static as below to use the wrapper template instead of original one
"static":[
    "--rendertiddlers", "[!is[system]tag[public]]", "$:/kookma/templates/static.tiddler-wrapper.html", "static", "text/plain",
"--rendertiddlers", "[!is[system]tag[public]]", "$:/kookma/mytemplate-wrapper", "static", "text/plain",
    "--rendertiddler", "$:/kookma/templates/static.template.css", "static/static.css", "text/plain" 
]


Result

 Unsuccessful! Using the new wrapper template with the above build command renders tiddlers like below


<code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=utf-8&quot; /&gt; &lt;meta name=&quot;generator&quot; content=&quot;TiddlyWiki&quot; /&gt; &lt;meta name=&quot;tiddlywiki-version&quot; content=&quot;</code>5.1.22<code>&quot; /&gt; &lt;meta name=&quot;viewport&quot; cont

It seems  htmlwikified is not working!


What do you think?



--Mohammad



Mohammad

unread,
May 3, 2020, 11:16:26 AM5/3/20
to TiddlyWiki
This is for Jeremy!
Just a reminder, please see below!

--Mohammad
Reply all
Reply to author
Forward
0 new messages