DocMarkupVariables
This is done using a python string replacement, and the functionality is provided by the "data_class" class.
These are mostly used in themes and by system code.
How to reference [edit section]
The markup on a page can reference these variables, by putting a python named-string macro in the markup.For example, to reference the 'asctime' value, the page should have the following markup:
The time is: %(asctime)s
With the resulting text being:
The time is Fri Nov 22 03:17:33 2024
These can be used in the header and footer pages for a theme, and are placed inline with the HTML markup.
Variables [edit section]
Here is a list of variables and their common usage:- asctime
- shows the current date and time
- timestamp
- shows the current date and time, in the format of a single string
- login_form
- shows a login form
- login_form_nobr
- shows a login form on a single line
- nav_box_sidebar
- shows the navigation box as a left sidebar box
- nav_bar_bar
- shows the navigation links in a single line
- search_form
- search form in a box
- search_form_nobr
- search form on a single line
- toolbox
- toolbox in a box (usually has 'What links here', etc.)
- action_bar
- this is the set of tabs across the top of the page with different actions that can be performed on the page (usually links to 'article', 'discussion', 'edits this page', and 'history')
- trail_bar
- this is a row of links to the most recently visited pages on this wiki
- message
- this shows any message printed with this page
- content_type
- value for the content/type header (usually text/html)
- cookies
- the string values for any cookies to return to the user
- title
- the title of the page
- site_title
- the title of the wiki site
- base_url
- the URL for the wiki base
- base_css_url
- the URL for where the css file is located
- stylesheet
- the name of the css file
- body_attrs
- the attributes to put in the body tag for the page (this can be used to show different background colors, etc.)
- page_url
- the URL for the current page
- user_name
- the name of the current logged-in user
- user_id
- the id of the current logged-in user
- user_admin
- the admin status (either 1 or 0) of the current logged-in user
- theme
- the name of the theme currently in use
- version
- the version of the tbwiki core engine
- git_commit
- the git hash for the current version of the tbwiki engine
- git_describe
- the "git describe" string for the current version of the tbwiki engine
Configurable items [edit section]
Note that many of these items come directly from variables defined in the wiki instance configuration. See DocConfiguration for more information.