feat(techdocs): add techdocs-cli option to disable external font download

Signed-off-by: Karthik <karthik.jk11@gmail.com>
This commit is contained in:
Karthik
2025-11-25 14:16:44 +05:30
parent 5ef8d166cb
commit 329f5920b6
11 changed files with 44 additions and 6 deletions
+2
View File
@@ -149,6 +149,8 @@ Options:
Defaults to false, which means that the techdocs-core plugin is always added to the mkdocs file.
--legacyCopyReadmeMdToIndexMd Attempt to ensure an index.md exists falling back to using <docs-dir>/README.md or README.md
in case a default <docs-dir>/index.md is not provided. (default: false)
--disableExternalFonts Disable external font downloads for all TechDocs sites. Useful for air-gapped environments
where Google fonts cannot be accessed. (default: false)
--runAsDefaultUser Bypass setting the container user as the same user and group id as host for Linux and MacOS (default: false)
-v, --verbose Enable verbose output. (default: false)
-h, --help display help for command
+13 -1
View File
@@ -574,7 +574,7 @@ your file-level configuration and not override it.
#### Manual configuration in mkdocs.yml
Alternatively, you can manually add the following configuration to your `mkdocs.yaml`
Alternatively, you can manually add the following configuration to your `mkdocs.yml`
file:
```yaml
@@ -593,6 +593,18 @@ only adds `font: false` when the `font` property is not already configured.
:::
#### Using techdocs-cli in CI/CD
When generating TechDocs sites in CI/CD workflows using `techdocs-cli`, you can
use the `--disableExternalFonts` flag:
```bash
techdocs-cli generate --disableExternalFonts
```
This will automatically patch the `mkdocs.yml` file during the generation
process, just like the `app-config.yaml` option does for local generation.
## How to enable iframes in TechDocs
TechDocs uses the [DOMPurify](https://github.com/cure53/DOMPurify) library to