Post

MkDocs Install - Ubuntu 22.04

MkDocs is a fast, simple and downright gorgeous static site generator that’s geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file.

Install PIP for Python3

1
sudo apt install python3-pip -y

Install MkDocs, the Material Theme and Plugins

1
2
3
4
5
6
7
pip install mkdocs
pip install mkdocs-material-extensions
pip install pymdown-extensions
pip install mkdocs-material
pip install mkdocs-macros-plugin
pip install pillow cairosvg
sudo apt-get install libpangocairo-1.0-0

Config file for MkDocs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
site_name: YourSiteName
site_url: https://DomainName or http://YourServerIP 
theme:
  name: material
  features:
    - navigation.tabs
    - navigation.sections
    - toc.integrate
    - navigation.top
    - search.suggest
    - search.highlight
    - content.tabs.link
    - content.code.annotation
    - content.code.copy
  language: en
  palette:
    - scheme: default
      toggle:
        icon: material/toggle-switch-off-outline
        name: Switch to dark mode
      primary: indigo
      accent: purple
    - scheme: slate
      toggle:
        icon: material/toggle-switch
        name: Switch to light mode
      primary: indigo
      accent: purple

plugins:
  - social
  - search

extra:
  social:
    - icon: fontawesome/brands/github-alt
      link: https://github.com/YOURUSERID
    - icon: fontawesome/brands/twitter
      link: https://twitter.com/YOURUSERID
    - icon: fontawesome/brands/linkedin
      link: https://www.linkedin.com/in/YOURUSERID/
    - icon: fontawesome/solid/envelope
      link: mailto:EMAILADDRESS

markdown_extensions:
  - pymdownx.highlight:
      anchor_linenums: true
  - pymdownx.inlinehilite
  - pymdownx.snippets
  - admonition
  - pymdownx.arithmatex:
      generic: true
  - footnotes
  - pymdownx.details
  - pymdownx.superfences
  - pymdownx.mark
  - attr_list
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg

copyright: |
  &copy; 2023 <a href="https://YourDomainName"  target="_blank" rel="noopener">SiteName</a>

Run MkDocs with the following command:

1
mkdocs serve

If you need to run the server on a specific address and port, run this command:

1
mkdocs serve -a YourServerIP:Port#
This post is licensed under CC BY 4.0 by the author.