Skip to main content

A GitLab-styled theme for MkDocs

Project description

GitLab MkDocs Theme

A professional, GitLab-styled dark mode theme for MkDocs with a modern design inspired by GitLab's documentation site.

Features

  • Dark Mode Design: Professional dark color scheme with excellent contrast
  • Responsive Layout: Works seamlessly on desktop, tablet, and mobile devices
  • Collapsible Sidebar: Mobile-friendly navigation with hamburger menu
  • Table of Contents: Right sidebar showing page sections for easy navigation
  • Professional Styling:
    • Code blocks with syntax highlighting
    • Styled tables with hover effects
    • Admonitions (note, warning, danger, success)
    • Blockquotes and typography
    • Smooth transitions and animations
  • Splash Page: Hero section template for homepage
  • Search Ready: Compatible with MkDocs search plugin

Installation

Install the theme using pip:

pip install mkdocs-gitlab-theme

Usage

Update your mkdocs.yml to use the GitLab theme:

theme:
  name: gitlab
  logo: assets/logo.svg
  favicon: assets/favicon.ico

Configuration

Basic Configuration

theme:
  name: gitlab
  logo: assets/logo.svg
  favicon: assets/favicon.ico

With Navigation

theme:
  name: gitlab
  logo: assets/logo.svg
  favicon: assets/favicon.ico

nav:
  - Home: index.md
  - Getting Started:
    - Overview: getting-started/overview.md
    - Installation: getting-started/installation.md
  - Documentation:
    - Guide: docs/guide.md
    - API: docs/api.md

With Search

theme:
  name: gitlab

plugins:
  - search:
      lang: en

Color Palette

The theme uses a professional dark mode color scheme:

  • Primary Text: #c7d2fe (Light Indigo)
  • Accent: #818cf8 (Indigo)
  • Background: #0f172a (Dark Slate)
  • Secondary Background: #1e293b
  • Border: #475569

Customization

Custom CSS

Create a docs/stylesheets/custom.css file and add it to your mkdocs.yml:

extra_css:
  - stylesheets/custom.css

Custom JavaScript

Create a docs/javascripts/custom.js file and add it to your mkdocs.yml:

extra_javascript:
  - javascripts/custom.js

Override Templates

To override theme templates, create an overrides directory:

docs/
├── index.md
├── overrides/
│   └── main.html
└── stylesheets/
    └── custom.css

Then update your mkdocs.yml:

theme:
  name: gitlab
  custom_dir: overrides

Markdown Extensions

The theme works with common MkDocs markdown extensions:

markdown_extensions:
  - pymdownx.superfences
  - pymdownx.tabbed
  - pymdownx.emoji
  - admonition
  - codehilite
  - toc:
      permalink: true

Admonitions

Use admonitions for highlighted content:

!!! note
    This is a note admonition.

!!! warning
    This is a warning admonition.

!!! danger
    This is a danger admonition.

!!! success
    This is a success admonition.

Browser Support

  • Chrome/Edge (latest)
  • Firefox (latest)
  • Safari (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

License

MIT License - See LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues, questions, or suggestions, please visit: https://gitlab.com/gitlab-org/mkdocs-gitlab-theme/-/issues

Changelog

Version 1.0.0

  • Initial release
  • Dark mode design
  • Responsive layout
  • Mobile-friendly navigation
  • Professional styling
  • Search compatibility

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_gitlab_theme-0.0.3.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_gitlab_theme-0.0.3-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_gitlab_theme-0.0.3.tar.gz.

File metadata

  • Download URL: mkdocs_gitlab_theme-0.0.3.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for mkdocs_gitlab_theme-0.0.3.tar.gz
Algorithm Hash digest
SHA256 759fc90fa4307e22de4f3218cb80916dfc82c4cbe1279f1d20edf2e678def2ea
MD5 52664051edf5fe71ffd90f8464011682
BLAKE2b-256 5e183551d290a61efdc2c70edb7f5f50334c4190b4984a0cdec0930e43df5814

See more details on using hashes here.

File details

Details for the file mkdocs_gitlab_theme-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_gitlab_theme-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2cdc7493942dd9aabf2be24c2b77cd7d2f66dc46d0a5b077eb569c943a2eab29
MD5 5ac4044320489943e5a95387707a23ee
BLAKE2b-256 0d4a4edceee039074aae8fcf7e8fdc919910777e92cd5261069f8d07d660c3ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page