fix: MAN — use mkdocs-native ??? admonition, blank line after title, indent all lines
This commit is contained in:
@@ -159,12 +159,15 @@ func buildManualPage(spec types.ServiceSpec, nav string, version string) string
|
|||||||
}
|
}
|
||||||
b.WriteString(fmt.Sprintf("Сервис **%s** (`nubes_%s`). См. [Create params](%s_params_create.md) для списка параметров.\n\n", name, spec.Name, spec.Name))
|
b.WriteString(fmt.Sprintf("Сервис **%s** (`nubes_%s`). См. [Create params](%s_params_create.md) для списка параметров.\n\n", name, spec.Name, spec.Name))
|
||||||
|
|
||||||
// MAN в раскрывающемся блоке — DevOps читает если застрял
|
// MAN в раскрывающемся блоке — mkdocs-native ??? admonition
|
||||||
man := strings.TrimSpace(spec.ServiceMan)
|
man := strings.TrimSpace(spec.ServiceMan)
|
||||||
if man != "" {
|
if man != "" {
|
||||||
b.WriteString("<details class=\"man-content\">\n<summary>Справка (MAN)</summary>\n\n")
|
b.WriteString("??? note \"Справка (MAN)\"\n\n")
|
||||||
b.WriteString(htmlToMarkdown(man))
|
md := htmlToMarkdown(man)
|
||||||
b.WriteString("\n\n</details>\n")
|
for _, line := range strings.Split(md, "\n") {
|
||||||
|
b.WriteString(" " + line + "\n")
|
||||||
|
}
|
||||||
|
b.WriteString("\n")
|
||||||
}
|
}
|
||||||
return b.String()
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,14 +43,7 @@
|
|||||||
padding-bottom: 0.3rem;
|
padding-bottom: 0.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.md-typeset details.man-content {
|
/* MAN content inside admonition */
|
||||||
font-size: 0.78rem;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.md-typeset details.man-content[open] {
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Resource title + tabs: compact */
|
/* Resource title + tabs: compact */
|
||||||
.md-typeset .md-content__inner > h1:first-child {
|
.md-typeset .md-content__inner > h1:first-child {
|
||||||
|
|||||||
Reference in New Issue
Block a user