Skip to content

Conversation

@pzuraq
Copy link
Contributor

@pzuraq pzuraq commented May 5, 2018

Adds a general On This Page index which looks at the main section on
the page to find any h2/h3 elements and create a table of contents
out of them. Notes:

  • H1 was omitted because it would be redundant, H1 is semantically meant
    to be the title of the page
  • Uses a MutationObserver to update the index when changes occur that
    weren't caused by routing. This happens in API docs with the toggles.

May need some light touch up, I'm in a rush today 😄

pzuraq and others added 2 commits May 5, 2018 14:55
Adds a general On This Page index which looks at the `main` section on
the page to find any `h2`/`h3` elements and create a table of contents
out of them. Notes:

* H1 was omitted because it would be redundant, H1 is semantically meant
to be the title of the page
* Uses a MutationObserver to update the index when changes occur that
weren't caused by routing. This happens in API docs with the toggles.
@samselikoff
Copy link
Contributor

Took a page from Read the docs styling and went with

  • a light border
  • one text size
  • one margin for all items
  • a deeper indent for sub items

image

@pzuraq
Copy link
Contributor Author

pzuraq commented May 5, 2018

Looks good! Like the changes 😄

@samselikoff samselikoff merged commit b8579bb into master May 6, 2018
@samselikoff samselikoff deleted the general-current-page-index branch May 6, 2018 00:14
pzuraq added a commit that referenced this pull request May 6, 2018
 ◇
 ◇ This feature snuck in in #173 but we'd talked about it before.
 ◇ Providing our own router class means we can control it and
 ◇ add things, like the RouterScroll mixin or didTransition hooks
 ◇ (which is why I added it in an experiment in #173). The
 ◇ docsRoute function sets up all the docs routes correctly,
 ◇ and allows us to maintain control over them in case we want to
 ◇ make more changes in the future.
 ◇
 ◇ I think ideally we would copy the new router file directly,
possibly by the blueprint, but I'm not sure that step can be
fully automated (existing routes and such) so I updated the guides
and docs here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants