apache / incubator-hugegraph-doc

HugeGraph Website and Doc
https://hugegraph.apache.org/
Apache License 2.0
66 stars 91 forks source link

improve Traverser API doc #343

Open ZeeJJ123 opened 3 months ago

ZeeJJ123 commented 3 months ago

Problem Type (问题类型)

others (please edit later)

Your Question (问题描述)

The documentation has links for the 3.1 section but not for the sub-sections like 3.2.1 and 3.2.1.1. This makes it hard to find and navigate to specific API details.

dosubot[bot] commented 3 months ago

To address the issue with navigating to specific sub-sections in the Traverser API documentation, such as 3.2.1 and 3.2.1.1, it's recommended to adjust the depth of the table of contents (ToC) in the Hugo site configuration. This can be done by setting the endLevel parameter to include headings up to four levels deep, which corresponds to sections and sub-sections in your documentation. Here's how you can adjust it in different configuration files:

For config.toml:

[markup]
  [markup.tableOfContents]
    endLevel = 4
    ordered = true

For config.yaml:

markup:
  tableOfContents:
    endLevel: 4
    ordered: true

For config.json:

{
  "markup": {
    "tableOfContents": {
      "endLevel": 4,
      "ordered": true
    }
  }
}

Setting endLevel to 4 ensures that the ToC will include headings up to four levels deep, improving navigation by including direct links to specific sub-sections. The ordered parameter, when set to true, indicates that the ToC should use ordered lists, which might be more appropriate for numerical sectioning.

Ensure that your Markdown files use the appropriate heading levels to represent different sections and sub-sections of the API documentation. This change will automatically be reflected in the ToC generated by Hugo.

For more details, you can refer to the themes/docsy/layouts/partials/toc.html file in the repository.

This solution should help in improving the navigation of the Traverser API documentation by including direct links to specific sub-sections. If you have any further questions or need more clarification, feel free to ask.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
ZeeJJ123 commented 3 months ago

@dosubot Was the ToC depth adjustment for Hugo documentation previously implemented, or is it a new setup? Are there any considerations or known issues with setting endLevel to 4? Any best practices for structuring Markdown files to reflect this change?

dosubot[bot] commented 3 months ago

The adjustment of the endLevel parameter in the Hugo site configuration for the Traverser API documentation is not a previously implemented setup in the incubator-hugegraph-doc repository. By default, Hugo uses an endLevel value of 3, which includes headings up to three levels deep in the table of contents. Setting endLevel to 4 is a change that would include headings up to four levels deep, enhancing the documentation's navigability by providing direct links to more specific sub-sections.

When structuring Markdown files to reflect this change, it's crucial to use headings (#, ##, ###, ####) appropriately to denote different sections and sub-sections, aligning with the increased endLevel. This structured approach ensures that the table of contents generated by Hugo accurately represents the document's hierarchy, making it easier for users to navigate through the documentation.

However, there are considerations to keep in mind with setting the endLevel to 4. This adjustment can lead to a longer table of contents, which might become more challenging to navigate if the document has many sub-sections. Additionally, it could slightly increase the page's load time due to the browser needing to render more links. Despite these potential issues, they are generally minor and can be effectively managed with thoughtful content organization and design.

Regarding the ordered parameter, setting it to true organizes the table of contents as an ordered list. This can be beneficial for documentation where the sequence of sections matters, though it may introduce additional visual clutter for documents with extensive sections and sub-sections.

In summary, modifying the endLevel and ordered parameters can significantly improve navigation within the HugeGraph documentation. It's essential to balance the detailed navigation benefits against the potential for a more cluttered table of contents and to structure Markdown files to mirror the changes accurately. For further assistance or specific issues, providing more detailed information about your use case would be helpful. Dosu

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.