X-Git-Url: http://nitlanguage.org diff --git a/contrib/nitiwiki/README.md b/contrib/nitiwiki/README.md index 77e0b56..757fa36 100644 --- a/contrib/nitiwiki/README.md +++ b/contrib/nitiwiki/README.md @@ -174,6 +174,29 @@ will appear like this: `Contact me!`. You can link to an anchor inside a page, using something like `[[WikiLink#foo]]`. +#### Trails of Pages + +Wikilinks, with the directive `trail`, will register the target page as an element of a trail. +Each `trail` are chained together and will display navigational link `prev` for the previous page of the trail, `next` for the next page of the trail and `up` to go to the pages that has used the `trail` wikilink. + +For instance, if the page `doc.md` has the following content: + +~~~md +To use nitiwiki, first [[trail: install|install it]], +then [[trail: simple_wiki|create a first wiki]]. + +You can also do advanced things like: + +* [[trail: github|editing pages with github]] +* [[trail: templating| adapting the templates]] +~~~ + +A trail will be made and will consist of the sequence of pages `install`, `simple_wiki`, `github` and `templating`. +On each one of these pages, there will be links for the previous page, the next page and the `doc.md` page. + +If a page includes trail wikilinks and is also the target for trail wikilinks, then the two trails are merged and pages will be visitable in a depth-first order. +This nesting of trails can be used to have sections and sub-sections. + #### Render the wiki in HTML Once you have done your changes, use: @@ -227,7 +250,7 @@ Every template can access to: * `SUBTITLE`: Wiki description * `LOGO`: Wiki logo image path -Additionnal macros can be used in specialized templates. +Additional macros can be used in specialized templates. ### Main template @@ -243,7 +266,9 @@ The template file `template.html` represents the overall structure of your wiki %HEADER% %TOP_MENU%
+ %TRAIL% %BODY% + %TRAIL% %FOOTER%
@@ -256,6 +281,7 @@ Additionnal macros: * `TOP_MENU`: Wiki top menu (see [Topmenu template](#Topmenu_template)) * `HEADER`: Wiki header (see [Header template](#Header_template)) * `BODY`: Wiki body content +* `TRAIL`: content of the trail navigational links, if any (see [Trails of Pages](#Trails_of_Pages)) ### Header template @@ -337,3 +363,17 @@ from git: Be sure to set `wiki.rsync_dir` in order to correctly push your changes. When using `--rsync`, keep in mind that the rendered output must be configured to work on the web server. + +### Serve and edit with nitiwiki_server + +nitiwiki_server is a lightweight web server to publish the generated files +and accept modifications from a web form. + +The binary available in `bin/nitiwiki_server` is configured for simple usage or demo. +The source of the server, at `src/wiki_edit`, can be tweaked for more advanced use. +It is also possible to import the source and add an instance of `EditAction` to a custom nitcorn server. + +To launch the server, change directory to the root of the wiki and run `nitiwiki_server`. +It uses `config.ini` from the local directory and listen on localhost:8080. +The template should define the macro `%EDIT%` and `config.ini` should define `wiki.edit=/edit/`. +To limit who can edit the wiki, list the md5 sum of accepted passwords (one per line) in the local file `passwords`.