
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
docusaurus-numbered-headings
Advanced tools
A Docusaurus plugin that automatically adds numbered headings with support for ISO 2145 and USA Classic numbering conventions
A simple Docusaurus plugin that automatically adds numbered headings (1., 1.1., 1.1.1., etc.) to h2, h3, and h4 elements in your documentation.
| Convention | Code | Structure Example | Common In | Region | Key Characteristics |
|---|---|---|---|---|---|
| Decimal (ISO 2145) | iso-2145 | 1, 1.1, 1.1.1 | Technical, Scientific, Academic | Europe, Global | Clean hierarchy; easy to reference; used in Docusaurus, LaTeX, academic papers, theses; ISO standard |
| Classical Outline | usa-classic | I, A, 1, a | Academic essays, legal outlines | USA | Multilevel styles for papers; common in school instruction; Roman numerals + letters + numbers + lowercase letters |
iso-2145This style implements the international standard ISO 2145 for numbering sections in technical and scientific documents.
1, 1.1, 1.1.1, etc.Example:
## 2 Methods
### 2.1 Data Collection
#### 2.1.1 Survey Design
usa-classicThis style mimics the classical outline format commonly taught and used in the United States, especially in educational and legal contexts.
Reflects traditional outline structures seen in essays, legal briefs, and academic writing in the US
Example:
## I. Introduction
### A. Background
#### 1. Early Work
npm install docusaurus-numbered-headings
or
yarn add docusaurus-numbered-headings
Add the plugin to your docusaurus.config.js:
module.exports = {
// ... other config
plugins: ["docusaurus-numbered-headings"],
// ... rest of config
};
That's it! Your headings will now be automatically numbered.
You can also pass options to the plugin:
module.exports = {
// ... other config
plugins: [
[
"docusaurus-numbered-headings",
{
enabled: true, // Set to false to disable the plugin
convention: "iso-2145", // Choose numbering convention
},
],
],
// ... rest of config
};
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Whether to enable numbered headings |
convention | "iso-2145" | "usa-classic" | "iso-2145" | Numbering convention to use for the headings |
You can disable numbered headings on specific pages using the class disable_numbered_headings.
<div class="disable_numbered_headings">
<h2>Heading without numbering</h2>
<p>This section will not have numbered headings.</p>
</div>
This implementation works because typically the reason for disabling numbered headings is to have a React component or a specific section that does not require automatic numbering. By wrapping the content in a div with the class disable_numbered_headings, the plugin will skip applying the numbering styles to that section.
This plugin injects CSS that uses CSS counters to automatically number your headings based on the selected convention:
1., 2., 3.1.1., 1.2., 2.1.1.1.1., 1.1.2., 1.2.1.1.1.1.1., 1.1.1.2., 1.1.2.1.I., II., III.A., B., C.1., 2., 3.a., b., c.The numbering resets appropriately when moving between different heading levels.
If you want to customize the appearance, you can override the CSS in your custom stylesheet:
h2::before,
h3::before,
h4::before {
color: #your-color;
font-weight: bold;
/* your custom styles */
}
MIT
Issues and pull requests are welcome! Please check the GitHub repository for more information.
.npmignore for optimized package sizeSECURITY.md)iso-2145 convention (decimal numbering: 1, 1.1, 1.1.1)usa-classic convention (Roman numerals, letters, numbers: I, A, 1, a)FAQs
A Docusaurus plugin that automatically adds numbered headings with support for ISO 2145 and USA Classic numbering conventions
We found that docusaurus-numbered-headings demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.