Skip to content

Themes

By default, plugin assumes material theme usage, but you can use any other theme if you want.

Changing theme

To apply a new theme you'll need:

  • Add theme package
  • Apply new theme in mkdocs.yml
  • (optional) Remove material-related configurations in mkdocs.yml

For example, lets configure ivory theme.

First, we need to declare it's package in build.gradle:

python.pip 'mkdocs-ivory:0.4.6'

Note

Additional optional packages may be required for theme (e.g. like for material theme). Just add all required packages:

python.pip 'mkdocs-ivory:0.4.6', 
           'some-additional-package:1.0'

Then changing theme in mkdocs.yml:

theme:
  name: 'ivory'

Default mkdocs.yml (generated by plugin) contains special configurations related to material theme, which may be removed (in case of other theme used):

theme:
  name: 'material'
  # Material theme configuration flag
  feature:
    tabs: false


#extra:
#  Material theme palette configurations
#  palette:
#    primary: 'indigo'
#    accent: 'indigo'

#  Material theme social links configuration
#  social:
#    - icon: fontawesome/brands/github
#      link: https://github.com/you
#    - icon: fontawesome/brands/twitter
#      link: https://twitter.com/you


# Extensions used by material
markdown_extensions:
  - admonition
  - codehilite:
      guess_lang: false
  - footnotes
  - meta
  - def_list
  - toc:
      permalink: true
  - pymdownx.betterem:
      smart_enable: all
  - pymdownx.caret
  - pymdownx.inlinehilite
  - pymdownx.magiclink
  - pymdownx.smartsymbols
  - pymdownx.superfences

Note

I don't know if markdown_extensions would work with your theme. You can experiment if you need these extra features (see material theme guide for extensions usage examples).