-
I'm currently adding custom admonition and details for my API docs to mimic the general appearance of the OpenAPI documentation, but in Markdown files for MkDocs. I'm currently encountering an issue where I would like to add the HTTP method (POST, GET, etc) as the This is my current CSS setup: .md-typeset .admonition.api-post,
.md-typeset details.api-post {
border-color: rgb(0, 200, 83);
}
.md-typeset .api-post > .admonition-title,
.md-typeset .api-post > summary {
background-color: rgba(0, 200, 83, 0.1);
}
.md-typeset .api-post > .admonition-title::before,
.md-typeset .api-post > summary::before {
content: "POST";
/* These are required to hide the default admonition icon. */
-webkit-mask-image: none;
mask-image: none;
background-color: transparent;
} Example Markdown: !!! api-post "/post"
Text |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I got a working solution... Not the most pretty or good IMO but it does what I wanted: .md-typeset .admonition.api-post,
.md-typeset details.api-post {
border-color: rgb(0, 200, 83);
}
.md-typeset .api-post > .admonition-title,
.md-typeset .api-post > summary {
background-color: rgba(0, 200, 83, 0.1);
padding-left: 4rem !important;
font-size: .9rem;
}
.md-typeset .api-post > .admonition-title::before,
.md-typeset .api-post > summary::before {
content: "POST";
-webkit-mask-image: none;
mask-image: none;
background-color: transparent;
top: auto;
} |
Beta Was this translation helpful? Give feedback.
I got a working solution... Not the most pretty or good IMO but it does what I wanted:
Result: