Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Custom Themes in mkdocs-exporter #68

Open
nihalshah-dev opened this issue Jan 31, 2025 · 1 comment
Open

Add Support for Custom Themes in mkdocs-exporter #68

nihalshah-dev opened this issue Jan 31, 2025 · 1 comment

Comments

@nihalshah-dev
Copy link

nihalshah-dev commented Jan 31, 2025

Hi folks,

Many thanks for this wonderful plugin. I have some quick suggestion for improvements -

Description
Currently, mkdocs-exporter has hardcoded support for only the material and readthedocs themes. This limitation prevents users from using forked or custom themes without modifying the plugin source code manually.

Use Case
Many users customize the Material for MkDocs theme or create entirely new themes to better fit their documentation needs. However, since mkdocs-exporter directly imports only predefined themes, any custom theme results in errors or unexpected behavior like below -
RuntimeError: The theme you are using (my-docs-theme) is currently not supported by MkDocs Exporter, sorry.

Proposed Solution
Introduce custom theme support by allowing users to specify their theme in mkdocs.yml, similar to how MkDocs itself allows custom themes.

Example Proposal in mkdocs.yml

plugins:
  - exporter:
      theme: my_custom_theme

Instead of hardcoding the theme imports, modify the exporter to dynamically detect and load themes. This would allow any custom theme to be used without modifying the plugin itself.

Let me know if it makes any sense!! Thanks✌

@nbanyan
Copy link

nbanyan commented Feb 3, 2025

From what I can tell, that error refers to whether there are scripts for making adjustments to a page based on chosen MkDocs theme. It probably wouldn't be hard to have it use an empty 'theme' if something other than Material or RTD is used.

Does setting the exporter theme to material or readthedocs cause any errors or rendering issues with your theme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants