• UserGuideForProgrammer
  • Program in WYSIWYG Editor

    This is built on Mako Template Engine. You can consult Mako Documentation for further information.

    Expression evaluation

    Press ${expr} button, and type this.

    ${5 + 4} ${page.title}

    then you can see the result. 

    9 your page name

    Code block

    Press <%%> button, and insert python code.

    <%
    list = ['Baby', 'Hello', 'Sleep']
    %>
    ${list[0]}

    Result:

    Baby

    Control structure

    Press % for button, and insert python code. You can use for, if, while.

    % for i in range(1,5):
    ${i}
    % endfor

    Result:

    1

    2

    3

    4

    Edit Head

    Template Inheritance

    You can inherit from other wiki page in the mako ways.

    <%inherit file="BaseTemplate"/>

    BaseTemplate is the default template, you can change this to other page.

    HTML head tags

    You can insert tags for JavaScript, CSS like this.

    <%block name="head">
    <script src="http://yandex.st/highlightjs/6.1/highlight.min.js">
    <link href="http://yandex.st/highlightjs/6.1/styles/default.min.css" rel="stylesheet" />
    </%block>
    

    Define Mako block or def

    <%def name="your_block_name">
       blahblah
       ...
       ...
    <%def>

    Now you can call it.

    $ {self.your_block_name()}

     

     


    Attachments

    Edit Rename History