1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00

Use external stylesheet in static representation

This commit is contained in:
Jeremy Ruston 2013-03-04 19:14:47 +00:00
parent dc3190d44e
commit 4ab4b1b8bf
4 changed files with 9 additions and 8 deletions

1
bld.sh
View File

@ -34,6 +34,7 @@ node ./tiddlywiki.js \
--savetiddler ReadMe ./readme.md text/html \
--savetiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/index.html text/plain \
--savetiddler $:/core/templates/static.template.html $TW5_BUILD_OUTPUT/static.html text/plain \
--savetiddler $:/core/templates/static.template.css $TW5_BUILD_OUTPUT/static/static.css text/plain \
--savetiddlers [!is[shadow]] $:/core/templates/static.tiddler.html $TW5_BUILD_OUTPUT/static text/plain \
|| exit 1

View File

@ -0,0 +1,4 @@
title: $:/core/templates/static.template.css
{{{ [is[shadow]type[text/css]] ||$:/core/templates/css-tiddler}}}
{{$:/core/styles/base}}

View File

@ -8,13 +8,8 @@ title: $:/core/templates/static.tiddler.html
<meta name="tiddlywiki-version" content="`{{$:/core/templates/version}}`" />
<meta name="format-detection" content="telephone=no">
<meta name="copyright" content="`{{$:/core/copyright.txt}}`" />
<link rel="stylesheet" href="static.css">
<title>`{{$:/core/wiki/title}}`</title>
<div id="styleArea">
`{{{ [is[shadow]type[text/css]] ||$:/core/templates/css-tiddler}}}`
</div>
<style type="text/css">
`{{$:/core/styles/base}}`
</style>
</head>
<body>
<section class="story-river">

View File

@ -5,12 +5,13 @@ TiddlyWiki5 can be used to generate a static HTML representation of a TiddlyWiki
! Example
You can explore a static representation of the TiddlyWiki5 site at <a href="static.html">static.html</a>. That file is a static representation of the current DefaultTiddlers. Any tiddlers that it links to are referred to via URLs of the form `/static/HelloThere.html` that point to HTML representations of individual tiddlers.
You can explore a static representation of the TiddlyWiki5 site at <a href="static.html">static.html</a>. That file is a static representation of the current DefaultTiddlers. Any tiddlers that it links to are referred to via URLs of the form `/static/HelloThere.html` that point to HTML representations of individual tiddlers. The tiddler HTML files reference a `static.css` stylesheet file.
The included `bld.sh` script includes these commands that are involved in generating the sample static version of the TiddlyWiki5 site:
```
--savetiddler $:/core/templates/static.template.html $TW5_BUILD_OUTPUT/static.html text/plain \
--savetiddler $:/core/templates/static.template.css $TW5_BUILD_OUTPUT/static/static.css text/plain \
--savetiddlers [!is[shadow]] $:/core/templates/static.tiddler.html $TW5_BUILD_OUTPUT/static text/plain \
```
The SaveTiddlerCommand saves the static version of the DefaulTiddlers and the SaveTiddlersCommand generates the HTML representations of individual tiddlers.
The first SaveTiddlerCommand saves the static version of the DefaulTiddlers, the second saves the stylesheet, and the final SaveTiddlersCommand generates the HTML representations of individual tiddlers.