Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Highlight current page or section in table of contents #60

Open
NateWr opened this issue Oct 2, 2018 · 4 comments
Open

Highlight current page or section in table of contents #60

NateWr opened this issue Oct 2, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@NateWr
Copy link
Contributor

NateWr commented Oct 2, 2018

No description provided.

@kaitlinnewson kaitlinnewson added the enhancement New feature or request label Jan 29, 2019
@amandastevens
Copy link
Contributor

@NateWr, I love the new split navigation menu for the table of contents in the Docs Hub, but it would be even better if the current chapter or section that the user is in could be highlighted. This would make it a lot easier for the user to remember which chapter or section they're in and to navigate to another chapter or section. Would it be hard to implement this?

@NateWr
Copy link
Contributor Author

NateWr commented Sep 7, 2020

Mmm, yes a bit more tricky because we are storing the table of contents as markdown instead of structured data (like the yaml files where cards are defined).

This has been the source of some of the other challenges we have (ie - next/previous pages or links to this page in another language). We inherited this structure from the original conversion over from gitbooks. To resolve this and related issues, we'd need to convert every SUMMARY.md file:

* [Preface](.)
* [Introduction](./introduction.md)
  * [Background](./introduction.md#background)
  * [OJS Features](./introduction.md#ojs-features)
...

To something like:

toc:
  - name: "Preface"
    path: "."
  - name: Introduction
    path: "./introduction.md"
    sections:
    - name: "Background"
      path: "./introduction.md#background"
    - name: "OJS Features"
      path: "./introduction.md#ojs-features"

I might be able to write an automated conversion tool, but we may need the docs team to do the conversion manually. We may also need to move these files out of their respective categories and into the _data directory, which might be a little more complicated for the docs team to manage.

If it sounds like grunt work the docs team would be willing to do, I can try to set aside a little bit of time in the next few weeks for a quick experiment to see if we can implement some of these features fairly easily...

@kaitlinnewson
Copy link
Member

One concern I have with moving things into the _data directory is how it would impact translations. Currently the translators are translating the contents of the guide directory in GitLocalize, but moving it out of that directory and into _data would add some complexity to this since the file would no longer appear in GitLocalize. We would then have to do a more manual request to get the translation of the TOC, or create it ourselves based on their translation work.

@NateWr
Copy link
Contributor Author

NateWr commented Sep 17, 2020

Yeah that would be a significant downside. I did a quick search but didn't find anything suggesting we could access data files outside of the _data directory.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants