зеркало из https://github.com/github/mlops.git
3-level menu docs
This commit is contained in:
Родитель
31e9d7cb83
Коммит
04eb70791f
|
@ -4,10 +4,6 @@ parent: UI Components
|
|||
order_n: 6
|
||||
---
|
||||
|
||||
{: .no_toc }
|
||||
|
||||
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
title: Typography
|
||||
parent: UI Components
|
||||
has_children: true
|
||||
order_n: 1
|
||||
---
|
||||
|
||||
|
|
|
@ -110,6 +110,8 @@ Use the `lh-` classes to explicitly apply line height to text.
|
|||
| `.lh-tight` | 1.1 | Default for headings |
|
||||
| `.lh-default` | 1.4 | Default for body (paragraphs) |
|
||||
|
||||
## code example
|
||||
|
||||
<div class="code-example" markdown="1">
|
||||
No Line height
|
||||
No Line height
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
---
|
||||
title: Fonts
|
||||
parent: Typography
|
||||
grand_parent: UI Components
|
||||
order_n: 1
|
||||
---
|
||||
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
## Font stack
|
||||
|
||||
By default, Just the Docs uses a native system font stack for sans-serif fonts:
|
||||
|
||||
```scss
|
||||
-apple-system, BlinkMacSystemFont, "helvetica neue", helvetica, roboto, noto, "segoe ui", arial, sans-serif
|
||||
```
|
||||
|
||||
ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
{: .fs-5 .ls-10 .code-example }
|
||||
|
||||
For monospace type, like code snippets or the `<pre>` element, Just the Docs uses a native system font stack for monospace fonts:
|
||||
|
||||
```scss
|
||||
"SFMono-Regular", Menlo, Consolas, Monospace
|
||||
```
|
||||
|
||||
ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
{: .fs-5 .ls-10 .text-mono .code-example }
|
||||
|
||||
---
|
||||
|
||||
## Responsive type scale
|
||||
|
||||
Just the Docs uses a responsive type scale that shifts depending on the viewport size.
|
||||
|
||||
| Selector | Small screen size `font-size` | Large screen size `font-size` |
|
||||
|:----------------------|:---------------------------------|:------------------------------|
|
||||
| `h1`, `.text-alpha` | 32px | 36px |
|
||||
| `h2`, `.text-beta` | 18px | 24px |
|
||||
| `h3`, `.text-gamma` | 16px | 18px |
|
||||
| `h4`, `.text-delta` | 14px | 16px |
|
||||
| `h5`, `.text-epsilon` | 16px | 18px |
|
||||
| `h6`, `.text-zeta` | 18px | 24px |
|
||||
| `body` | 14px | 16px |
|
||||
|
||||
---
|
||||
|
||||
## Headings
|
||||
|
||||
Headings are rendered like this:
|
||||
|
||||
<div class="code-example">
|
||||
<h1>Heading 1</h1>
|
||||
<h2>Heading 2</h2>
|
||||
<h3>Heading 3</h3>
|
||||
<h4>Heading 4</h4>
|
||||
<h5>Heading 5</h5>
|
||||
<h6>Heading 6</h6>
|
||||
</div>
|
||||
```markdown
|
||||
# Heading 1
|
||||
## Heading 2
|
||||
### Heading 3
|
||||
#### Heading 4
|
||||
##### Heading 5
|
||||
###### Heading 6
|
||||
```
|
|
@ -0,0 +1,71 @@
|
|||
---
|
||||
title: Text
|
||||
parent: Typography
|
||||
grand_parent: UI Components
|
||||
order_n: 2
|
||||
---
|
||||
|
||||
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Headings
|
||||
|
||||
Headings are rendered like this:
|
||||
|
||||
<div class="code-example">
|
||||
<h1>Heading 1</h1>
|
||||
<h2>Heading 2</h2>
|
||||
<h3>Heading 3</h3>
|
||||
<h4>Heading 4</h4>
|
||||
<h5>Heading 5</h5>
|
||||
<h6>Heading 6</h6>
|
||||
</div>
|
||||
```markdown
|
||||
# Heading 1
|
||||
## Heading 2
|
||||
### Heading 3
|
||||
#### Heading 4
|
||||
##### Heading 5
|
||||
###### Heading 6
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Body text
|
||||
|
||||
Default body text is rendered like this:
|
||||
|
||||
<div class="code-example" markdown="1">
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</div>
|
||||
```markdown
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Inline elements
|
||||
|
||||
<div class="code-example" markdown="1">
|
||||
Text can be **bold**, _italic_, or ~~strikethrough~~.
|
||||
|
||||
[Link to another page](another-page).
|
||||
</div>
|
||||
|
||||
```markdown
|
||||
Text can be **bold**, _italic_, or ~~strikethrough~~.
|
||||
|
||||
[Link to another page](another-page).
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Typographic Utilities
|
||||
|
||||
There are a number of specific typographic CSS classes that allow you to override default styling for font size, font weight, line height, and capitalization.
|
||||
|
||||
|
|
@ -3,20 +3,36 @@
|
|||
<h2>Sections</h2>
|
||||
<ul class="aside_nav">
|
||||
{%- for item in site.docs -%}
|
||||
{%- if item.parent == nil -%}
|
||||
<li>
|
||||
<a href="{{item.url}}">{{item.title}}</a>
|
||||
{%- if item.has_children -%}
|
||||
{%- assign this = item.title -%}
|
||||
{% assign children = site.docs | where: "parent", this %}
|
||||
<ul>
|
||||
{%- for child in children -%}
|
||||
<li style="margin-left: 25px;">
|
||||
<a href="{{child.url}}">{{child.title}}</a>
|
||||
<span class="toggle_sub"> +</span>
|
||||
{%- assign this = item.title -%}
|
||||
{% assign children = site.docs | where: "parent", this %}
|
||||
<ul class="sub_menu hidden">
|
||||
{%- for child in children -%}
|
||||
<li style="margin-left: 10px;">
|
||||
<a href="{{child.url}}">- {{child.title}}</a>
|
||||
{%- if child.has_children -%}
|
||||
<span class="toggle_sub"> +</span>
|
||||
{%- assign father_name = child.title -%}
|
||||
{%- assign grandfather_name = item.title -%}
|
||||
{% assign grandsons = site.docs | where: "parent", father_name | where: "grand_parent", grandfather_name %}
|
||||
<ul class="sub_menu hidden">
|
||||
{%- for gs in grandsons -%}
|
||||
<li style="margin-left: 10px;">
|
||||
<a href="{{gs.url}}">--- {{gs.title}}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
@ -99,9 +99,6 @@ li {
|
|||
border-bottom: 2px solid $brand-color;
|
||||
}
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,6 +266,13 @@ li {
|
|||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.rot45 {
|
||||
transform: rotate(45deg);
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
}
|
||||
.site-footer {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
@ -309,6 +313,11 @@ li {
|
|||
.sidebar_left {
|
||||
grid-area: bottom;
|
||||
padding: 20px;
|
||||
.toggle_sub {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
color: $brand-color;
|
||||
}
|
||||
nav {
|
||||
top: 180px;
|
||||
position: sticky;
|
||||
|
|
|
@ -232,7 +232,6 @@ table {
|
|||
margin-bottom: $spacing-unit;
|
||||
width: 100%;
|
||||
text-align: $table-text-align;
|
||||
color: lighten($text-color, 18%);
|
||||
border-collapse: collapse;
|
||||
border: 1px solid $grey-color-light;
|
||||
tr {
|
||||
|
|
|
@ -15,6 +15,7 @@ function toggle_menu() {
|
|||
nav.classList.remove('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
$(".tag_filter").click(function () {
|
||||
const filter = '.' + $(this).attr('data-tag');
|
||||
if (filter == '.all') {
|
||||
|
@ -26,4 +27,9 @@ $(".tag_filter").click(function () {
|
|||
};
|
||||
$(".tag_filter").removeClass("active");
|
||||
$(this).addClass('active');
|
||||
});
|
||||
|
||||
$(".toggle_sub").click(function () {
|
||||
$(this).toggleClass('rot45');
|
||||
$(this).next('ul').toggleClass('hidden');
|
||||
});
|
Загрузка…
Ссылка в новой задаче