Try to make the custom doc page (#284)

pull/424/head
tessier 5 years ago
parent a6f33a87e9
commit bc85a15aa5

@ -4,7 +4,7 @@ set -e
app_root_dir="diagrams"
# NOTE: azure icon set is not latest version
providers=("onprem" "aws" "azure" "gcp" "firebase" "k8s" "alibabacloud" "oci" "programming" "saas" "elastic" "generic" "openstack" "outscale")
providers=("onprem" "aws" "azure" "gcp" "firebase" "k8s" "alibabacloud" "oci" "programming" "saas" "elastic" "generic" "openstack" "outscale" "custom" )
if ! [ -x "$(command -v round)" ]; then
echo 'round is not installed'

@ -13,7 +13,7 @@ DIR_TEMPLATE = "templates"
PROVIDERS = (
"base", "onprem", "aws", "azure", "gcp", "firebase", "k8s", "alibabacloud", "oci", "programming", "saas", "elastic",
"generic", "openstack", "outscale")
"generic", "openstack", "outscale", "custom")
#########################
# Resource Processing #

@ -8,7 +8,6 @@ class _Chat(_Saas):
_icon_dir = "resources/saas/chat"
class Discord(_Chat):
_icon = "discord.png"

@ -0,0 +1,6 @@
---
id: custom
title: Custom
---
For a full example check: https://diagrams.mingrammer.com/docs/getting-started/examples#rabbitmq-consumers-with-custom-nodes

@ -2,7 +2,7 @@ import os
import sys
from typing import Iterable
from jinja2 import Environment, FileSystemLoader, Template
from jinja2 import Environment, FileSystemLoader, Template, exceptions
import config as cfg
from . import app_root_dir, doc_root_dir, resource_dir, template_dir
@ -41,7 +41,12 @@ def gen_classes(pvd: str, typ: str, paths: Iterable[str]) -> str:
def gen_apidoc(pvd: str, typ_paths: dict) -> str:
tmpl = load_tmpl(cfg.TMPL_APIDOC)
try:
default_tmp = cfg.TMPL_APIDOC.split('.')
tmpl_file = f"{default_tmp[0]}_{pvd}.{default_tmp[1]}"
tmpl = load_tmpl(tmpl_file)
except exceptions.TemplateNotFound:
tmpl = load_tmpl(cfg.TMPL_APIDOC)
# TODO: remove
def _gen_class_name(path: str) -> str:

@ -0,0 +1,6 @@
---
id: {{ pvd }}
title: {{ pvd|up_or_title(pvd) }}
---
For a full example check: https://diagrams.mingrammer.com/docs/getting-started/examples#rabbitmq-consumers-with-custom-nodes
Loading…
Cancel
Save