Skip to content
Open
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
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export const SPHINX = "sphinx";
export const MKDOCS = "mkdocs";
export const MKDOCS_MATERIAL = "mkdocs-material";
export const ZENSICAL = "zensical";
export const DOCUSAURUS = "docusaurus";
export const PELICAN = "pelican";
export const ASCIIDOCTOR = "asciidoctor";
Expand Down
5 changes: 5 additions & 0 deletions src/defaults.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
--readthedocs-filetreediff-icon-width: 0.6rem;
}

:root[data-readthedocs-tool="zensical"] {
--readthedocs-font-size: 1.455em;
--readthedocs-filetreediff-icon-width: 0.6rem;
}

:root[data-readthedocs-tool="antora"] {
--readthedocs-flyout-font-size: 0.7em;
--readthedocs-notification-font-size: 0.75em;
Expand Down
20 changes: 20 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
MDBOOK,
MKDOCS,
MKDOCS_MATERIAL,
ZENSICAL,
DOCUSAURUS,
PELICAN,
ASCIIDOCTOR,
Expand Down Expand Up @@ -400,6 +401,7 @@ export class DocumentationTool {
[ASCIIDOCTOR]: "div#content",
[PELICAN]: "article",
[DOCUSAURUS]: "article div.markdown",
[ZENSICAL]: "article",
[ANTORA]: "article",
[JEKYLL]: "article",
[FALLBACK_DOCTOOL]: ["article", "main", "div.body", "div.document", "body"],
Expand Down Expand Up @@ -557,6 +559,10 @@ export class DocumentationTool {
return DOCUSAURUS;
}

if (this.isZensical()) {
return ZENSICAL;
}

if (this.isAsciiDoctor()) {
return ASCIIDOCTOR;
}
Expand Down Expand Up @@ -715,6 +721,10 @@ export class DocumentationTool {
return this.isDocusaurusTheme();
}

isZensical() {
return this.isZensicalTheme();
}

isPelican() {
if (
document.querySelectorAll('meta[name="generator"][content="Pelican"]')
Expand Down Expand Up @@ -839,6 +849,16 @@ export class DocumentationTool {
}
return false;
}

isZensicalTheme() {
if (
document.querySelectorAll('meta[name="generator"][content*="zensical"]')
.length === 1
) {
return true;
}
return false;
}
}

export const docTool = new DocumentationTool();