Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Lazy expandable feature for documentation #21095

Open
hikalkan opened this issue Oct 15, 2024 · 0 comments
Open

Lazy expandable feature for documentation #21095

hikalkan opened this issue Oct 15, 2024 · 0 comments

Comments

@hikalkan
Copy link
Member

hikalkan commented Oct 15, 2024

I didn't add sub-documents of the microservice startup template document to the navigation menu.

If you go to the microservice startup template document document, you can see it is highlighted, but there is no item under it on the menu:

image

However, if you open a sub-document (example: API Gateways), it is not found and highlighted on the menu as expected:

image

The problem is solved if I add all sub-documents to the menu. However, I don't want to it for three reasons;

  1. It will make filtering the items hard on the "Filter by title" area. Many unrelated items will be found.
  2. It will make the nav tree unnecessarily big, which may cause performance
  3. It has no meaning when I look at the menu manually, because for that kind of documents, details are only important after I open the main document, and it has sub-documents only because it is long.

So, I offer to introduce a new feature to the documentation system: Lazy expandable.

I will give the usage example with the book store tutorial since it has already sub-items on the menu.

I want to change the related part of docs-nav.json file as shown below:

{
  "text": "Web Application Development",
  "isLazyExpandable": true, // ADDED THIS
  "path": "tutorials/book-store",  // ADDED THIS
  "items": [
    {
      "text": "Overview",
      "path": "tutorials/book-store"
    },
    {
      "text": "1: Creating the Server Side",
      "path": "tutorials/book-store/part-01.md"
    },
    {
      "text": "2: The Book List Page",
      "path": "tutorials/book-store/part-02.md"
    },
    {
      "text": "3: Creating, Updating and Deleting Books",
      "path": "tutorials/book-store/part-03.md"
    },
    {
      "text": "4: Integration Tests",
      "path": "tutorials/book-store/part-04.md"
    },
    {
      "text": "5: Authorization",
      "path": "tutorials/book-store/part-05.md"
    },
    {
      "text": "6: Authors: Domain Layer",
      "path": "tutorials/book-store/part-06.md"
    },
    {
      "text": "7: Authors: Database Integration",
      "path": "tutorials/book-store/part-07.md"
    },
    {
      "text": "8: Authors: Application Layer",
      "path": "tutorials/book-store/part-08.md"
    },
    {
      "text": "9: Authors: User Interface",
      "path": "tutorials/book-store/part-09.md"
    },
    {
      "text": "10: Book to Author Relation",
      "path": "tutorials/book-store/part-10.md"
    }
  ]
},

I just added isLazyExpandable to the root document of the tutorial. As a result on the UI, I am expecting the followings:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants