How to enable the View Source of the Page functionality / button #4055
-
Hello, For some time now, I have noticed the new functionality on Material for Mkdocs tutorial pages: the View Source of the Page button, which then displays markdown code. How can I enable it on my markdown pages in Material? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 11 replies
-
Update: this functionality is available as of 9.0. This is a custom override. I have no plans adding this functionality, because it is solely useful for projects that need you to inspect the Markdown of the page, and there are only a handful of them. Here's the override: mkdocs-material/src/overrides/partials/content.html Lines 23 to 41 in 2892706 You can follow the customization guide to apply it yourself. |
Beta Was this translation helpful? Give feedback.
-
this a good desgin for me. |
Beta Was this translation helpful? Give feedback.
-
Very useful feature, hopefully it will be mentioned directly in the https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/ page. |
Beta Was this translation helpful? Give feedback.
-
The view source functionality was added in theme:
features:
- content.action.edit
- content.action.view |
Beta Was this translation helpful? Give feedback.
-
I don't agree with that. One of the main reasons markdown is popular is because the source is human readable, and therefore it should be possible to read it (otherwise, why use Markdown?) Github isn't the only project management system with a web interface. Almost all of them have that feature.
It's mentioned there, but not properly documented. I haven't been able to get it to work yet (I'm sure I'm just missing something obvious, but I'll figure it out). |
Beta Was this translation helpful? Give feedback.
-
@abhibeckert theme:
features:
- content.action.edit
- content.action.view does nothing. » pip show mkdocs-material
Name: mkdocs-material
Version: 9.1.18 |
Beta Was this translation helpful? Give feedback.
Update: this functionality is available as of 9.0.
This is a custom override. I have no plans adding this functionality, because it is solely useful for projects that need you to inspect the Markdown of the page, and there are only a handful of them. Here's the override:
mkdocs-material/src/overrides/partials/content.html
Lines 23 to 41 in 2892706