Skip to content

Commit

Permalink
docs: Add custom genestack admonition (rackerlabs#618)
Browse files Browse the repository at this point in the history
* docs: Add custom genestack admonition type for specific references to the Genestack way...

Signed-off-by: Ken Crandall <[email protected]>

* fix: fix trailing whitespace (of course)

Signed-off-by: Ken Crandall <[email protected]>

---------

Signed-off-by: Ken Crandall <[email protected]>
  • Loading branch information
OpenStackKen authored Dec 10, 2024
1 parent 6aabdf5 commit 2b65c46
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/admonition-test.md
Original file line number Diff line number Diff line change
@@ -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!
196 changes: 196 additions & 0 deletions docs/assets/images/genestack-mono.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions docs/overrides/stylesheets/admonition.css
Original file line number Diff line number Diff line change
@@ -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);
}
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ extra:

extra_css:
- overrides/stylesheets/adr.css
- overrides/stylesheets/admonition.css

plugins:
- search
Expand Down

0 comments on commit 2b65c46

Please sign in to comment.