Skip to content

Documentation for custom_template_path #89

@peterhyatt-conning

Description

@peterhyatt-conning

Thanks for the fantastic module. It made my day.

I wanted to change the red underlines for the material theme, and eventually found it. Here's the missing docs for customizing the scss.

custom_template_path

The scss styles are used for setting up the values used at render time.

To see the current scss in use, look under

venv/lib/python3.12/site-packages/mkdocs_to_pdf/styles/*.scss

To override them, create a file named styles.scss and then put it in your mkdocs project folder, such as docs/assets/stylesheets/styles.scss

Then reference this path in the custom_template_path option in mkdocs.yaml

plugins:
  - to-pdf:
      custom_template_path: ./docs/assets/stylesheets

NOTE: This is the path to styles.scss. Do not include the filename itself.

Consider using !important to force an override.

To change the red underlines here is a sample styles.scss

article {
  h1 {
    border-bottom: 2px solid #0000ff !important;
  }

  h2 {
    border-bottom: 1px solid #000099 !important;
  }

  h3 {
    border-bottom: 0.5px solid #eee;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions