mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 19:24:48 +02:00
Improve doc presentation
This commit is contained in:
3
doc/fmt.css
Normal file
3
doc/fmt.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.docblock {
|
||||||
|
margin-left: 24px;
|
||||||
|
}
|
@@ -12,14 +12,15 @@ The grammar for a replacement field is as follows:
|
|||||||
|
|
||||||
<a id="replacement-field"></a>
|
<a id="replacement-field"></a>
|
||||||
<pre>
|
<pre>
|
||||||
replacement_field ::= "{" [arg_id] [":" (<a href="#format-spec">format_spec</a
|
<code>replacement_field ::= "{" [arg_id] [":" (<a href="#format-spec"
|
||||||
> | <a href="#chrono-format-spec">chrono_format_spec</a>)] "}"
|
>format_spec</a> | <a href="#chrono-format-spec">chrono_format_spec</a>)] "}"
|
||||||
arg_id ::= integer | identifier
|
arg_id ::= integer | identifier
|
||||||
integer ::= digit+
|
integer ::= digit+
|
||||||
digit ::= "0"..."9"
|
digit ::= "0"..."9"
|
||||||
identifier ::= id_start id_continue*
|
identifier ::= id_start id_continue*
|
||||||
id_start ::= "a"..."z" | "A"..."Z" | "_"
|
id_start ::= "a"..."z" | "A"..."Z" | "_"
|
||||||
id_continue ::= id_start | digit
|
id_continue ::= id_start | digit
|
||||||
|
</code>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
In less formal terms, the replacement field can start with an *arg_id* that
|
In less formal terms, the replacement field can start with an *arg_id* that
|
||||||
@@ -74,7 +75,7 @@ The general form of a *standard format specifier* is:
|
|||||||
|
|
||||||
<a id="format-spec"></a>
|
<a id="format-spec"></a>
|
||||||
<pre>
|
<pre>
|
||||||
format_spec ::= [[fill]align][sign]["#"]["0"][width]["." precision]["L"][type]
|
<code>format_spec ::= [[fill]align][sign]["#"]["0"][width]["." precision]["L"][type]
|
||||||
fill ::= <a character other than '{' or '}'>
|
fill ::= <a character other than '{' or '}'>
|
||||||
align ::= "<" | ">" | "^"
|
align ::= "<" | ">" | "^"
|
||||||
sign ::= "+" | "-" | " "
|
sign ::= "+" | "-" | " "
|
||||||
@@ -84,6 +85,7 @@ precision ::= <a href="#replacement-field">integer</a> | "{" [<a
|
|||||||
href="#replacement-field">arg_id</a>] "}"
|
href="#replacement-field">arg_id</a>] "}"
|
||||||
type ::= "a" | "A" | "b" | "B" | "c" | "d" | "e" | "E" | "f" | "F" |
|
type ::= "a" | "A" | "b" | "B" | "c" | "d" | "e" | "E" | "f" | "F" |
|
||||||
"g" | "G" | "o" | "p" | "s" | "x" | "X" | "?"
|
"g" | "G" | "o" | "p" | "s" | "x" | "X" | "?"
|
||||||
|
</code>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
The *fill* character can be any Unicode code point other than `'{'` or `'}'`.
|
The *fill* character can be any Unicode code point other than `'{'` or `'}'`.
|
||||||
@@ -401,7 +403,7 @@ Format specifications for chrono duration and time point types as well as
|
|||||||
|
|
||||||
<a id="chrono-format-spec"></a>
|
<a id="chrono-format-spec"></a>
|
||||||
<pre>
|
<pre>
|
||||||
chrono_format_spec ::= [[<a href="#format-spec">fill</a>]<a href="#format-spec"
|
<code>chrono_format_spec ::= [[<a href="#format-spec">fill</a>]<a href="#format-spec"
|
||||||
>align</a>][<a href="#format-spec">width</a>]["." <a href="#format-spec"
|
>align</a>][<a href="#format-spec">width</a>]["." <a href="#format-spec"
|
||||||
>precision</a>][chrono_specs]
|
>precision</a>][chrono_specs]
|
||||||
chrono_specs ::= conversion_spec | <!--
|
chrono_specs ::= conversion_spec | <!--
|
||||||
@@ -415,6 +417,7 @@ chrono_type ::= "a" | "A" | "b" | "B" | "c" | "C" | "d" | "D" | "e" |
|
|||||||
"n" | "p" | "q" | "Q" | "r" | "R" | "S" | "t" | "T" |
|
"n" | "p" | "q" | "Q" | "r" | "R" | "S" | "t" | "T" |
|
||||||
"u" | "U" | "V" | "w" | "W" | "x" | "X" | "y" | "Y" |
|
"u" | "U" | "V" | "w" | "W" | "x" | "X" | "y" | "Y" |
|
||||||
"z" | "Z" | "%"
|
"z" | "Z" | "%"
|
||||||
|
</code>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Literal chars are copied unchanged to the output. Precision is valid only
|
Literal chars are copied unchanged to the output. Precision is valid only
|
||||||
@@ -719,7 +722,7 @@ These modifiers are only supported for the `'H'`, `'I'`, `'M'`, `'S'`, `'U'`,
|
|||||||
Format specifications for range types have the following syntax:
|
Format specifications for range types have the following syntax:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
range_format_spec ::= ["n"][range_type][range_underlying_spec]
|
<code>range_format_spec ::= ["n"][range_type][range_underlying_spec]</code>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
The `'n'` option formats the range without the opening and closing brackets.
|
The `'n'` option formats the range without the opening and closing brackets.
|
||||||
|
@@ -13,6 +13,9 @@ theme:
|
|||||||
- navigation.tabs
|
- navigation.tabs
|
||||||
- toc.integrate
|
- toc.integrate
|
||||||
|
|
||||||
|
extra_css:
|
||||||
|
- fmt.css
|
||||||
|
|
||||||
markdown_extensions:
|
markdown_extensions:
|
||||||
- pymdownx.highlight:
|
- pymdownx.highlight:
|
||||||
anchor_linenums: true
|
anchor_linenums: true
|
||||||
|
@@ -153,8 +153,10 @@ class CxxHandler(BaseHandler):
|
|||||||
text += '(' + params + ')'
|
text += '(' + params + ')'
|
||||||
text += ';'
|
text += ';'
|
||||||
text += '</code></pre>\n'
|
text += '</code></pre>\n'
|
||||||
|
text += '<div class="docblock">\n'
|
||||||
desc = doxyxml2html(d.desc)
|
desc = doxyxml2html(d.desc)
|
||||||
text += desc
|
text += desc
|
||||||
|
text += '</div>\n'
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def get_handler(theme: str, custom_templates: Optional[str] = None,
|
def get_handler(theme: str, custom_templates: Optional[str] = None,
|
||||||
|
Reference in New Issue
Block a user