Skip to content

Commit 6e2e82c

Browse files
authored
Merge pull request #28 from ray-project/typography
typography changes to make headings stand out more
2 parents 28cfdb5 + fab8ad2 commit 6e2e82c

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

docs/css/extra.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,15 @@ label[for="__drawer"] {
5757
/* reduce the top margin of the main container */
5858
.md-main__inner {
5959
margin-top: 0;
60+
}
61+
62+
/* make the method names in API references stand out more */
63+
.md-typeset h3 {
64+
font-weight: bold;
65+
font-size: 1.4em;
66+
}
67+
68+
/* swap the top/bottom margin of h1 */
69+
.md-typeset h1 {
70+
margin: 1.25em 0 0;
6071
}

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ plugins:
6868
filters:
6969
- "!^_" # exlude all members starting with _
7070
- "^__init__$" # but always include __init__ modules and methods
71+
custom_templates: templates
7172

7273

7374
markdown_extensions:
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{{ log.debug() }}
2+
{% if config.show_if_no_docstring or method.has_contents %}
3+
4+
<div class="doc doc-object doc-method">
5+
{% with html_id = method.path %}
6+
7+
{% if not root or config.show_root_heading %}
8+
9+
{% if root %}
10+
{% set show_full_path = config.show_root_full_path %}
11+
{% set root_members = True %}
12+
{% elif root_members %}
13+
{% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %}
14+
{% set root_members = False %}
15+
{% else %}
16+
{% set show_full_path = config.show_object_full_path %}
17+
{% endif %}
18+
19+
{% filter heading(heading_level,
20+
role="method",
21+
id=html_id,
22+
class="doc doc-heading",
23+
toc_label=method.name ~ "()") %}
24+
25+
{{ method.name }}
26+
27+
{% with properties = method.properties %}
28+
{% include "properties.html" with context %}
29+
{% endwith %}
30+
31+
{% endfilter %}
32+
33+
{% else %}
34+
{% if config.show_root_toc_entry %}
35+
{% filter heading(heading_level,
36+
role="method",
37+
id=html_id,
38+
toc_label=method.path,
39+
hidden=True) %}
40+
{% endfilter %}
41+
{% endif %}
42+
{% set heading_level = heading_level - 1 %}
43+
{% endif %}
44+
45+
<div class="doc doc-contents {% if root %}first{% endif %}">
46+
{% filter highlight(language="python", inline=True) %}
47+
{% if show_full_path %}{{ method.path }}{% else %}{{ method.name }}{% endif %}
48+
{% with signature = method.signature %}{% include "signature.html" with context %}{% endwith %}
49+
{% endfilter %}
50+
51+
{% with docstring_sections = method.docstring_sections %}
52+
{% include "docstring.html" with context %}
53+
{% endwith %}
54+
55+
{% if config.show_source and method.source %}
56+
<details class="quote">
57+
<summary>Source code in <code>{{ method.relative_file_path }}</code></summary>
58+
{{ method.source.code|highlight(language="python", linestart=method.source.line_start, linenums=False) }}
59+
</details>
60+
{% endif %}
61+
</div>
62+
63+
{% endwith %}
64+
</div>
65+
66+
{% endif %}

0 commit comments

Comments
 (0)