Skip to content

mkdocs-material

installation (on archlinux)

sudo pacman -S mkdocs-material python-pymdown-extensions

Also install python paginate. The python-paginate PKGBUILD:

PKGBUILD
pkgname=python-paginate
pkgver=0.1
pkgrel=1
pkgdesc='This module helps dividing large lists of items into pages. '
arch=('any')
url='https://github.com/Pylons/paginate'
license=('MIT')
depends=('python' 'python-click')
makedepends=('python-setuptools-scm' 'python-wheel' 'python-installer' 'python-build')
source=("${pkgname}.zip"::"https://github.com/Pylons/paginate/archive/refs/heads/master.zip")
sha256sums=('SKIP')

build() {
  cd "paginate-master"
  python -m build --wheel --no-isolation
}

package() {
  cd "paginate-master"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dvm644 'README.md' -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dvm644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

adding title to codeblocks

source: https://squidfunk.github.io/mkdocs-material/reference/code-blocks/

```title="/etc/kernel/cmdline"
rd.luks.name=e789d34e-224b-49f6-be22-87f08131e3ad=root root=/dev/mapper/root rw ps1=1
```

results in ...

/etc/kernel/cmdline
rd.luks.name=e789d34e-224b-49f6-be22-87f08131e3ad=root root=/dev/mapper/root rw ps1=1<br>

creating a home page

basics

writing your docs

raw html

You can paste raw html into the site like this:

<figure class="video_container">
  <video controls="true" allowfullscreen="true">
    <source src="../res/out.mp4" type="video/mp4">
  </video>
</figure>

Made use of this in ffmpeg.

source: https://github.com/squidfunk/mkdocs-material/discussions/3984#discussioncomment-6374978

Add isso to mkdocs-material:

For more info check out isso

vector@resonyze ~/vectorspacexyz.github.io (git)-[main] % cat docs/overrides/partials/comments.html
{% if page and page.meta and page.meta.isso is boolean %}
  {% set isso = page.meta.isso %}
{% else %}
  {% set isso = true %}
{% endif %}

{% if not page.is_homepage and isso %}
  <!-- replace disqus with isso -->
  <br>
  <h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
  <div id="disqus_thread"></div>
  <script
    data-isso="https://isso.vectorspace.xyz/"
    data-isso-css="true"
    data-isso-require-author="true"
    data-isso-require-email="true"
    data-isso-reply-to-self="false"
    src="https://isso.vectorspace.xyz/js/embed.min.js">
  </script>
{% endif %}
<section id="isso-thread"></section>

systemd service

~/bin/mkdocs-server.sh:

#!/bin/bash

cd /home/vector/vectorspacexyz.github.io
mkdocs serve

Service file ~/.config/systemd/user/mkdocs-server.service:

[Unit]
Description=Start the mkdocs server

[Service]
ExecStart='/home/vector/bin/mkdocs-server.sh'

[Install]
WantedBy=default.target
Finally:

systemctl --user daemon-reload

systemctl --user start mkdocs.service

systemctl --user enable mkdocs.service

extensions

Add the following to extension:

https://squidfunk.github.io/mkdocs-material/reference/code-blocks/

markdown_extensions:
  - pymdownx.highlight:
      anchor_linenums: true
      line_spans: __span
      pygments_lang_class: true
  - pymdownx.inlinehilite
  - pymdownx.snippets
  - pymdownx.superfences

Comments