forked from fmtlib/fmt
Improve docs
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
:root {
|
:root {
|
||||||
--md-primary-fg-color: #0065C9;
|
--md-primary-fg-color: #0050D0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.md-grid {
|
.md-grid {
|
||||||
@ -14,6 +14,10 @@
|
|||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pre > code.decl {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
.features-container {
|
.features-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
@ -105,7 +105,7 @@ hide:
|
|||||||
per-call binary code</b>. For example, a call to <code>fmt::print</code> with
|
per-call binary code</b>. For example, a call to <code>fmt::print</code> with
|
||||||
a single argument is fewer than <a href="https://godbolt.org/g/TZU4KF">ten
|
a single argument is fewer than <a href="https://godbolt.org/g/TZU4KF">ten
|
||||||
x86-64 instructions</a>, comparable to <code>printf</code> despite adding
|
x86-64 instructions</a>, comparable to <code>printf</code> despite adding
|
||||||
runtime safety and much smaller than the equivalent iostreams code.
|
runtime safety, and much smaller than the equivalent iostreams code.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The library itself has small binary footprint and some components such as
|
The library itself has small binary footprint and some components such as
|
||||||
|
@ -105,17 +105,17 @@ def render_decl(d: Definition) -> None:
|
|||||||
text = ''
|
text = ''
|
||||||
if d.id is not None:
|
if d.id is not None:
|
||||||
text += f'<a id="{d.id}">\n'
|
text += f'<a id="{d.id}">\n'
|
||||||
text += '<pre><code class="language-cpp">'
|
text += '<pre><code class="language-cpp decl">'
|
||||||
|
|
||||||
if d.template_params is not None:
|
if d.template_params is not None:
|
||||||
text += 'template <'
|
text += 'template <'
|
||||||
text += ', '.join(
|
text += ', '.join(
|
||||||
[f'{p.type} {p.name}'.rstrip() for p in d.template_params])
|
[f'{p.type} {p.name}'.rstrip() for p in d.template_params])
|
||||||
text += '>\n'
|
text += '>\n'
|
||||||
|
|
||||||
end = ';'
|
end = ';'
|
||||||
if d.kind == 'function' or d.kind == 'variable':
|
if d.kind == 'function' or d.kind == 'variable':
|
||||||
text += d.type + ' '
|
text += d.type + ' ' if len(d.type) > 0 else ''
|
||||||
elif d.kind == 'typedef':
|
elif d.kind == 'typedef':
|
||||||
text += 'using '
|
text += 'using '
|
||||||
elif d.kind == 'define':
|
elif d.kind == 'define':
|
||||||
@ -129,9 +129,7 @@ def render_decl(d: Definition) -> None:
|
|||||||
(p.type + ' ' if p.type else '') + p.name for p in d.params])
|
(p.type + ' ' if p.type else '') + p.name for p in d.params])
|
||||||
text += '(' + escape_html(params) + ')'
|
text += '(' + escape_html(params) + ')'
|
||||||
if d.trailing_return_type:
|
if d.trailing_return_type:
|
||||||
text += '\n ' \
|
text += ' -⁠> ' + escape_html(d.trailing_return_type)
|
||||||
if len(d.name) + len(params) + len(d.trailing_return_type) > 68 else ''
|
|
||||||
text += ' -> ' + escape_html(d.trailing_return_type)
|
|
||||||
elif d.kind == 'typedef':
|
elif d.kind == 'typedef':
|
||||||
text += ' = ' + escape_html(d.type)
|
text += ' = ' + escape_html(d.type)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user