title: How to make pages in MkDocs's side menu expandable?
body: <p>I tried searching for this, but was unable to get any sort of answer that would be pointing to a solution. Let me start with some background first i suppose.</p>
  <p><strong>My Goal</strong>:</p>
  <p>I'm currently figuring out how to get a decent automated documentation created for a certain python script repository. Its a library, so not a 'project' per se. It also lives in it's own place, as it's not maintained by a standalone python installation, but a Python 2.7 implementation that comes with Autodesk Maya.
  As such, there's a bunch of modules in the library, organized the way it makes sense for us, and all functions have a docstring that is written according to the reStructuredText (:param parameterName: Description, etc..).
  I was looking for something that would scrub through the whole repository, and create a nice html documentation that would look neat and make it easy to search for existing functions, thinking it must exist, but alas, i was unable to find anything that would be that user friendly.</p>
  <p><strong>What i tried</strong>:</p>
  <p>Sphinx, pdoc3 - both proven various levels of not-idealness.</p>
  <p><strong>What i decide to do</strong>:</p>
  <p>The last i tried is mkdocs. It seems fairly simplistic, not only because it doesnt actually do anything but create a stub of a page that gets filled based on one .yaml config file and per-page .md files that the user has to supply.
  <em>Now FYI, im new to both yaml and md, as i never had to use either</em>.
  I have decided to create myself a wrapper (for one-button-to-make-docs function) that would basically run through my python library, creating a .md page per module, and filling it with the functions/classes and their docstrings. I would have to parse the docstrings myself, but that's not that big a deal.
  This would basically turn mkdocs into a pretty decent automated documentation with no needed manual input.
  Now... I do like the theme readthedocs that you can set for your documentation in the yaml config file, but this is where i get stuck.</p>
  <p><strong>My Issue</strong></p>
  <p>When i 'mkdocs serve' my site, i'd like anything that has a hierarchy in the side menu, to be collapsible, like in this example (note the collapse/expand icons on the left sidebar):</p>
  <p><a href="https://i.stack.imgur.com/pu7uL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pu7uL.png" alt="This is the ideal" /></a></p>
  <p>But what I'm getting is no collapsability:</p>
  <p><a href="https://i.stack.imgur.com/iSCyz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iSCyz.png" alt="My attempt" /></a></p>
  <p>It should be noted, i suppose, that in my case, the 'attr' section is one .md site, that has just a simple structure of a h3 header per function name, and some description under, before having a horizontal rule to divide from the next function.</p>
  <p>Also, in the yaml config file for the mydocs structure, the structure is kept very simple:</p>
  <pre><code>site_name: My Repo
  nav:
      - Home: 'index.md'
      - 'Modules':
          - attr: 'pageA.md'
          - pageB: 'pageB.md'
          - pageC: 'pageC.md'
      - About: 'about.md'
  theme:
      name: readthedocs
      include_homepage_in_sidebar: false
      highlightjs: true
      hijs_languages:
          - python
  markdown_extensions:
      - toc:
          permalink: True
          separator: &quot;_&quot;
  </code></pre>
  <p>So the question is - how would i go about making my sidebar have little expand/collapse icons? (namely the attr site at this point)
  Is it doable? Is it doable through the yaml config file, or the .md files of each page?</p>
  <p>And potentially, is there a better alternative to what im doing, that wouldn't require me to write my own docs-making one-button solution?</p>
  <p>Thank you!</p>