1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76{Title}{Example article}
{Description}{Example article}
{Keywords}{Example, Flask}
{Date}{19/12/2015}
{Author}{Philipp Hagenlocher}
{Filetype}{flask-article}
---
* Introduction
This example article shows the functionality of <b>flask-article</b>.
* What does it do?
<b>flask-article</b> provides a flask-dev with the <em>ScriptLoader</em>. Its
purpose is to dynamically load scripts that you put on your webserver. <b>No
database required.</b> Performance is kept in mind by using caching to store
the parsed scripts in memory. <em>This example page was created by <b>
flask-article</b>.</em>
* How to write scripts
The scripts use their own format which is easy to use. First of you set
certain attributes called <em>tags</em> in your script.
<pre>
{Title}{Example article}\\
{Description}{Example article}\\
{Keywords}{Example, Flask}\\
{Date}{19/12/2015}\\
{Author}{Philipp Hagenlocher}
</pre>
After that, you can start adding content to your page. You can even use <em>
pure HTML</em>!
** Sections
<b>flask-article</b> provides automatic numbering and automatic creating of
a table of contents. This is done by using <em>sections and subsections</em>.
It looks like this:
<pre>
* Section\\
\\
** Subsection
</pre>
You can use text between them however you want! The table of content will
automatically link to a reference to that section. This is great when creating
a complex tutorial or even something bigger.
\\\\
Your sections will be titlecased automatically. If you <b>do not want this</b>
you can add a '_' infront of your title like this:
<pre>
*_ Section\\
\\
**_ Subsection
</pre>
** The template
Since you are using flask, you will be using Jinja2 for your templates. It is
pretty easy. The tags you set in this script will be set with the same value
in your Jinja2-template. Let's image you used the following tags:
<pre>
{AdditionalName}{ ... }\\
{SomeInfo}{ ... }
</pre>
You then can use the following tags in Jinja2:
<pre>
{{ AdditionalName }}\\
...\\
{{ SomeInfo }}
</pre>
The values you specified will be inserted into your HTML-template!