Giter Site home page Giter Site logo

tim-nordell-nimbelink / sphinx-immaterial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jbms/sphinx-immaterial

0.0 0.0 0.0 3.11 MB

Adaptation of the popular mkdocs-material material design theme to the sphinx documentation system

Home Page: https://jbms.github.io/sphinx-immaterial/

License: Other

Shell 0.02% C++ 0.07% Python 42.82% TypeScript 24.84% CSS 0.72% HTML 15.67% SCSS 15.86%

sphinx-immaterial's Introduction

Sphinx-Immaterial Theme

MIT License PyPI Package CI status

This theme is an adaptation of the popular mkdocs-material theme for the Sphinx documentation tool.

This theme is regularly maintained to stay up to date with the upstream mkdocs-material repository. The HTML templates, JavaScript, and styles from the mkdocs-material theme are incoroprated directly with mostly minor modifications.

This theme is a fork of the sphinx-material theme, which proved the concept of a Sphinx theme based on an earlier version of the mkdocs-material theme, but has now significantly diverged from the upstream mkdocs-material repository.

See this theme's own documentation for a demonstration.

WARNING: This theme is still in beta. While it is already very usable, breaking changes will still be made prior to the 1.0 release.

Installation

Install via pip:

$ pip install sphinx-immaterial

or if you have the code checked out locally:

$ pip -install -e .

Configuration

In your conf.py add sphinx_immaterial as an extension:

extensions = [
    ...,
    "sphinx_immaterial"
]

and add the following:

html_theme = 'sphinx_immaterial'

to set the theme.

Customizing the layout

You can customize the theme by overriding Jinja template blocks. For example, 'layout.html' contains several blocks that can be overridden or extended.

Place a 'layout.html' file in your project's '/_templates' directory.

mkdir source/_templates
touch source/_templates/layout.html

Then, configure your 'conf.py':

templates_path = ['_templates']

Finally, edit your override file 'source/_templates/layout.html':

{# Import the theme's layout. #}
{% extends '!layout.html' %}

{%- block extrahead %}
{# Add custom things to the head HTML tag #}
{# Call the parent block #}
{{ super() }}
{%- endblock %}

Differences from mkdocs-material

This theme closely follows the upstream mkdocs-material repository, but there are a few differences, primarily due to differences between Sphinx and MkDocs:

  • This theme adds styles for Sphinx object descriptions, commonly used for API documentation (e.g. class and function documentation). This is a core element of Sphinx for which there is no corresponding feature in MkDocs.
  • mkdocs-material uses lunr.js for searching, and has custom UI components for displaying search results in a drop-down menu as you type the search query. This theme uses a separate search implementation based on the custom index format used by Sphinx, which fully integrates with the search UI provided by mkdocs-material.

sphinx-immaterial's People

Contributors

jbms avatar 2bndy5 avatar mhostetter avatar simonboothroyd avatar kartben avatar umarcor avatar danwos avatar funkyfuture avatar glatosinski avatar hugoshaka avatar jan-matejka avatar tim-nordell-nimbelink avatar kamiazya avatar antonymayi avatar duncanmmacleod avatar matthias-colt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.