MM-DOCS
Full documentation
📖 Publication Date : 2024-06-25
Content
MM-DOCS↵
This project is used to produce all forms of documentation for the service using Markdown and other repository friendly markup languages.
The documentation is created using the mm-docs docker bundle:
Features↵
- Write documentation in extended Markdown, HTML, PlantUML and other markup languages
- Beautiful responsive design using material theme
- Navigational bar, TOC, search, internationalization, and various rich presentation functionalities
- Rich diagrams and interface mockups using PlantUML
- Macros can be written in python
- PDF export for each page or full site
- Single page with entire documentation
- Live reload during editing
- GitLab/GitHub repository connection for editing within a browser
- Automated AppVeyor build and deploy to GitHub pages using Ubuntu image
- Cross platform for hosting and development
Prerequisites↵
- Docker
- PowerShell (optional, developer friendliness)
- Invoke-Build module
Quick start↵
To edit documentation:
- Clone/use new project template
- Add new documents somewhere in the
source\docs
hierarchy. - Add document path to TOC (file:
source\mkdocs.yml
; yaml key:nav
) to make page visible in the navigation section, otherwise, the page is available via direct link.
Start development server - run in PowerShell Invoke-Build Run
. The command is syntax sugar for running docker containers.
To build static site run Invoke-Build Build
.
Demonstration page↵
mm-docs demonstration page.
For more details about included tools see:
Customization↵
Text↵
Unicode: Мислим дакле постојим
Basic effects↵
Output | Code |
---|---|
Bold text | **Bold text** or __Bold text__ |
Italic text | *Italic text* or _Italic text_ |
~~Strike Through~~ |
|
Colored text | ==Colored text== |
Inline code |
`Inline code` |
Subscript and supscript:
- H~2~0
- A^T^A
- H20
- ATA
Buttons↵
[Subscribe to our newsletter](#){ .md-button }
Local files and images↵
![omg-lolcat](files/omg-lolcat.jpg)
To align image and add some text next to it you must put in div with class result
:
<div class="result" markdown>
![omg-lolcat](files/omg-lolcat.jpg){ align=left }
</div>
Some OMG cat is displayed here.
Some more text here...
Hotkeys↵
Output | Code |
---|---|
Enter | ++enter++ |
PgDown | ++"PgDown"++ |
Non Existent Key | ++"Non Existent Key"++ |
Links, footnotes and comments↵
Links↵
Output | Code |
---|---|
An inline-style link | [An inline-style link](https://www.google.com) |
An inline-style link with title | [An inline-style link with title](https://www.google.com "Google's Homepage") |
Reference-style link | [Reference-style link][arbitrary reference text] [arbitrary reference text]: https://www.mozilla.org |
Relative reference to a repository file | [Relative reference to a repository file](../about/overview) |
Numbers for reference-style link definitions | [Numbers for reference-style link definitions][1] [1]: http://slashdot.org |
Use the link text itself | Use the [link text itself] [link text itself]: http://www.reddit.com |
Magic links and emails: turned to links as recognized
Output | Code |
---|---|
http://www.google.com | http://www.google.com |
majkinetor@gmail.com | majkinetor@gmail.com |
www.google.com | www.google.com |
Footnotes↵
A text with a short footnote[^short]
[^short]: https://en.wikipedia.org/wiki/Note_(typography)
A text with a short footnote1
A text with a long footnote[^long]
[^long]:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
massa, nec semper lorem quam in massa.
```
code
A text with a long footnote2
Comments↵
The text contains 2 comments bellow this line which should not be visible.
[comment]: # (Developed using Visual Studio Code with plantuml extension: cinst visualstudiocode; code --install-extension jebbs.plantuml)
[comment]: # (PlantUML version may influence diagrams. This document is developped with 1.2017.15: cinst plantuml --version 1.2017.15)
The text contains 2 comments bellow this line which should not be visible.
Citations↵
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Inline:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Another citation linecode in citations
HTML↵
HTML is allowed without restrictions. Custom styles are added in docs\_css\extra.css
file.
<div style='background-color: #fdd; padding:1em; text-align: center '>
<font size="20">
<span class="yellow bred pl1 pr1">cookies</span>
</font>
</div>
Critic and comments↵
Here is some incorrect Markdown. I am adding this here. Here is some more text that I am removingtext. And here is even more text that I am adding.
Paragraph was deleted and replaced with some spaces.
Spaces were removed and a paragraph was added.
And here is a comment on some textThis works quite well. I just wanted to comment on it.. Substitutions isare great!
General block handling:
- test remove
- test remove
- test add
- test add
Emoji and icons↵
Use more than 7.000 icons and thousands of emojis in your project documentation with zero effort. Custom icons can be added and used in mkdocs.yml
, documents and templates.
Examples:
:tada:
:jack_o_lantern:
:alien:
:robot_face:
:smile:
:heart:
:thumbsup:
- –
:material-account-circle:
(icon in.icons/material/account-circle.svg
) - –
:fontawesome-regular-face-laugh:
(icon in.icons/fontawesome/regular/face-laugh.svg
) - In a link
Lists↵
Ordered list↵
- List item 1
- List item 2
- List item 2.1
- List item 2.2
- List item 2.2.1
- List item 2.2.2
- List item 2.3
- List item 4
Unordered, mixed↵
- List item 1
- List item 2
- List item 2.1
- List item 2.2
- List item 2.2.1
- List item 2.2.2
- List item 2.3
- List item 4
Tables↵
Col1 | Col2 |
---|---|
row1.1 | row1.2 |
row2.1 | row2.2-1 row2.2-2 |
Plantuml↵
Add plantuml
in a block code header to set code section as PlantUml source. Use format
to specify output type:
```plantuml format="svg" title PlantUml Demo left to right direction skinparam packageStyle rectangle actor customer actor clerk rectangle checkout { customer -- (checkout) (checkout) .> (payment) : include (help) .> (checkout) : extends (checkout) -- clerk } ```
Mermaid↵
```mermaid sequenceDiagram Alice->>John: Hello John, how are you? loop Healthcheck John->>John: Fight against hypochondria end Note right of John: Rational thoughts! John-->>Alice: Great! John->>Bob: How about you? Bob-->>John: Jolly good! ```
sequenceDiagram
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
MathJax↵
The block code:
``` $$ \frac{n!}{k!(n-k)!} = \binom{n}{k} $$ ```
Inline math expressions: $p(x|y) = \frac{p(y|x)p(x)}{p(y)}$
Inline math expressions: \(p(x|y) = \frac{p(y|x)p(x)}{p(y)}\)
NOTE:
- This doesn't render corretly in PDF output, see this issue for explanation.
Admonition↵
Note
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Collapsed closed
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Collapsed open
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
Extreme danger
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.
some code
Some citation
Code Highlight↵
import tensorflow as tf
With tabs:
#!/bin/bash
echo "Hello world!"
Write-Host "Hello world!"
#include <stdio.h>
int main(void) {
printf("Hello world!\n");
}
#include <iostream>
int main() {
std::cout << "Hello world!" << std::endl;
return 0;
}
using System;
class Program {
static void Main(string[] args) {
Console.WriteLine("Hello world!");
}
}
Abbreviations↵
The following are defined in single file, _inc\abbr.md
and included on each page.
- IT, XML, JSON
Smart symbols↵
(tm)
™(c)
©c/o
℅+/-
±-->
→<--
←<-->
↔=/=
≠1/4
¼1st
1st
Task list↵
- Lorem ipsum dolor sit amet, consectetur adipiscing elit
- Curabitur elit nibh, euismod et ullamcorper at, iaculis feugiat est
- Vestibulum convallis sit amet nisi a tincidunt
- In hac habitasse platea dictumst
- Praesent sed risus massa
- Nulla vel eros venenatis, imperdiet enim id, faucibus nisi
Macros↵
Variable from config | extra.version = 0.1 |
Variable from this page | acme = Acme Company Ltd |
Macro (defined in main.py ) |
bar(1) = 9.3 - barbaz(3) = 9 |
Python variable (defined in main.py ) |
baz = John Doe |
Dictionary variable from config | company.name = Acme |
Jinja templates↵
You can do all the work you want with Jinja2, including defining pure macros, conditionals and for loops:
{% macro input(name, value='', type='text', size=20) -%} <input type="{{ type }}" name="{{ name }}" value="{{ value}}" size="{{ size }}"> {%- endmacro %} {% input('username') }} {% input('password', type='password') }}
Includes↵
You may use the include directive from jinja2, directly in your markdown code e.g.:
## Paragraph {%include 'snippet.md' %} {%include 'html/content1.html' %}
The root directory for your included files is in docs_dir
.
You can also include parts of the file.
Environment variables↵
Environment variables can be used inside of configuration file mkdocs.yaml
. More...
site_name: !ENV CI_PROJECT_PATH
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod massa, nec semper lorem quam in massa.
↩code
Extra ↵
Variables↵
Context↵
[(0, 'Page', "Page(title='Home', url='index.html')"), (1, 'Page', "Page(title='Demonstration', url='demo.html')"), (2, 'Section', "title = 'Extra', children = [Page(title='Variables', url='vars.html'), Page(title='Revision', url='revision.html')], _Section__active = False"), (3, 'Page', "Page(title='Download', url='download.html')")]
Page↵
Variable | Type | Content |
---|---|---|
file | File | src_uri = 'vars.md', src_dir = '/docs/source/docs', dest_dir = '/docs/source/site', use_directory_urls = False, inclusion [InclusionLevel], name = 'vars', dest_uri = 'vars.html', page [Page], abs_src_path = '/docs/source/docs/vars.md', url = 'vars.html' |
title | str | 'Variables' |
children | NoneType | None |
previous_page | Page | Page(title='Demonstration', url='demo.html') |
next_page | Page | Page(title='Revision', url='revision.html') |
_Page__active | bool | False |
update_date | str | '2024-06-25' |
canonical_url | NoneType | None |
abs_url | NoneType | None |
edit_url | str | 'https://github.com/majkinetor/mm-docs-template/edit/master/source/docs/vars.md' |
markdown | str | "# {{ page.title }}\n\n## Context\n\n{{ context(navigation) }}\n\n## Page\n\n{{ context(page) | pretty }}\n\n## Config\n\n{{ context(config) | pretty }}\n\nFrontmatter var - foo: {{ page.meta.foo }}\n\n{% include 'footer.md' %}" |
_title_from_render | NoneType | None |
content | NoneType | None |
toc | list | [] |
meta | dict | title = 'Variables', foo = 'bar' |
parent | Section | title = 'Extra', children = [Page(title='Variables', url='vars.html'), Page(title='Revision', url='revision.html')], _Section__active = False |
Config↵
Variable | Type | Content |
---|---|---|
config_file_path | str | '/docs/source/mkdocs.yml' |
site_name | str | 'MM-DOCS' |
nav | list | [{'Home': 'index.md'}, {'Demonstration': 'demo.md'}, {'Extra': [{'Variables': 'vars.md'}, {'Revision': 'revision.md'}]}, {'Download': 'download.md'}] |
pages | NoneType | None |
exclude_docs | NoneType | None |
draft_docs | NoneType | None |
not_in_nav | NoneType | None |
site_url | NoneType | None |
site_description | str | 'MM-DOCS Template' |
site_author | str | 'majkinetor' |
theme | Theme | Theme(name='material', dirs=['/docs/source/overrides', '/usr/lib/python3.12/site-packages/material/templates', '/usr/lib/python3.12/site-packages/mkdocs/templates'], static_templates={'404.html', 'sitemap.xml'}, name='material', locale=Locale('en'), language='en', direction=None, features=['navigation.expand', 'navigation.top', 'navigation.indexes', 'navigation.footer', 'content.action.edit', 'search.highlight', 'search.suggest'], font={'text': 'Roboto', 'code': 'Roboto Mono'}, icon=None, favicon='assets/images/favicon.png', palette=[{'scheme': 'default', 'toggle': {'icon': 'material/lightbulb-outline', 'name': 'Switch to dark mode'}}, {'scheme': 'slate', 'toggle': {'icon': 'material/lightbulb', 'name': 'Switch to light mode'}}]) |
docs_dir | str | '/docs/source/docs' |
site_dir | str | '/docs/source/site' |
copyright | str | '© majkinetor 2019' |
google_analytics | NoneType | None |
dev_addr | _IpAddressValue | _IpAddressValue(host='0.0.0.0', port=8000) |
use_directory_urls | bool | False |
repo_url | str | 'https://github.com/majkinetor/mm-docs-template' |
repo_name | str | 'GitHub' |
edit_uri_template | NoneType | None |
edit_uri | str | 'edit/master/source/docs/' |
extra_css | list | ['_extra/css/extra.css', '_extra/css/pdf.css'] |
extra_javascript | list | ['_extra/js/mathjax.js', '_extra/js/tablesort.js', 'https://polyfill.io/v3/polyfill.min.js?features=es6', 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js', 'https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js'] |
extra_templates | list | [] |
markdown_extensions | list | ['toc', 'tables', 'fenced_code', 'abbr', 'admonition', 'attr_list', 'codehilite', 'def_list', 'footnotes', 'md_in_html', 'meta', 'sane_lists', 'pymdownx.arithmatex', 'pymdownx.betterem', 'pymdownx.caret', 'pymdownx.critic', 'pymdownx.details', 'pymdownx.emoji', 'pymdownx.inlinehilite', 'pymdownx.keys', 'pymdownx.magiclink', 'pymdownx.mark', 'pymdownx.superfences', 'pymdownx.smartsymbols', 'pymdownx.tabbed', 'pymdownx.tasklist', 'pymdownx.tilde', 'markdown_include.include', 'plantuml_markdown'] |
mdx_configs | dict | toc [dict], pymdownx.arithmatex [dict], pymdownx.betterem [dict], pymdownx.emoji [dict], pymdownx.superfences [dict], pymdownx.tabbed [dict], pymdownx.tasklist [dict], markdown_include.include [dict] |
strict | bool | False |
remote_branch | str | 'gh-pages' |
remote_name | str | 'origin' |
extra | LegacyConfig | {'url_prefix': None, 'version': 0.1, 'company': {'name': 'Acme'}, 'social': [{'icon': 'dummy value to show social override'}], 'polyfills': ['https://unpkg.com/iframe-worker/shim']} |
plugins | PluginCollection | material/offline [OfflinePlugin], exclude [Exclude], macros [MacrosPlugin], material/search [SearchPlugin], material/tags [TagsPlugin], pdf-export [PdfExportPlugin], print-site [PrintSitePlugin] |
hooks | dict | |
watch | list | [] |
validation | Validation | {'nav': {'omitted_files': 20, 'not_found': 30, 'absolute_links': 20}, 'links': {'not_found': 30, 'absolute_links': 20, 'unrecognized_links': 20, 'anchors': 20}} |
Frontmatter var - foo: bar
Revisions↵
Build Date: 2024-06-25 11:37:59
Date | Path |
---|---|
2024-06-25 11:37:41 | about/overview.md |
2024-06-25 11:37:41 | tags.md |
2024-06-25 11:37:41 | demo.md |
2024-06-25 11:37:41 | download.md |
2024-06-25 11:37:41 | index.md |
2024-06-25 11:37:41 | vars.md |
Ended: Extra
Download↵
You can consume this documentation off-line via:
- PDF that you can download
- Standalone single HTML page that you can save
- Entire site in ZIP archive that you can unpack and use locally starting from
index.html