Added documentation on table of contents autohiding

This commit is contained in:
squidfunk 2020-09-19 16:55:20 +02:00
parent a187cd85e2
commit 71f0d65284
7 changed files with 24 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 KiB

View File

Before

Width:  |  Height:  |  Size: 293 KiB

After

Width:  |  Height:  |  Size: 293 KiB

View File

@ -120,7 +120,7 @@ Point your browser to [localhost:8000][15] and you should see:
[![Creating your site][16]][15]
[15]: http://localhost:8000
[16]: assets/creating-your-site.png
[16]: assets/screenshots/creating-your-site.png
## Building your site

View File

@ -95,10 +95,11 @@ New features and improvements for _content and toc_, including:
- [x] Highlighting of matched search terms in content area
- [x] Navigation can always be expanded via configuration
- [x] Header can be automatically hidden on scrolling
- [ ] Better support for wide screens, i.e. more horizontal space
- [x] Table of contents can be automatically hidden when empty
- [ ] Table of contents can be moved into navigation for more space
- [ ] Table of contents shows which sections have search results
- [ ] Table of contents auto-collapses and expands only the active section
- [ ] Better support for wide screens, i.e. more horizontal space
- [ ] ... more to come
### Bhut Jolokia

View File

@ -200,6 +200,25 @@ them at your own risk._
[9]: https://python-markdown.github.io/extensions/toc/#usage
[10]: https://facelessuser.github.io/pymdown-extensions/extras/slugs/
#### Automatic hiding
[:octicons-file-code-24: Source][3] ·
:octicons-unlock-24: Feature flag ·
:octicons-beaker-24: Experimental ·
[:octicons-heart-fill-24:{: .tx-heart } Insiders only][3]{: .tx-insiders }
When _autohiding_ is activated, the table of contents is automatically hidden
when the current page defines no headings, or only a single `h1` heading to be
rendered, so content stretches.
It can be enabled via `mkdocs.yml` with:
``` yaml
theme:
features:
- toc.autohide
```
## Customization
### Keyboard shortcuts

View File

@ -156,7 +156,7 @@ Searching for `"code blocks"` yields:
_Give this feature a try on [the official documentation][10] built with Material
for MkDocs Insiders!_
[9]: ../assets/search-highlighting.png
[9]: ../assets/screenshots/search-highlighting.png
[10]: https://squidfunk.github.io/mkdocs-material-insiders/reference/code-blocks/?h=code+blocks
### Offline search

View File

@ -21,7 +21,7 @@ It also includes the [search bar][1] and a place to display your project's
:octicons-beaker-24: Experimental ·
[:octicons-heart-fill-24:{: .tx-heart } Insiders only][3]{: .tx-insiders }
When _auto-hiding_ is activated, the header is automatically hidden when the
When _autohiding_ is activated, the header is automatically hidden when the
user scrolls past a certain threshold, leaving more space for content. It can
be enabled via `mkdocs.yml` with: