====== Polymake jupyter tutorials that should end up on the website ======
Jupyter notebooks support github flavored markdown ''%%gfm%%'' which will be further treated by ''%%pandocfilters%%'' and ''%%pandoc%%'' during the conversion to dokuwiki. Here are some useful links:
* [[https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Working%20With%20Markdown%20Cells.html|Working with markdown Cells in jupyter]]
* [[https://github.github.com/gfm/|github flavored markdown specs]]
* [[https://pandoc.org/|pandoc]]
* [[https://github.com/jgm/pandocfilters|pandocfilters]]
In order to make everything work in both jupyter and dokuwiki (and without reediting much after conversion), there are a few general things to take note of :
* Use only lower case letters, digits, hyphens and underscores for your notebook name. ''%%[a-z0-9_-]%%''
* Do not put code (with backticks) inside of link or image captions
Others require their own section:
===== Markdown =====
==== Embedding images ====
Filenames of images should be lower case aswell and they should be base64 attached. Dragging and dropping them into the notebook creates a syntax like ''%%![tooltip](attachment:logo.png)%%''. {{:tutorials:release:4.13:jupyter_tutorials:logo.png|tooltip}}
This syntax, however, does not support image formatting inside of the notebook or the dokuwiki page it will end up on. Thus, if you need more control use img tags and their style attribute. Some examples:
An inline image: ''%%%%''
As a block: ''%%%%''
To display the image as a centered block in dokuwiki, like it is the default in jupyter, you may add something like ''%%style="display: block, margin-left: auto, margin-right: auto"%%'' or use the css ''%%class="center-block"%%''
Attached images will be extracted and the conversion process handles the replacement of "attachment:" with a proper link to the image in dokuwiki.
==== Links ====
To other ipynbs:
''%%[Tutorial on Polytopes](apps_polytope.ipynb)%%'': [[apps_polytope|Tutorial on polytopes]]
Internal section links:
''%%[More Markdown](#More-Markdown)%%'': [[#more_markdown|More Markdown]]
Due to differing seperation characters ''%%-%%'' in jupyter and ''%%_%%'' in polymake dokuwiki, it is not possible to link to section headings with hyphens directly, yet simply adding a dokuwiki friendly hyperlink ''%%%%'' is a workaround:
''%%[A non hyphen-free heading](#a_non_hyphen_free_heading)%%'': [[#a_non_hyphen_free_heading|A non hyphen-free heading]]
Links to sections in other ipynbs:
''%%[Convex Hulls in the tutorial on polytopes](apps_polytope.ipynb#Convex-Hulls)%%'' [[apps_polytope#convex_hulls|Convex Hulls in the tutorial on polytopes]]
To something in the documentation:
''%%[linearprogram properties](https://polymake.org/doku.php/documentation/latest/polytope/linearprogram#properties)%%'' [[documentation:latest:polytope:linearprogram#properties|linearprogram properties]]
To a downloadable file:
''%%[filtrationexample]https://polymake.org/lib/exe/fetch.php/tutorial/filtrationexample.top%%'' {{:tutorial:filtrationexample.top|filtrationexample}}
==== A non hyphen-free heading ====
===== Code =====
Svg and threejs output created in notebooks will also end up on the dokuwiki website. Thus, for working with notebooks that already contain svg output, it is recommended to have the perl SVG module installed and svg configured
> reconfigure("common::svg.rules");
If svg is configured, it will be the prefered output for lattices in jupyter polymake.
> svg(cube(3)->HASSE_DIAGRAM->VISUAL);
> cube(3)->HASSE_DIAGRAM->VISUAL;
{{ tutorials:release:4.13:jupyter_tutorials:output_0.svg }}
{{ tutorials:release:4.13:jupyter_tutorials:output_1.svg }}
> # two threejs outputs
> cube(3)->VISUAL;
> simplex(3)->VISUAL;