diff --git a/packages/techdocs-container/Dockerfile b/packages/techdocs-container/Dockerfile index d5eec712a5..23674f982e 100644 --- a/packages/techdocs-container/Dockerfile +++ b/packages/techdocs-container/Dockerfile @@ -12,9 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3.7.7-alpine3.12 +FROM python:3.8-alpine + + +RUN apk update && apk --no-cache add gcc musl-dev openjdk11-jdk curl graphviz ttf-dejavu fontconfig + +RUN curl -L http://sourceforge.net/projects/plantuml/files/plantuml.1.2020.16.jar/download > /opt/plantuml.jar +RUN pip install --upgrade pip && pip install mkdocs-techdocs-core==0.0.3 + +# Create script to call plantuml.jar from a location in path + +RUN echo "java -jar '/opt/plantuml.jar' ${@}" >> /usr/local/bin/plantuml +RUN chmod 755 /usr/local/bin/plantuml -RUN apk update && apk --no-cache add gcc musl-dev -RUN pip install --upgrade pip && pip install mkdocs-techdocs-core==0.0.3 mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5 pymdown-extensions==7.1 ENTRYPOINT [ "mkdocs" ] diff --git a/packages/techdocs-container/bin/scripts/plantuml b/packages/techdocs-container/bin/scripts/plantuml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/techdocs-container/mock-docs/docs/index.md b/packages/techdocs-container/mock-docs/docs/index.md index e8ba4e2d6d..77c64582de 100644 --- a/packages/techdocs-container/mock-docs/docs/index.md +++ b/packages/techdocs-container/mock-docs/docs/index.md @@ -30,3 +30,32 @@ This is a b c. ## xyz This is x y z. + +# The attack plan + +{% dot attack_plan.svg + digraph G { + rankdir=LR + Earth [peripheries=2] + Mars + Earth -> Mars + } +%} + +```graphviz dot attack_plan.svg +digraph G { + rankdir=LR + Earth [peripheries=2] + Mars + Earth -> Mars +} +``` + +# PlantUML Samples + +```plantuml classes="uml myDiagram" alt="Diagram placeholder" title="My diagram" +@startuml + Goofy -> MickeyMouse: calls + Goofy <-- MickeyMouse: responds +@enduml +``` diff --git a/packages/techdocs-container/techdocs-core/README.md b/packages/techdocs-container/techdocs-core/README.md index 9608780bd2..a4afed0158 100644 --- a/packages/techdocs-container/techdocs-core/README.md +++ b/packages/techdocs-container/techdocs-core/README.md @@ -47,3 +47,15 @@ python -m black src/ ``` **Note:** This will write to all Python files in `src/` with the formatted code. If you would like to only check to see if it passes, simply append the `--check` flag. + +## Changelog + +### 0.0.4 + +- Added support for more mkdocs extensions + - mkdocs-material + - mkdocs-monorepo-plugin + - plantuml-markdown + - markdown_inline_graphviz_extension + - pygments + - pymdown-extensions diff --git a/packages/techdocs-container/techdocs-core/requirements.txt b/packages/techdocs-container/techdocs-core/requirements.txt index 2a13d1a9da..4037a174ea 100644 --- a/packages/techdocs-container/techdocs-core/requirements.txt +++ b/packages/techdocs-container/techdocs-core/requirements.txt @@ -2,6 +2,12 @@ # Note: if you update this, also update `install_requires` in setup.py # https://github.com/mkdocs/mkdocs mkdocs==1.1.2 +mkdocs-material==5.3.2 +mkdocs-monorepo-plugin==0.4.5 +plantuml-markdown==3.4.0 +markdown_inline_graphviz_extension==1.1 +pygments==2.6.1 +pymdown-extensions==7.1 # The linter using for Python # Note: This requires Python 3.6+ to run, but can format Python 2 code too. diff --git a/packages/techdocs-container/techdocs-core/setup.py b/packages/techdocs-container/techdocs-core/setup.py index 682825624c..72593dc433 100644 --- a/packages/techdocs-container/techdocs-core/setup.py +++ b/packages/techdocs-container/techdocs-core/setup.py @@ -18,7 +18,7 @@ from setuptools import setup, find_packages setup( name='mkdocs-techdocs-core', - version='0.0.3', + version='0.0.4', description='A Mkdocs package that contains TechDocs defaults', long_description='', keywords='mkdocs', @@ -28,7 +28,13 @@ setup( license='Apache-2.0', python_requires='>=3.7', install_requires=[ - 'mkdocs>=1.1.2' + 'mkdocs>=1.1.2', + 'mkdocs-material==5.3.2', + 'mkdocs-monorepo-plugin==0.4.5', + 'plantuml-markdown==3.4.0', + 'markdown_inline_graphviz_extension==1.1', + 'pygments==2.6.1', + 'pymdown-extensions==7.1' ], classifiers=[ 'Development Status :: 1 - Planning', diff --git a/packages/techdocs-container/techdocs-core/src/core.py b/packages/techdocs-container/techdocs-core/src/core.py index 0bd992ab7e..d021a69486 100644 --- a/packages/techdocs-container/techdocs-core/src/core.py +++ b/packages/techdocs-container/techdocs-core/src/core.py @@ -90,4 +90,7 @@ class TechDocsCore(BasePlugin): } config["markdown_extensions"].append("pymdownx.tilde") + config["markdown_extensions"].append("markdown_inline_graphviz") + config["markdown_extensions"].append("plantuml_markdown") + return config