Browse Source

SONAR-11956 Remove TOC related code in static doc

tags/7.8
Grégoire Aubert 5 years ago
parent
commit
de4e001284

+ 1
- 4
server/sonar-docs/README.md View File

@@ -167,12 +167,9 @@ this content is displayed on <!-- sonarcloud -->SonarCloud<!-- /sonarcloud --><!

### Page-level ToC

Basic syntax: `## Table of Contents`
Lists all h2 & h3
All h2 tags will automatically be part of the TOC both in the static and embed documentation.
The resulting table of contents will also list all h1 items, but h1 is used for the page title, and by convention should not also be used further down the page.

This conditional (i.e. only if you use the tag) ToC will _only_ appear in embedded docs. The static docs site will automatically list _all_ h2s in a page-level ToC added to the navigation rail (left-hand side of the page)

### Formatting

#### Links

+ 1
- 4
server/sonar-docs/plugins/sonarsource-source-filesystem/index.js View File

@@ -69,10 +69,7 @@ function handleIncludes(content, fileNode) {
);
} else {
const fileContent = loadNodeContentSync({ absolutePath, relativePath });
return fileContent
.replace(/^---[\w\W]+?---$/m, '')
.replace(/^#+ *(toc|table[ -]of[ -]contents?)$/gim, '')
.trim();
return fileContent.replace(/^---[\w\W]+?---$/m, '').trim();
}
});
}

Loading…
Cancel
Save