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 .github/workflows/generate_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
Expand Down
15 changes: 14 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
site_name: "BICAN Knowledge Graph Models Documentation"
site_url: https://brain-bican.github.io/models/
theme:
name: material
palette:
Expand All @@ -10,6 +11,11 @@ theme:
plugins:
- search
- mermaid2
- panzoom:
full_screen: true
always_show_hint: true
hint_location: "top"
Comment on lines +14 to +17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This plugin is a great addition for large diagrams. On a related note, as you correctly pointed out in the PR description, the mermaid2 plugin on line 13 is now redundant because you've enabled native Mermaid support via markdown_extensions. I recommend removing - mermaid2 from the plugins list to simplify the configuration.



nav:
- Overview: index.md
Expand All @@ -25,4 +31,11 @@ nav:
- Genome Annotation: genome_annotation.md
- Assertion Evidence: assertion_evidence.md
- BKE Taxonomy: bke_taxonomy.md
repo_url: https://github.com/brain-bican/models
repo_url: https://github.com/brain-bican/models

markdown_extensions:
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
Comment on lines +37 to +41

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

The use of !!python/name:pymdownx.superfences.fence_code_format introduces a critical security vulnerability. This YAML tag allows for arbitrary code execution when the mkdocs.yml file is parsed. An attacker with write permissions to this file could execute arbitrary commands on the documentation build server, potentially leading to a full compromise of the build environment. It is strongly recommended to remove this configuration and use a safer method for rendering Mermaid diagrams. MkDocs Material has native support for Mermaid, which should be preferred.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ test = [
]
docs = [
"mkdocs-material",
"mkdocs-mermaid2-plugin"
"mkdocs-mermaid2-plugin",
"mkdocs-panzoom-plugin"
Comment on lines +30 to +31

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Following up on the comment in mkdocs.yml, since mkdocs-mermaid2-plugin is no longer needed, its dependency on line 30 can be removed. Please also adjust the commas in the list accordingly after removing the line to maintain valid TOML syntax.

]

[project.urls]
Expand Down