Lionwiki-t2t |
Home Pages list |
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.
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).
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).
-
for a bulleted list
or +
for a numbered list.
=
.
//text//
for italics or **text**
for bold.
[[new page]]
links to that page. A link to a nonexistent page is displayed differently, to invite others to create the page.
[description of the site http://www.site.com]
[pdf file var/upload/your-file.pdf]
Which gives:
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.
%%toc
at the desired location
?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.
=
surrounding your titles / headings (at different levels)
Header title | title 2 | title 3 | ||
---|---|---|---|---|
table | cell 2 | cell 3 | cell 4 | |
table | cell 2 | cell 3 | cell 4 |
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:
apt-get install php5-sqlite apache2 libapache2-mod-php5
on Debian Linux systems)
(remove -minimal from the address above to get the complete version, with all templates and extensions)
On windows system, get an HTTP server, such as XAMPP
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.
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.
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.
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 :
cyoa.t2t
for creating choose your own adventure elements (see sandbox_cyoa)
todotxt.t2t
for parsing todo.txt files (see todo). You can synchronise and edit this todo.txt found in var/pages/todo.txt with other tools (official todo.txt cli, markor or simpletask on Android...)
abcjs.t2t
to display musical scores in abc format (see sample.abc).
config.t2t
file.
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
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:
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.
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#
To synchronise your wiki with your mobile devices, install this in addition:
var/pages/
between your server and your mobile device (tablet, phone), using ssh or owncloud.
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.
Some advantages:
about:config
, just search for layout.word_select.
and select eat_space_to_next_word
to False
.
var/pages
folder is protected by .htaccess. Don't forget to enable it in both your /etc/apache2/sites-available/default
and /etc/apache2/sites-available/default-ssl
configurations!
(#help)