Markdown
Taipy GUI pages can be defined using the Markdown markup language.
Markdown is a lightweight markup language widely used for creating documentation pages. This would
be the ideal format if you are not familiar with web page definition or would like to create a good
visual rendering quickly.
Taipy has an augmented implementation of Markdown that makes it simple to organize the page content
in sections or grids.
Markdown extensions
Taipy uses Python Markdown to translate Markdown text to web pages. Many language extensions are used to make it easier to create nice looking pages that users can enjoy. Specifically, Taipy uses the following Markdown extensions:
Please refer to the Python Markdown package documentation to get information on how to use these.
Creating a page that displays Markdown content is very straightforward:
from taipy.gui import Markdown
md_page = Markdown("""
# Page title
Any [*Markdown*](https://en.wikipedia.org/wiki/Markdown) content can be used here.
""")
The md_page variable contains the definition of a page whose content is defined by Markdown text.
Markdown link syntax
You can use Markdown's native link syntax to easily create links from one page to another.
If, for example, your application has two pages (see in the section on Page how to create such an application, where pages would be called "page1" and "page2"), you can create a link to "page2" from "page1" by adding the following Markdown fragment in the definition of "page1":
...
Go to [Second Page](/page2) for more information.
...
Besides the extensions listed above, Taipy adds its own extension that can parse Taipy-specific constructs that allow for defining visual elements (and all the properties they need). The details on how visual elements are located and interpreted with Markdown content can be found in the Markdown Syntax section about Visual Elements definition.
Commenting Markdown
The Markdown syntax does not explicitly indicate how to insert comments in the text.
However, you can use a link-like construct as a new line in the Markdown body:
Both:
[//]: <> (This is a comment.)
[//]: # (This is another comment.)