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.1.tar.gz (12.9 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.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkdocs_gitlab_theme-0.0.1.tar.gz
  • Upload date:
  • Size: 12.9 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.1.tar.gz
Algorithm Hash digest
SHA256 31afcf0b5ae4d869e3faf44c361654d40f87deef2fc399340fa8489c68acd25c
MD5 a94dc586fc3e42d14c57ccb30b0f2960
BLAKE2b-256 6c2769aac729198ac673e9f17ee96cc7439ebe2bb7c9bd157f1a78ae79c13f31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mkdocs_gitlab_theme-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc42a1a3f564010b78b1f86a1e2e5161899143a7f016e13eb00569d68e92574
MD5 983171e0591cdd2a8291840746f76ffc
BLAKE2b-256 b0562fd416fdc2cb9e4a65f4722423482cc76201a0aebc72bddfa77454abac2e

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