diff --git a/_includes/vendor/anchor_headings.html b/_includes/vendor/anchor_headings.html index 25397df..985f448 100755 --- a/_includes/vendor/anchor_headings.html +++ b/_includes/vendor/anchor_headings.html @@ -64,7 +64,7 @@ {% capture anchor %}{% endcapture %} {% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %} - {% capture anchor %}href="#{{ html_id}}"{% endcapture %} + {% capture anchor %}href="#{{ html_id}}" aria-labelledby="{{ html_id}}"{% endcapture %} {% if include.anchorClass %} {% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %} @@ -97,4 +97,4 @@ {% endcapture %} {% capture edited_headings %}{{ edited_headings }}{{ new_heading }}{% endcapture %} {% endfor %} -{% endcapture %}{% assign headingsWorkspace = '' %}{{ edited_headings | strip }} \ No newline at end of file +{% endcapture %}{% assign headingsWorkspace = '' %}{{ edited_headings | strip }} diff --git a/_sass/content.scss b/_sass/content.scss index 5bf0ad5..113e733 100644 --- a/_sass/content.scss +++ b/_sass/content.scss @@ -165,6 +165,10 @@ } } + summary { + cursor: pointer; + } + h1, h2, h3, diff --git a/_sass/search.scss b/_sass/search.scss index 8a7f410..eb94cb7 100644 --- a/_sass/search.scss +++ b/_sass/search.scss @@ -308,6 +308,8 @@ @include mq(md) { .main { position: fixed; + right: 0; + left: 0; } } diff --git a/docs/navigation-structure.md b/docs/navigation-structure.md index e19112d..d5a7504 100644 --- a/docs/navigation-structure.md +++ b/docs/navigation-structure.md @@ -231,4 +231,21 @@ To generate a Table of Contents on your docs pages, you can use the `{:toc}` met {:toc} ``` -This example skips the page name heading (`#`) from the TOC, as well as the heading for the Table of Contents itself (`##`) because it is redundant, followed by the table of contents itself. +This example skips the page name heading (`#`) from the TOC, as well as the heading for the Table of Contents itself (`##`) because it is redundant, followed by the table of contents itself. To get an unordered list, replace `1. TOC` above by `- TOC`. + +### Collapsible Table of Contents + +The Table of Contents can be made collapsible using the `
` and `` elements , as in the following example. The attribute `open` (expands the Table of Contents by default) and the styling with `{: .text-delta }` are optional. + +```markdown +
+ + Table of contents + + {: .text-delta } +1. TOC +{:toc} +
+``` + +The result is shown at [the top of this page](#navigation-structure) (`{:toc}` can be used only once on each page). diff --git a/just-the-docs.gemspec b/just-the-docs.gemspec index 58fd834..c41ddaa 100644 --- a/just-the-docs.gemspec +++ b/just-the-docs.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "just-the-docs" - spec.version = "0.3.0" + spec.version = "0.3.1" spec.authors = ["Patrick Marsceill"] spec.email = ["patrick.marsceill@gmail.com"] diff --git a/package.json b/package.json index afcd98a..49fd3df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "just-the-docs", - "version": "0.3.0", + "version": "0.3.1", "description": "A modern Jekyll theme for documentation", "repository": "pmarsceill/just-the-docs", "license": "MIT",