Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ There are two different ways to pay for licenses.
* Purchase a specific number of {% data variables.product.prodname_GHAS_cs_or_sp %} licenses that last for a defined period, typically at least a year, see {% ifversion fpt or ghec %}[AUTOTITLE](/billing/how-tos/products/add-advanced-security){% elsif ghes %}[AUTOTITLE](/enterprise-cloud@latest/billing/how-tos/products/add-advanced-security) in the {% data variables.product.prodname_ghe_cloud %} documentation{% endif %}.
* If the usage of {% data variables.product.prodname_AS %} by active committers exceeds the number of licenses purchased, you need to purchase additional licenses to cover this overage usage.

<!-- expires 2025-08-31 -->
<!--This versioning is not needed once the related EDI PR for this article is merged (#57129).-->
{% ifversion fpt or ghec %}To view your current license usage, see [AUTOTITLE](/billing/managing-billing-for-your-products/viewing-your-product-usage).{% endif %}
<!-- end expires 2025-08-31 -->
To view your current license usage, see [AUTOTITLE](/billing/managing-billing-for-your-products/viewing-your-product-usage).

### Understanding usage

Expand Down
12 changes: 10 additions & 2 deletions content/contributing/style-guide-and-content-model/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ For presenting keyboard shortcuts, follow the [Microsoft Style Guide](https://do

### Usage highlights

Below are some usage highlights for how we present keyboard shortcuts in our documentation:
Here are some usage highlights for how we present keyboard shortcuts in our documentation:

* The basic syntax is to show keys with `+` between key combinations, without any spaces.

Expand Down Expand Up @@ -592,7 +592,7 @@ Below are some usage highlights for how we present keyboard shortcuts in our doc

Do not create reusables for license attributions. We must use the exact license a project is licensed under, so any attributions must be accurately written for the articles that they appear in.

If you are unsure of the legality of reusing any content, contact legal. If you are adding content with a license that is not listed below, you must receive a legal review before you can publish the content.
If you are unsure of the legality of reusing any content, contact legal. If you are adding content with a license that is not listed here, you must receive a legal review before you can publish the content.

### Attributing MIT-licensed content

Expand Down Expand Up @@ -1270,6 +1270,14 @@ To signal to readers that you've added or changed a note, or to indicate the pub

To signal that we have removed a release note, add an "Errata" section detailing which note you removed and (if relevant) which version the removed note actually pertains to. See [Writing errata](#writing-errata).

## Release references

When referring to a range of releases starting from a particular release, use "or later."

* **Use:** "release 0.41.0 or later"
* **Avoid:** "release 0.41.0 or above"
* **Avoid:** "release 0.41.0 or greater"

## Reusables and variables

Use reusable strings for individual nouns (e.g. product names) or for complete sentences or paragraphs. Sentence fragments and phrases should not be contained in reusable strings as they can cause problems when content is localized. For more information, see the [data directory](https://github.com/github/docs/tree/main/data) in the [`github/docs`](https://github.com/github/docs) repository, [Creating reusable content](/contributing/writing-for-github-docs/creating-reusable-content), and the [Product names](#product-names) section of this document.
Expand Down
11 changes: 11 additions & 0 deletions src/dev-toc/generate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* Development tool that generates a local Table of Contents (TOC) for the GitHub Docs website.
*
* This script creates static HTML files for each documentation version, renders page titles
* using Liquid templating, and opens the generated TOC in your browser for easy navigation
* during development. Supports command-line options to specify which sections should be
* open by default.
*
* Usage: tsx src/dev-toc/generate.ts [-o product-ids...]
*/

import fs from 'fs'
import path from 'path'
import { execSync } from 'child_process'
Expand Down
91 changes: 60 additions & 31 deletions src/dev-toc/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,69 @@ <h2 class="mt-3 mb-3"><abbr>TOC</abbr> for {{ allVersions[currentVersion].versio
<button class="btn mb-3 js-expand" type="button">Expand All</button>
<div/>

{% assign maxTocDepth = 5 %}

{% for productPage in currentEnglishTree.childPages %}
{% assign productId = productPage.page.relativePath | replace: "/index.md", "" %}
{% if defaultOpenSections contains productId %}
<details open class="mb-1"><summary>{{productPage.renderedFullTitle}}</summary>
{% else %}
<details class="mb-1"><summary>{{productPage.renderedFullTitle}}</summary>
{% endif %}
<ul class="products-list">
<li title="{{productPage.renderedFullTitle}}" style="margin: 3px 0 0 30px;">
<a title="{{ productPage.page.documentType }}" href="{{ docsRoot }}{{productPage.href}}">{{ productPage.renderedFullTitle }}</a>
{% for categoryPage in productPage.childPages %}
<ul>
<li style="margin: 3px 0 0 30px;">
<a title="{{ categoryPage.page.documentType }}" href="{{ docsRoot }}{{ categoryPage.href }}">{{ categoryPage.renderedFullTitle }}</a>
<ul>
{% for subcategoryPage in categoryPage.childPages %}
{% assign productId = productPage.page.relativePath | replace: "/index.md", "" %}
{% if defaultOpenSections contains productId %}
<details open class="mb-1"><summary>{{productPage.renderedFullTitle}}</summary>
{% else %}
<details class="mb-1"><summary>{{productPage.renderedFullTitle}}</summary>
{% endif %}

<ul class="products-list">
<li title="{{productPage.renderedFullTitle}}" style="margin: 3px 0 0 30px;">
<a title="{{ productPage.page.documentType }}" href="{{ docsRoot }}{{productPage.href}}">{{ productPage.renderedFullTitle }}</a>

{% comment %} Unified nested rendering with depth control {% endcomment %}
{% if productPage.childPages and productPage.childPages.size > 0 %}
<ul>
{% for l1 in productPage.childPages %}
<li style="margin: 3px 0 0 30px;">
<a title="{{ subcategoryPage.page.documentType }}" href="{{ docsRoot }}{{ subcategoryPage.href }}">{{ subcategoryPage.renderedFullTitle }}</a>
<ul>
{% for articlePage in subcategoryPage.childPages %}
<li style="margin: 3px 0 0 30px;">
<a title="{{ articlePage.page.documentType }}" href="{{ docsRoot }}{{ articlePage.href }}">{{ articlePage.renderedFullTitle }}</a>
</li>
{% endfor %}
</ul>
<a title="{{ l1.page.documentType }}" href="{{ docsRoot }}{{ l1.href }}">{{ l1.renderedFullTitle }}</a>
{% if l1.childPages and l1.childPages.size > 0 and maxTocDepth >= 2 %}
<ul>
{% for l2 in l1.childPages %}
<li style="margin: 3px 0 0 30px;">
<a title="{{ l2.page.documentType }}" href="{{ docsRoot }}{{ l2.href }}">{{ l2.renderedFullTitle }}</a>
{% if l2.childPages and l2.childPages.size > 0 and maxTocDepth >= 3 %}
<ul>
{% for l3 in l2.childPages %}
<li style="margin: 3px 0 0 30px;">
<a title="{{ l3.page.documentType }}" href="{{ docsRoot }}{{ l3.href }}">{{ l3.renderedFullTitle }}</a>
{% if l3.childPages and l3.childPages.size > 0 and maxTocDepth >= 4 %}
<ul>
{% for l4 in l3.childPages %}
<li style="margin: 3px 0 0 30px;">
<a title="{{ l4.page.documentType }}" href="{{ docsRoot }}{{ l4.href }}">{{ l4.renderedFullTitle }}</a>
{% if l4.childPages and l4.childPages.size > 0 and maxTocDepth >= 5 %}
<ul>
{% for l5 in l4.childPages %}
<li style="margin: 3px 0 0 30px;">
<a title="{{ l5.page.documentType }}" href="{{ docsRoot }}{{ l5.href }}">{{ l5.renderedFullTitle }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</li>
</ul>
</details>
{% endfor %}
</ul>
{% endif %}
</li>
</ul>
</details>
{% endfor %}
{% endif %}

Expand Down
Loading