Lionwiki-t2t


Read this help in French. Lire cette aide en français.

Read the full syntax help.

Lionwiki-t2t is a wiki system for the creation and maintenance of websites.

Lionwiki-t2t pages looks the same as normal webpages, but in addition they have an "Edit" link which helps to edit or add new pages on a website, with a lightweight markup language, like for http://www.wikipedia.org.

This system has some ready to use extensions and a simplified and customisable syntax.

Presentation

The pages on this site are wiki-based pages, which means that pages can be created and edited by multiple authors. To edit a page, click on the "edit" link which exists somewhere on the page (generally at the top or in the footer). Some pages may be protected by a password.

In this wiki, unless you're using an integrated system such as YunoHost, the default password is "demo". It is adviced to modify it after the installation (see below).

When you edit a page, you see the markup which describe the content of the page. The final rendering, with the choosen formatting, will be displayed only after the page is saved.

The basic rules for page markup are simple (you will find them below).

Editing rules (syntax)

The syntax of this wiki is following the general rules of txt2tags syntax, which you can find here as a reminder. The idea is you should be able to paste here your txt2tags documents without many modifications (explained in the second part of this document).

But the easiest way is to use the file attachment function (see below)

Generally, you can also select your text to format, and use the toolbar to help you write.

  1. click on Upload content index.php?action=upload
  2. or add ?action=upload at the end of any page

images can be put in place either by copying them into the uploads folder or by uploading them individually with the method above.

Basic Syntax

Header title title 2 title 3
table cell 2 cell 3 cell 4
table cell 2 cell 3 cell 4

Installation

Linux / Unix

Lionwiki is easy to install, no need to setup a sql database: a webserver (Apache, Lighttpd or Nginx) + php will be enough.

Here is what is possible to do:

(remove -minimal from the address above to get the complete version, with all templates and extensions)

Windows

On windows system, get an HTTP server, such as XAMPP

Android

If you're on Android and you wish to use your tablet / phone / androidtv as a server, you can use this app which is a free webserver. Install the php plugin, and copy the files of the wiki into /sdcard/paw/html. Then visit http://localhost:8080/lionwiki-t2t from your android system.

YunoHost

In Yunohost, you can install it by searching for "lionwiki" in the application store.

For more control you can also install it by ftp with the application "MyWebApp", and manage the updates yourself.

Docker

Go into infra/docker and type "make run" to build an image and deploy a new container. Learn more in the doc in the infra/ folder.

Usage and configuration

Txt2tags configuration

config.t2t is called from the main index.php file, and therefore all replacements and configurations in it are concerning the whole wiki. You can have a look at the txt2tags manual for how to use the preproc and postproc directives.

Generally speaking, preproc are for customising the wiki syntax (adding new markup), and postproc are for adding extra html and css.

Let's say you wish to add the markdown headers in the wiki (it's already implemented, check config.t2t at the root of the lionwiki-t2t installation):

Then we add into config.t2t this syntax:

  %!preproc: '^# (.*?)$' '= \1 ='

it means it will process all text (.*?) starting with a # at the beginning of a line (^), until the end of the line ($) and replace it with the txt2tags markup for headings level 1 (= heading =).

Now let's say you wish to add the new @@SLIDER@@ markup into your website, then add this line into config.t2t:

  %!postproc: '@@SLIDER@@' '<input type="range" min="1" max="100" class="slider">'

it will result in:

You could also refine the markup by adding the min and max values with @@SLIDER@@1/100@@ which would give more sense. See the "progress bar" example into config.t2t for a similar case.

You can also define a set of rules only available for one page. Create a newrule.t2t at the root of the installation. Then include it into the page with:

  %!includeconf:newrule.t2t

At the moment there are :

Templates

Templates are defining the general placement of elements of your wiki (menu on the top, "edit" on the right of the menu, or at the bottom instead etc.).

They are using simple HTML elements, which you can edit yourself. The curly brackets are for lionwiki-t2t special elements, like {EDIT}, {CONTENT}, {HOME}. By moving those elements elsewhere, you can redefine the template.

As said above, you can select the default template in the config.php file. Templates can be found in the templates/ folder. You can test and explore them. You can also select a default template on the admin page, but it will only change it locally (in your browser).

Templates folders also contains CSS themes which you can also customise further (see below).

Some notable templates (with several color schemes):

More templates can be downloaded from https://github.com/farvardin/lionwiki-templates

Themes

Most templates contain a .less file which define the general appearance (color scheme, font size and definition, size...). They also load a temporary .less file which can change foreground (@fg) and background (@bg) colors, as well as links and heading, and default font. This temporary .less file is feed by definition files from the templates/css/ folder and will also generate .css files inside its template folder, by using the associated makefile.

For example for the newspaper template, you can easily change:

  1. templates/newspaper/newspaper.html for putting the link on top instead of on bottom (or in addition to bottom)
  2. templates/newspaper/newspaper.less for changing main text width, line height, margins
  3. templates/css/newspaper_theme01.less for changing default colors and font

then generate the new theme with "make newspaper_theme01" inside /templates/newspaper folder (lessc is needed). newspaper.less is importing the "newspaper_temp.less" file. Then newspaper.less is called from within the newspaper.html template. You can remplace this dynamic generation (which will be slightly less optimized than a static .css file) by removing the less.js script, the newspaper.less link from newspaper.html, and call a link to newspaper_theme01.css instead for example.

Index

You can create an index of all your pages by adding {INDEX_LIST} to a page (see page list|page_list). To highlight certain important pages, you can indicate in the title :

If an internal link with such a title does not work, please replace the # with %23, e.g. page%23CY%23 instead of page#CY#

Synchronize

To synchronise your wiki with your mobile devices, install this in addition:

Export as PDF

You can also export some of your pages in pdf and use your wiki as a word processor / document generator. We use textallion for this. Install textallion on your server (installed by default in /usr/share/textallion/), copy the content of /usr/share/textallion/contrib/latexlib/* into /var/www/lionwiki-t2t/export_pdf/. Uncomment in /var/www/lionwiki-t2t/menu.php the part related to "Generate pdf". If textallion is correctly setup, you should be able to render a pdf document from the content of the "textallion" page from your wiki. You can edit /var/www/lionwiki-t2t/export_pdf/lionwiki.t2t to add more pages.

If it doesn't work as expected, run /var/www/lionwiki-t2t/export_pdf/run.php and trace the errors from there. When it's correctly set up, you should be able to do this from any browser which can access your lionwiki-t2t installation.

Avantages

Some advantages:

Tips

Known bugs

(#help)