diff --git a/docs/assets/creating-your-site.png b/docs/assets/creating-your-site.png deleted file mode 100644 index 0243b6192..000000000 Binary files a/docs/assets/creating-your-site.png and /dev/null differ diff --git a/docs/assets/search-highlighting.png b/docs/assets/screenshots/search-highlighting.png similarity index 100% rename from docs/assets/search-highlighting.png rename to docs/assets/screenshots/search-highlighting.png diff --git a/docs/creating-your-site.md b/docs/creating-your-site.md index 50fbbdb88..6170813be 100644 --- a/docs/creating-your-site.md +++ b/docs/creating-your-site.md @@ -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 diff --git a/docs/insiders.md b/docs/insiders.md index 4b58bb8dc..2bd92c54f 100644 --- a/docs/insiders.md +++ b/docs/insiders.md @@ -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 diff --git a/docs/setup/setting-up-navigation.md b/docs/setup/setting-up-navigation.md index ad46afccd..d65089d1e 100644 --- a/docs/setup/setting-up-navigation.md +++ b/docs/setup/setting-up-navigation.md @@ -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 diff --git a/docs/setup/setting-up-site-search.md b/docs/setup/setting-up-site-search.md index 24d7fbae6..9f10c6525 100644 --- a/docs/setup/setting-up-site-search.md +++ b/docs/setup/setting-up-site-search.md @@ -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 diff --git a/docs/setup/setting-up-the-header.md b/docs/setup/setting-up-the-header.md index bd13315b4..9084b5a4c 100644 --- a/docs/setup/setting-up-the-header.md +++ b/docs/setup/setting-up-the-header.md @@ -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: