From 2b65c46015d24e5ff6f0f0115a4c451238a57d6b Mon Sep 17 00:00:00 2001 From: Ken Crandall Date: Tue, 10 Dec 2024 06:29:03 -0800 Subject: [PATCH] docs: Add custom genestack admonition (#618) * docs: Add custom genestack admonition type for specific references to the Genestack way... Signed-off-by: Ken Crandall * fix: fix trailing whitespace (of course) Signed-off-by: Ken Crandall --------- Signed-off-by: Ken Crandall --- docs/admonition-test.md | 15 ++ docs/assets/images/genestack-mono.svg | 196 ++++++++++++++++++++++ docs/overrides/stylesheets/admonition.css | 25 +++ mkdocs.yml | 1 + 4 files changed, 237 insertions(+) create mode 100644 docs/admonition-test.md create mode 100644 docs/assets/images/genestack-mono.svg create mode 100644 docs/overrides/stylesheets/admonition.css diff --git a/docs/admonition-test.md b/docs/admonition-test.md new file mode 100644 index 00000000..e3846d8d --- /dev/null +++ b/docs/admonition-test.md @@ -0,0 +1,15 @@ +# Custom Genestack Admonition + +There is now a 'genestack' admonition type: + +``` +!!! genestack + [Genestack](https://github.com/rackerlabs/genestack){:target="_blank"} + is a cool new project! +``` + +It renders like this: + +!!! genestack + [Genestack](https://github.com/rackerlabs/genestack){:target="_blank"} + is a cool new project! diff --git a/docs/assets/images/genestack-mono.svg b/docs/assets/images/genestack-mono.svg new file mode 100644 index 00000000..8dc4582c --- /dev/null +++ b/docs/assets/images/genestack-mono.svg @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/overrides/stylesheets/admonition.css b/docs/overrides/stylesheets/admonition.css new file mode 100644 index 00000000..6cbc2ab7 --- /dev/null +++ b/docs/overrides/stylesheets/admonition.css @@ -0,0 +1,25 @@ + +/* +Custom Genestack Admonition Type +*/ + +:root { + --md-admonition-icon--genestack: url('/assets/images/genestack-mono.svg'); +} + +.md-typeset .admonition.genestack, +.md-typeset details.genestack { + border-color: rgb(158, 0, 0); +} + +.md-typeset .genestack>.admonition-title, +.md-typeset .genestack>summary { + background-color: rgba(158, 0, 0, 0.1); +} + +.md-typeset .genestack>.admonition-title::before, +.md-typeset .genestack>summary::before { + background-color: rgb(158, 0, 0); + -webkit-mask-image: var(--md-admonition-icon--genestack); + mask-image: var(--md-admonition-icon--genestack); +} diff --git a/mkdocs.yml b/mkdocs.yml index 70d80861..a09bd0c6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -83,6 +83,7 @@ extra: extra_css: - overrides/stylesheets/adr.css + - overrides/stylesheets/admonition.css plugins: - search