1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-14 05:44:50 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/howtos/Using TiddlyWiki for GitHub project documentation.tid

30 lines
1.7 KiB
Plaintext
Raw Normal View History

created: 20130825150100000
2014-09-12 15:05:37 +00:00
modified: 20140912141559011
tags: [[TiddlyWiki on Node.js]]
2014-10-20 17:06:08 +00:00
title: Using TiddlyWiki for GitHub project documentation
type: text/vnd.tiddlywiki
2013-06-26 17:16:01 +00:00
2014-10-17 15:29:27 +00:00
TiddlyWiki5 can be used to produce documentation for GitHub projects. It lets you maintain a single set of documentation as a [[TiddlyWikiFolder|TiddlyWikiFolders]] containing separate tiddler files under source code control, and then use it to produce `readme.md` files for inclusion in project folders, or HTML files for storage in [[GitHub Pages|http://pages.github.com/]]. Both features are demonstrated by TiddlyWiki5 itself.
2013-06-26 17:16:01 +00:00
! Generating `readme.md` files
When displaying the contents of a folder GitHub will look for a `readme.md` file and display it. Note that it will not display full HTML files in this way, just static MarkDown files (this is a security measure). Happily MarkDown permits a safe subset of HTML, and thus to generate a `readme.md` file that is suitable for GitHub it is just necessary for TiddlyWiki5 to generate the content of the `<body>` element of an HTML document, and give it the appropriate filename.
2014-10-17 15:29:27 +00:00
This is done with this command:
2013-06-26 17:16:01 +00:00
```
--rendertiddler ReadMe ./readme.md text/html
2013-06-26 17:16:01 +00:00
```
It saves the tiddler ReadMe to the file `./readme.md` in the `text/html` format.
2014-08-28 21:28:02 +00:00
By default, tiddler links will be rendered as `<a>` links to a relative URI consisting of the title of the tiddler. This behaviour can be overridden by defining the macro `tv-wikilink-template`, as is done at the top of the tiddler ReadMe:
2013-06-26 17:16:01 +00:00
```
\define tv-wikilink-template() https://tiddlywiki.com/static/$uri_doubleencoded$.html
2013-06-26 17:16:01 +00:00
```
See the LinkWidget for more details.
In this example, tiddler links are rendered as links to the static rendering of tw5.com.