Skip to content

Zensical Zensical

This website is built with Zensical, a static site generator from the team behind Material for MkDocs. All it requires is a Markdown file for every page, and a configuration file that connects everything together. With Zensical providing the theme, search, and deployment-ready output, I can focus my time on the content of the site.

The site started out on Material for MkDocs. Zensical builds MkDocs projects with few changes, and it is where the team now develops new features, so I moved the site to it.

Useful Documentation Pages

Setup

Project Layout

Path Contents
docs/ A Markdown file for every page, and the images, JavaScript, and CSS they use
includes/abbreviations.md The glossary, which every page gets
zensical.toml The site's configuration: the page tree, theme, plugins, and Markdown extensions

The README explains how to install Zensical and run it, and the repository's other tools.

Page Tree Example

Based on this site. Paths in the page tree are relative to docs/.

nav = [
    { "Home" = "index.md" },                         # Homepage, first tab
    { "Setup" = [                                    # Second tab
        "setup/index.md",                            # Second tab homepage
        { "Settings" = "setup/settings.md" },        # Second tab first page
    ] },
    { "Reference" = [                                # Third tab
        { "Zensical" = "reference/zensical.md" },    # Third tab first page (no third tab homepage)
    ] },
]

Plugins

Zensical has its own implementations of popular MkDocs plugins, so they need no installation:

  • social: a card for each page, shown when a link to it is shared
  • glightbox: opens images in a lightbox
  • redirects: sends /reference/mkdocs/, this page's URL before Zensical, here
  • minify: makes the HTML smaller
  • Search, which is always on

Drafts

A page named *.draft.md appears when previewing the site with make serve, but not in the published site. See draft_docs.

Reference

Demonstrations of the features I use. This page's source shows their Markdown syntax. View the authoring guide for what to add to the configuration file to enable a feature.

Collapsible blocks, code block formatting, embedding external files

Click to toggle open/close

Syntax highlighting for inline code: Python's range() function...

Embed of zensical.toml
[project]
site_name = "Patrick's Notes"
site_url = "https://patrick-5546.github.io/notes/"
site_description = "Patrick Creighton's notes on programming: Windows and Linux setup, internship preparation, and references for Git, Unix and more."
site_author = "Patrick Creighton"
copyright = 'Dedicated to the public domain under <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0</a>'

repo_url = "https://github.com/patrick-5546/notes"
repo_name = "patrick-5546/notes"

strict = true
draft_docs = "*.draft.md"

nav = [
    { "Home" = "index.md" },
    { "Setup" = [
        "setup/index.md",
        { "CLI" = [
            { "Common" = "setup/cli/common-cli.md" },
            { "Unix" = "setup/cli/unix-cli.md" },
            { "Windows" = "setup/cli/windows-cli.md" },
        ] },
        { "Terminal" = [
            { "Unix" = "setup/terminals/unix-terminal.md" },
            { "Windows" = "setup/terminals/windows-terminal.md" },
        ] },
        { "IDE" = "setup/ide.md" },
        { "GUI" = [
            { "Windows" = "setup/gui/windows-gui.md" },
        ] },
    ] },
    { "Internship Preparation" = [
        "internship_prep/index.md",
        { "Applications" = "internship_prep/applications.md" },
        { "Interview Preparation" = "internship_prep/interview_prep.md" },
        { "Hardware Interviews" = [
            { "Reference" = "internship_prep/hardware/hw_reference.md" },
            { "Questions" = "internship_prep/hardware/hw_questions.md" },
        ] },
        { "Software Interviews" = [
            { "Reference" = "internship_prep/software/sw_reference.md" },
            { "Questions" = "internship_prep/software/sw_questions.md" },
        ] },
    ] },
    { "Reference" = [
        { "Bookmarks" = "reference/bookmarks.md" },
        { "Git" = [
            { "Contribution Process" = "reference/git/git_contributing.md" },
            { "Commands" = "reference/git/git_commands.md" },
            { "Advanced Features" = "reference/git/git_advanced.md" },
        ] },
        { "Unix Commands" = "reference/unix.md" },
        { "Zensical" = "reference/zensical.md" },
        { "Python" = "reference/python.md" },
        { "SSH" = "reference/ssh.md" },
        { "Windows Shortcuts" = "reference/shortcuts.md" },
        { "WSL" = "reference/wsl.md" },
    ] },
    { "About Me" = "profile.md" },
]

# KaTeX's latest 0.x release, as in Zensical's docs.
extra_css = [
    "https://cdn.jsdelivr.net/npm/katex@0/dist/katex.min.css",
    "stylesheets/extra.css",
]
extra_javascript = [
    "javascripts/katex.js",
    "https://cdn.jsdelivr.net/npm/katex@0/dist/katex.min.js",
    "https://cdn.jsdelivr.net/npm/katex@0/dist/contrib/auto-render.min.js",
]

[project.theme]
language = "en"
favicon = "assets/images/favicon.svg"
features = [
    "announce.dismiss",
    # "content.action.edit",
    # "content.action.view",
    "content.code.annotate",
    "content.code.copy",
    "content.code.select",
    "content.footnote.tooltips",
    "content.tabs.link",
    "content.tooltips",
    # "header.autohide",
    # "navigation.expand",
    "navigation.footer",
    "navigation.indexes",
    "navigation.instant",
    "navigation.instant.prefetch",
    # "navigation.instant.progress",
    "navigation.path",
    # "navigation.prune",
    "navigation.sections",
    "navigation.tabs",
    # "navigation.tabs.sticky",
    "navigation.top",
    "navigation.tracking",
    "search.highlight",
    "toc.follow",
    # "toc.integrate",
]

[project.theme.icon]
logo = "lucide/notebook-pen"
repo = "fontawesome/brands/github"

[[project.theme.palette]]
media = "(prefers-color-scheme)"
primary = "teal"
accent = "teal"
toggle.icon = "lucide/sun-moon"
toggle.name = "Switch to light mode"

[[project.theme.palette]]
media = "(prefers-color-scheme: light)"
scheme = "default"
primary = "teal"
accent = "teal"
toggle.icon = "lucide/sun"
toggle.name = "Switch to dark mode"

[[project.theme.palette]]
media = "(prefers-color-scheme: dark)"
scheme = "slate"
primary = "teal"
accent = "teal"
toggle.icon = "lucide/moon"
toggle.name = "Switch to system preference"

[[project.extra.social]]
icon = "fontawesome/brands/github"
link = "https://github.com/patrick-5546"
name = "GitHub"

[[project.extra.social]]
icon = "fontawesome/brands/linkedin"
link = "https://www.linkedin.com/in/patrick-5546/"
name = "LinkedIn"

[[project.extra.social]]
icon = "fontawesome/solid/envelope"
link = "mailto:pcreighton429@gmail.com"
name = "Email"

[project.plugins.social]

[project.plugins.glightbox]

[project.plugins.redirects.redirect_maps]
"reference/mkdocs.md" = "reference/zensical.md"

[project.plugins.minify]
minify_html = true

[project.markdown_extensions]
abbr = {}
admonition = {}
attr_list = {}
def_list = {}
footnotes = {}
md_in_html = {}
toc.permalink = true
pymdownx.arithmatex.generic = true
pymdownx.betterem = {}
pymdownx.caret = {}
pymdownx.details = {}
pymdownx.emoji.emoji_generator = "zensical.extensions.emoji.to_svg"
pymdownx.emoji.emoji_index = "zensical.extensions.emoji.twemoji"
pymdownx.highlight.anchor_linenums = true
pymdownx.highlight.line_spans = "__span"
pymdownx.highlight.pygments_lang_class = true
pymdownx.inlinehilite = {}
pymdownx.keys = {}
pymdownx.magiclink = {}
pymdownx.mark = {}
pymdownx.smartsymbols = {}
pymdownx.snippets.auto_append = ["includes/abbreviations.md"]
pymdownx.snippets.check_paths = true
pymdownx.superfences.custom_fences = [
    { name = "mermaid", class = "mermaid", format = "pymdownx.superfences.fence_code_format" },
]
pymdownx.tabbed.alternate_style = true
pymdownx.tabbed.combine_header_slug = true
pymdownx.tasklist.custom_checkbox = true
pymdownx.tilde = {}

Content tabs, icons, glossary

Markdown:

Use the term (i.e. "WSL"). The glossary is appended to every page, so there is nothing to import.

Define the term:

*[WSL]: Windows Subsystem for Linux

Result:

WSL is a term in the glossary.

Table, keyboard keys

Shortcut Description
Alt + (Shift) + Tab Navigate between windows
Win+Ctrl + Left/Right Navigate between virtual desktops
F11 Fullscreen

Task list, inline math equations

  • Result of task list
  • Prove \(e=mc^2\)

KaTeX typesets the math.

Diagrams, text formatting

graph LR
    A[Pull request] --> B[Lint]
    A --> C[Build]
    B --> D[Merge to main]
    C --> D
    D --> E[Deploy to GitHub Pages]

Highlighted, inserted, and deleted text; H2O and 210. See diagrams and formatting.

Building and Deploying

Every push and pull request builds the site in strict mode, which fails on a broken link or anchor, or a missing snippet. The Deploy workflow builds the site again on every push to the main branch, and on demand, then deploys it to GitHub Pages. Only its deploy job can publish the site.

Deploy workflow for this project
.github/workflows/deploy.yml
name: Deploy

on:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read

# Deploy one push at a time, in order.
concurrency:
  group: pages
  cancel-in-progress: false

env:
  # Fail instead of updating uv.lock, including in the uv runs that make starts.
  UV_LOCKED: "1"

jobs:
  build:
    runs-on: ubuntu-26.04
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
      - name: Build
        run: make build
      - name: Upload the site
        uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
        with:
          path: site

  deploy:
    needs: build
    runs-on: ubuntu-26.04
    timeout-minutes: 10
    permissions:
      # deploy-pages publishes the site, proving the workflow's identity with an OIDC token.
      pages: write
      id-token: write
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - id: deployment
        uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1

Example Sites