5

Is it possible to have drop down menu something like this in mkdocs-material theme:

enter image description here

By default, it seems material theme renders only top level menu below title with sub menus in left side bar. I am ok if left side bar is preserved. I just want to know if it is possible to have sub menus appear as drop down as shown in first image.

For more clarity:

enter image description here

Rnj
  • 1,067
  • 1
  • 8
  • 23

2 Answers2

4

Looks like currently, mkdocs-material does not support this feature.

See here for the GitHub discussion on this.

Zer0F8th
  • 65
  • 7
1

Well, I may be late to respond to your question, however, to make your sub menus to appear as drop down menus at top in mkdocs material theme, you do the following.

  1. In your mkdocs.yml, add the following code;
    enter image description here

With the above configuration we have three top level items: "Home", "User Guide" and "About." "Home" is a link to the homepage for the site. Under the "User Guide" section two pages are listed: "Writing your docs" and "Styling your docs." Under the "About" section two more pages are listed: "License" and "Release Notes."


Finally, don't forget to run so as to create your files;

curl 'https://jaspervdj.be/lorem-markdownum/markdown.txt' > docs/'Writing your docs'

curl 'https://jaspervdj.be/lorem-markdownum/markdown.txt' > docs/'Styling your docs'

etc

By so doing you will have what you want as below;

enter image description here

Namwanza Ronald
  • 150
  • 1
  • 1
  • 12