Skip to content

Commit

Permalink
Merge a932450 into 8ae4475
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih authored Apr 10, 2023
2 parents 8ae4475 + a932450 commit 503cf40
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 49 deletions.
89 changes: 43 additions & 46 deletions docs/docs/toc.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,47 @@
- name: Getting Started
expanded: true
items:
- name: Quick Start
href: ../index.md
- name: Quick Start
href: ../index.md

- name: Essentials
expanded: true
items:
- name: Markdown
href: markdown.md
- name: Table of Contents
href: table-of-contents.md
- name: Config
href: config.md
- name: Template
href: template.md
- name: .NET API Docs
href: dotnet-api-docs.md
- name: REST API Docs
href: rest-api-docs.md
- name: PDF
href: pdf.md
- name: Markdown
href: markdown.md
- name: Table of Contents
href: table-of-contents.md
- name: Config
href: config.md
- name: Template
href: template.md
- name: .NET API Docs
href: dotnet-api-docs.md
- name: REST API Docs
href: rest-api-docs.md
- name: PDF
href: pdf.md

- name: Advanced
items:
- name: User Manual
href: ../tutorial/docfx.exe_user_manual.md
- name: Links and Cross References
href: ../tutorial/links_and_cross_references.md
- name: Overwrite Files
href: ../tutorial/intro_overwrite_files.md
- name: Introduction to the DocFX Template System
href: ../tutorial/intro_template.md
- name: "How-to: Create A Custom Template"
href: ../tutorial/howto_create_custom_template.md
- name: Metadata YAML Format
href: ../spec/metadata_format_spec.md
- name: .NET YAML Format
href: dotnet-yaml-format.md
- name: Document Schema
href: ../spec/docfx_document_schema.md
- name: Schema Document Processor
href: ../spec/sdp_design_spec.md
- name: User Manual
href: ../tutorial/docfx.exe_user_manual.md
- name: Links and Cross References
href: ../tutorial/links_and_cross_references.md
- name: Overwrite Files
href: ../tutorial/intro_overwrite_files.md
- name: Introduction to the DocFX Template System
href: ../tutorial/intro_template.md
- name: "How-to: Create A Custom Template"
href: ../tutorial/howto_create_custom_template.md
- name: Metadata YAML Format
href: ../spec/metadata_format_spec.md
- name: .NET YAML Format
href: dotnet-yaml-format.md
- name: Document Schema
href: ../spec/docfx_document_schema.md
- name: Schema Document Processor
href: ../spec/sdp_design_spec.md

- name: Extensibility
items:
- name: Create a Custom Plugin
href: ../tutorial/howto_build_your_own_type_of_documentation_with_custom_plug-in.md
- name: Add a Custom Post Processor
href: ../tutorial/howto_add_a_customized_post_processor.md
- name: "Advanced: Support Hyperlink"
href: ../tutorial/advanced_support_hyperlink.md
- name: Create a Custom Plugin
href: ../tutorial/howto_build_your_own_type_of_documentation_with_custom_plug-in.md
- name: Add a Custom Post Processor
href: ../tutorial/howto_add_a_customized_post_processor.md
- name: "Advanced: Support Hyperlink"
href: ../tutorial/advanced_support_hyperlink.md
1 change: 1 addition & 0 deletions samples/seed/articles/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- name: Engineering Docs
expanded: true
items:
- name: Section 1
- name: Engineering Guidelines
href: engineering_guidelines.md
- name: CSharp Coding Standards
Expand Down
6 changes: 6 additions & 0 deletions templates/modern/src/toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,10 @@ $expand-stub-width: .85rem;
li.expanded > .expand-stub::before {
transform: rotate(90deg);
}

span.name-only {
font-weight: 600;
display: inline-block;
margin: .4rem 0;
}
}
10 changes: 7 additions & 3 deletions templates/modern/src/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ export async function renderToc(): Promise<TocNode[]> {
const { href, name, items, expanded } = node
const isLeaf = !items || items.length <= 0
const dom = href
? html`<a class='${classMap({ 'nav-link': !activeNodes.includes(node) })}' href=${href}>${breakWordLit(name)}</a>`
: (isLeaf
? html`<span class='text-body-tertiary name-only'>${breakWordLit(name)}</a>`
: html`<a class='${classMap({ 'nav-link': !activeNodes.includes(node) })}' href='#' @click=${toggleExpand}>${breakWordLit(name)}</a>`)
return html`
<li class=${classMap({ expanded })}>
${isLeaf ? null : html`<span class='expand-stub' @click=${toggleExpand}></span>`}
${href
? html`<a class='${classMap({ 'nav-link': !activeNodes.includes(node) })}' href=${href}>${breakWordLit(name)}</a>`
: html`<a class='${classMap({ 'nav-link': !activeNodes.includes(node) })}' href='#' @click=${toggleExpand}>${breakWordLit(name)}</a>`}
${dom}
${isLeaf ? null : html`<ul>${renderTocNodes(items)}</ul>`}
</li>`
Expand Down

0 comments on commit 503cf40

Please sign in to comment.