-
Notifications
You must be signed in to change notification settings - Fork 44.6k
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
Use modern material theme for docs #5035
Use modern material theme for docs #5035
Conversation
❌ Deploy Preview for auto-gpt-docs failed.
|
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #5035 +/- ##
=======================================
Coverage 51.95% 51.95%
=======================================
Files 116 116
Lines 4987 4987
Branches 671 671
=======================================
Hits 2591 2591
Misses 2198 2198
Partials 198 198 ☔ View full report in Codecov by Sentry. |
I think this is a great idea. I love material. Some things from my own technical documentation projects. In the theme you can add: theme:
name: material
features:
- content.code.copy and that will enable the little click to copy box in code snippets for people looking at our docs. I also just blanket put in markdown_extensions:
- abbr
- admonition
- attr_list
- def_list
- footnotes
- md_in_html
- pymdownx.arithmatex:
generic: true
- pymdownx.critic
- pymdownx.caret
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.mark
- pymdownx.snippets:
auto_append:
- includes/abbreviations.md
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- tables
plugins:
- table-reader
- search
extra_javascript:
- https://unpkg.com/[email protected]/dist/tablesort.min.js
- _javascript/tablesort.js
- _javascript/mathjax.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js and add window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};
document$.subscribe(() => {
MathJax.typesetPromise()
}) to docs/_javascript/mathjax.js and document$.subscribe(function() {
var tables = document.querySelectorAll("article table:not([class])")
tables.forEach(function(table) {
new Tablesort(table)
})
}) to docs/_javascript/tablesort.js. This set of stuff enables all the features in material (which are turned off by default). |
Happy to let you decide what you want to include here, but would like to hear your thoughts. |
Added search plugin Co-authored-by: James Collins <[email protected]>
These are great! Testing them now... |
and codeblocks throughout the docs to align with mkdocs-material recommendations. codehilite is deprecated in favor of the highlight extension: https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#highlight
Background
We're using a ReadTheDocs theme that hasn't changed in years, and isn't the default, more modern MkDocs theme.
@RaghavKumar suggested the Material UI theme, and after using it, the docs feel way more accessible.
It's also the most popular MkDocs theme, by far, according to https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes.
Changes
Documentation
N/A - these are the docs
Test Plan
Played around with it in-browser for the past 3h :-(
PR Quality Checklist
Preview: