Merge branch 'master' into custom_header_footer

This commit is contained in:
Igor Żuk
2020-09-15 00:09:50 +02:00
committed by GitHub
81 changed files with 1493 additions and 132 deletions

View File

@@ -22,6 +22,7 @@ Just the Docs has some specific configuration parameters that can be defined in
View this site's [_config.yml](https://github.com/pmarsceill/just-the-docs/tree/master/_config.yml) file as an example.
## Site logo
```yaml
@@ -101,6 +102,7 @@ gh_edit_link: true # show or hide edit this page link
gh_edit_link_text: "Edit this page on GitHub."
gh_edit_repository: "https://github.com/pmarsceill/just-the-docs" # the github URL for your repo
gh_edit_branch: "master" # the branch that your docs is served from
# gh_edit_source: docs # the source that your files originate from
gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately
```
@@ -108,6 +110,7 @@ gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into t
- `last_edit_time_format` uses Ruby's DateTime formatter; see examples and more information [at this link.](https://apidock.com/ruby/DateTime/strftime)
- `gh_edit_repository` is the URL of the project's GitHub repository
- `gh_edit_branch` is the branch that the docs site is served from; defaults to `master`
- `gh_edit_source` is the source directory that your project files are stored in (should be the same as [site.source](https://jekyllrb.com/docs/configuration/options/))
- `gh_edit_view_mode` is `"tree"` by default, which brings the user to the github page; switch to `"edit"` to bring the user directly into editing mode
## Color scheme
@@ -142,3 +145,52 @@ See [Customization]({{ site.baseurl }}{% link docs/customization.md %}) for more
ga_tracking: UA-5555555-55
ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (true by default)
```
## Document collections
By default, the navigation and search include normal [pages](https://jekyllrb.com/docs/pages/).
Instead, you can also use [Jekyll collections](https://jekyllrb.com/docs/collections/) which group documents semantically together.
For example, put all your documentation files in the `_docs` folder and create the `docs` collection:
```yaml
# Define Jekyll collections
collections:
# Define a collection named "docs", its documents reside in the "_docs" directory
docs:
permalink: "/:collection/:path/"
output: true
just_the_docs:
# Define which collections are used in just-the-docs
collections:
# Reference the "docs" collection
docs:
# Give the collection a name
name: Documentation
# Exclude the collection from the navigation
# Supports true or false (default)
nav_exclude: false
# Exclude the collection from the search
# Supports true or false (default)
search_exclude: false
```
You can reference multiple collections.
This creates categories in the navigation with the configured names.
```yaml
collections:
docs:
permalink: "/:collection/:path/"
output: true
tutorials:
permalink: "/:collection/:path/"
output: true
just_the_docs:
collections:
docs:
name: Documentation
tutorials:
name: Tutorials
```

View File

@@ -39,7 +39,7 @@ GitHubPages::Dependencies.gems.each do |gem, version|
end
```
#### [](#header-4)Header 4
#### [](#header-4)Header 4 `with code not transformed`
* This is an unordered list following a header.
* This is an unordered list following a header.
@@ -140,6 +140,37 @@ end
<dd>Green</dd>
</dl>
#### Multiple description terms and values
Term
: Brief description of Term
Longer Term
: Longer description of Term,
possibly more than one line
Term
: First description of Term,
possibly more than one line
: Second description of Term,
possibly more than one line
Term1
Term2
: Single description of Term1 and Term2,
possibly more than one line
Term1
Term2
: First description of Term1 and Term2,
possibly more than one line
: Second description of Term1 and Term2,
possibly more than one line
### More code
```
Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
```

View File

@@ -7,11 +7,14 @@ nav_order: 5
# Navigation Structure
{: .no_toc }
## Table of contents
{: .no_toc .text-delta }
<details open markdown="block">
<summary>
Table of contents
</summary>
{: .text-delta }
1. TOC
{:toc}
</details>
---
@@ -25,7 +28,7 @@ By default, all pages will appear as top level pages in the main nav unless a pa
## Ordering pages
To specify a page order, use the `nav_order` parameter in your pages' YAML front matter.
To specify a page order, you can use the `nav_order` parameter in your pages' YAML front matter.
#### Example
{: .no_toc }
@@ -38,12 +41,13 @@ nav_order: 4
---
```
The specified `nav_order` parameters on a site should be all integers or all strings.
Pages without a `nav_order` parameter are ordered alphabetically by their `title`,
and appear after the explicitly-ordered pages at each level.
By default, all Capital letters are sorted before all lowercase letters;
adding `nav_sort: case_insensitive` in the configuration file ignores case
when sorting strings (but also sorts numbers lexicographically: `10` comes before `1`).
The parameter values determine the order of the top-level pages, and of child pages with the same parent. You can reuse the same parameter values (e.g., integers starting from 1) for the child pages of different parents.
The parameter values can be numbers (integers, floats) and/or strings. When you omit `nav_order` parameters, they default to the titles of the pages, which are ordered alphabetically. Pages with numerical `nav_order` parameters always come before those with strings or default `nav_order` parameters. If you want to make the page order independent of the page titles, you can set explicit `nav_order` parameters on all pages.
By default, all Capital letters come before all lowercase letters; you can add `nav_sort: case_insensitive` in the configuration file to ignore the case. Enclosing strings in quotation marks is optional.
> *Note for users of previous versions:* `nav_sort: case_insensitive` previously affected the ordering of numerical `nav_order` parameters: e.g., `10` came before `2`. Also, all pages with explicit `nav_order` parameters previously came before all pages with default parameters. Both were potentially confusing, and they have now been eliminated.
---
@@ -62,6 +66,8 @@ nav_exclude: true
---
```
Pages with no `title` are automatically excluded from the navigation.
---
## Pages with children

22
docs/tests/index.md Normal file
View File

@@ -0,0 +1,22 @@
---
layout: default
title: Tests
has_children: true
nav_order: 100
---
# Tests
The main documentation pages of this theme illustrate the use of many of its features, which to some extent tests their implementation. The pages linked below provide further test cases for particular features, and may be useful for regression testing when developing new features.
The default configuration does not include the test pages. To include them, *commment-out* the following line in `_config.yml`:
```yaml
, "docs/tests/"
```
so that it is:
```yaml
# , "docs/tests/"
```
(Apparently Jekyll's `include` does *not* override `exclude` for the same folder...)

View File

@@ -0,0 +1,15 @@
---
layout: default
title: Excluded Child
parent: Not Excluded
nav_exclude: true
---
# Excluded Child
This child page is explicitly excluded, and should not appear in the navigation.
```yaml
title: Excluded Child
parent: Not Excluded
nav_exclude: true
```

View File

@@ -0,0 +1,17 @@
---
layout: default
title: Excluded Grandchild
parent: Non-excluded Child
grand_parent: Non-excluded
nav_exclude: true
---
# Excluded Grandchild
This grandchild page is explicitly excluded, and should not appear in the navigation.
```yaml
title: Excluded Grandchild
parent: Non-excluded Child
grand_parent: Non-excluded
nav_exclude: true
```

View File

@@ -0,0 +1,15 @@
---
layout: default
title: Excluded
has_children: true
nav_exclude: true
---
# Excluded
This top-level page is explicitly excluded, and should not appear in the navigation. Any child pages are implicitly excluded.
```yaml
title: Excluded
has_children: true
nav_exclude: true
```

View File

@@ -0,0 +1,15 @@
---
layout: default
title: Non-excluded Child of Excluded
parent: Excluded
nav_exclude: false
---
# Non-excluded Child of Excluded
This child page is explicitly not excluded, but its parent page is excluded, so it should not appear in the navigation.
```yaml
title: Non-excluded Child of Excluded
parent: Excluded
nav_exclude: false
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: Non-excluded Child
parent: Non-excluded
has_children: true
nav_exclude: false
---
# Non-excluded Child
This child page is explicitly not excluded, and should appear in the navigation.
```yaml
title: Non-excluded Child
parent: Non-excluded
nav_exclude: false
```

View File

@@ -0,0 +1,17 @@
---
layout: default
title: Non-excluded Grandchild of Excluded
parent: Non-excluded Child
grand_parent: Excluded
nav_exclude: false
---
# Non-excluded Grandchild of Excluded
This grandchild page is explicitly not excluded, and neither is its parent page; but its grandparent page is excluded, so it should not appear in the navigation.
```yaml
title: Non-excluded Grandchild of Excluded
parent: Non-excluded Child
grand_parent: Excluded
nav_exclude: false
```

View File

@@ -0,0 +1,17 @@
---
layout: default
title: Non-excluded Grandchild
parent: Non-excluded Child
grand_parent: Non-excluded
nav_exclude: false
---
# Non-excluded Grandchild
This grandchild page is explicitly not excluded, and neither is its parent page nor its grandparent page, so it should appear in the navigation.
```yaml
title: Non-excluded Grandchild of Excluded
parent: Non-excluded Child
grand_parent: Excluded
nav_exclude: false
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: Non-excluded
has_children: true
nav_exclude: false
---
# Non-excluded
This top-level page is explicitly not excluded, and should appear in the navigation.
```yaml
title: Non-excluded
nav_exclude: false
```

View File

@@ -0,0 +1,6 @@
---
layout: default
---
# Untitled
This page does not have a `title`, and it is excluded from the navigation -- unless it is located in a Jekyll collection (which provides default titles). To exclude a title-less page from the navigation, regardless of whether it is located in a collection, set `nav_exclude: true`.

View File

@@ -0,0 +1,14 @@
---
layout: default
title: A
has_children: true
---
# A
A top-level page
```yaml
title: A
has_children: true
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: B
has_children: true
---
# B
A top-level page
```yaml
title: B
has_children: true
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: C
parent: A
has_children: true
---
# C
A child of page A, and parent of page D
```yaml
title: C
parent: A
has_children: true
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: C
parent: B
has_children: true
---
# C
A child of page B, and parent of page D
```yaml
title: C
parent: B
has_children: true
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: D
parent: C
grand_parent: A
---
# D
A grandchild of page A
```yaml
title: D
parent: C
grand_parent: A
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: D
parent: C
grand_parent: B
---
# D
A grandchild of page B
```yaml
title: D
parent: C
grand_parent: B
```

View File

@@ -0,0 +1,28 @@
---
layout: default
title: Navigation
parent: Tests
---
# Navigation
## Parent page disambiguation
- [Page A](grandparent/a/) has a child [page with title C](grandparent/ca/), and a grandchild [page with title D](grandparent/dca/).
- [Page B](grandparent/b/) has a child [page with title C](grandparent/cb/), and a grandchild [page with title D](grandparent/dcb/).
- The grandchild pages specify their parent and grandparent pages, so there is no ambiguity.
## Page exclusion
- An [untitled page](exclude/untitled/) is excluded from the navigation.
- An excluded [top level page](exclude/excluded/), [child page](exclude/excluded-child/), or [grandchild page](exclude/excluded-grandchild/) does not appear.
- A non-excluded [top level page](exclude/non-excluded/) appears; and a non-excluded [child page](exclude/non-excluded-child/) or [grandchild page](exclude/non-excluded-grandchild/) appears if its parent appears.
- A non-excluded child page or grandchild page does not appear if its parent is excluded.
## Page order
- [Default](order/default/), using `title` instead of `nav_order` fields.
- [Strings](order/strings/), lexicographically ordered, possibly case-insensitively.
- [Integers](order/integers/), numerically ordered.
- [Floats](order/floats/), numerically ordered.
- [Mixture](order/mixture/), with numbers before strings.

View File

@@ -0,0 +1,14 @@
---
layout: default
title: "10"
parent: Default
grand_parent: Order
---
# 10
```yaml
title: "10"
parent: Default
grand_parent: Order
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: "2"
parent: Default
grand_parent: Order
---
# 2
```yaml
title: "2"
parent: Default
grand_parent: Order
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: A
parent: Default
grand_parent: Order
---
# A
```yaml
title: A
parent: Default
grand_parent: Order
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: aa
parent: Default
grand_parent: Order
---
# aa
```yaml
title: aa
parent: Default
grand_parent: Order
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: Aa
parent: Default
grand_parent: Order
---
# Aa
```yaml
title: Aa
parent: Default
grand_parent: Order
```

View File

@@ -0,0 +1,15 @@
---
layout: default
title: Default
parent: Order
nav_order: 1
has_children: true
---
# Default Order
When `nav_order` fields are omitted, the pages are ordered alphabetically by their titles.
By default, all Capital letters come before all lowercase letters; you can add `nav_sort: case_insensitive` in the configuration file to ignore the case).
Digits precede letters, and numeric titles are ordered lexicographically: `10` precedes `2` (in contrast to explicit numeric `nav_order` values).

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "-1.1"
nav_order: -1.1
parent: Floats
grand_parent: Order
---
# -1.1
```yaml
title: "-1.1"
nav_order: -1.1
parent: Floats
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "0.0"
nav_order: 0.0
parent: Floats
grand_parent: Order
---
# 0.0
```yaml
title: "0.0"
nav_order: 0.0
parent: Floats
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "10.0"
nav_order: 10.0
parent: Floats
grand_parent: Order
---
# 10.0
```yaml
title: "10.0"
nav_order: 10.0
parent: Floats
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "2.2222"
nav_order: 2.2222
parent: Floats
grand_parent: Order
---
# 2.2222
```yaml
title: "2.2222"
nav_order: 2.2222
parent: Floats
grand_parent: Order
```

View File

@@ -0,0 +1,13 @@
---
layout: default
title: Floats
parent: Order
nav_order: 4
has_children: true
---
# Floating-Point Order
When `nav_order` fields are floating-point numbers, the pages are ordered in increasing order of the numerical values.
Floats include `0.0` and negative values.

View File

@@ -0,0 +1,8 @@
---
layout: default
title: Order
has_children: true
nav_order: 110
---
# Order

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "-1"
nav_order: -1
parent: Integers
grand_parent: Order
---
# -1
```yaml
title: "-1"
nav_order: -1
parent: Integers
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "0"
nav_order: 0
parent: Integers
grand_parent: Order
---
# 0
```yaml
title: "0"
nav_order: 0
parent: Integers
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "10"
nav_order: 10
parent: Integers
grand_parent: Order
---
# 10
```yaml
title: "10"
nav_order: 10
parent: Integers
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "2"
nav_order: 2
parent: Integers
grand_parent: Order
---
# 2
```yaml
title: "2"
nav_order: 2
parent: Integers
grand_parent: Order
```

View File

@@ -0,0 +1,13 @@
---
layout: default
title: Integers
parent: Order
nav_order: 3
has_children: true
---
# Integer Order
When `nav_order` fields are integers, the pages are ordered in increasing order of the numerical values.
Integers include `0` and negative values. Integers can be reused for top-level pages and for different sets of child pages.

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "-1.1"
nav_order: -1.1
parent: Mixture
grand_parent: Order
---
# -1.1
```yaml
title: "-1.1"
nav_order: -1.1
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "-1"
nav_order: -1
parent: Mixture
grand_parent: Order
---
# -1
```yaml
title: "-1"
nav_order: -1
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "0.0"
nav_order: 0.0
parent: Mixture
grand_parent: Order
---
# 0.0
```yaml
title: "0.0"
nav_order: 0.0
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "0"
nav_order: 0
parent: Mixture
grand_parent: Order
---
# 0
```yaml
title: "0"
nav_order: 0
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "10.0"
nav_order: 10.0
parent: Mixture
grand_parent: Order
---
# 10.0
```yaml
title: "10.0"
nav_order: 10.0
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: "10"
parent: Mixture
grand_parent: Order
---
# 10
```yaml
title: "10"
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "2.2222"
nav_order: 2.2222
parent: Mixture
grand_parent: Order
---
# 2.2222
```yaml
title: "2.2222"
nav_order: 2.2222
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: "2"
parent: Mixture
grand_parent: Order
---
# 2
```yaml
title: "2"
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,14 @@
---
layout: default
title: A
parent: Mixture
grand_parent: Order
---
# A
```yaml
title: A
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: aa
nav_order: "aa"
parent: Mixture
grand_parent: Order
---
# aa
```yaml
title: aa
nav_order: "aa"
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: Aa
nav_order: "Aa"
parent: Mixture
grand_parent: Order
---
# Aa
```yaml
title: Aa
nav_order: "Aa"
parent: Mixture
grand_parent: Order
```

View File

@@ -0,0 +1,11 @@
---
layout: default
title: Mixture
parent: Order
nav_order: 5
has_children: true
---
# Mixed Order
It seems unlikely that different types of `nav_order` values are needed for the children of the same parent.

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "10"
nav_order: "10"
parent: Strings
grand_parent: Order
---
# 10
```yaml
title: "10"
nav_order: "10"
parent: Strings
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: "2"
nav_order: "2"
parent: Strings
grand_parent: Order
---
# 2
```yaml
title: "2"
nav_order: "2"
parent: Strings
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: A
nav_order: A
parent: Strings
grand_parent: Order
---
# A
```yaml
title: A
nav_order: A
parent: Strings
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: aa
nav_order: "aa"
parent: Strings
grand_parent: Order
---
# aa
```yaml
title: aa
nav_order: "aa"
parent: Strings
grand_parent: Order
```

View File

@@ -0,0 +1,16 @@
---
layout: default
title: Aa
nav_order: "Aa"
parent: Strings
grand_parent: Order
---
# Aa
```yaml
title: Aa
nav_order: "Aa"
parent: Strings
grand_parent: Order
```

View File

@@ -0,0 +1,13 @@
---
layout: default
title: Strings
parent: Order
nav_order: 2
has_children: true
---
# String Order
By default, all Capital letters come before all lowercase letters; you can add `nav_sort: case_insensitive` in the configuration file to ignore the case).
Digits precede letters, and numeric titles are ordered lexicographically: `"10"` precedes `"2"` (in contrast to explicit numeric `nav_order` values).

View File

@@ -2,6 +2,7 @@
layout: default
title: Code
parent: UI Components
has_children: true
nav_order: 6
---

View File

@@ -0,0 +1,115 @@
---
layout: default
title: Code with line numbers
parent: Code
grand_parent: UI Components
permalink: /docs/ui-components/code/line-numbers/
---
# Code snippets with line numbers
The default settings for HTML compression are incompatible with the HTML
produced by Jekyll (4.1.1 or earlier) for line numbers from highlighted code
-- both when using Kramdown code fences and when using Liquid highlight tags.
To avoid non-conforming HTML and unsatisfactory layout, HTML compression
can be turned off by using the following configuration option:
{% highlight yaml %}
compress_html:
ignore:
envs: all
{% endhighlight %}
When using Kramdown code fences, line numbers are turned on globally by the
following configuration option:
{% highlight yaml %}
kramdown:
syntax_highlighter_opts:
block:
line_numbers: true
{% endhighlight %}
Line numbers can then be suppressed locally using Liquid tags (_without_ the
`linenos` option) instead of fences:
{% highlight yaml %}
{% raw %}{% highlight some_language %}
Some code
{% endhighlight %}{% endraw %}
{% endhighlight %}
## Workarounds
To use HTML compression together with line numbers, all highlighted code
needs to be wrapped using one of the following workarounds.
(The variable name `some_var` can be changed to avoid clashes; it can also
be replaced by `code` -- but note that `code=code` cannot be removed).
### Code fences (three backticks)
{% highlight default %}
{% raw %}{% capture some_var %}
```some_language
Some code
```
{% endcapture %}
{% assign some_var = some_var | markdownify %}
{% include fix_linenos.html code=some_var %}{% endraw %}
{% endhighlight %}
### Liquid highlighting
{% highlight default %}
{% raw %}{% capture some_var %}
{% highlight some_language linenos %}
Some code
{% endhighlight %}
{% endcapture %}
{% include fix_linenos.html code=some_var %}{% endraw %}
{% endhighlight %}
_Credit:_ The original version of the above workaround was suggested by
Dmitry Hrabrov at
<https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901>.
## Examples
✅ Using code fences + workaround (will only show line numbers if enabled globally in `_config.yml`):
{% capture code_fence %}
```js
// Javascript code with syntax highlighting in fences
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l)
return true;
}
```
{% endcapture %}
{% assign code_fence = code_fence | markdownify %}
{% include fix_linenos.html code=code_fence %}
✅ Using liquid highlighting + workaround:
{% capture code %}
{% highlight ruby linenos %}
# Ruby code with syntax highlighting and fixed line numbers using Liquid
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
{% endhighlight %}
{% endcapture %}
{% include fix_linenos.html code=code %}
{% assign code = nil %}
❌ With the default configuration options, the following example illustrates
the **incorrect** formatting arising from the incompatibility of HTML compression
and the non-conforming HTML produced by Jekyll for line numbers:
{% highlight ruby linenos %}
# Ruby code with syntax highlighting and unfixed line numbers using Liquid
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
{% endhighlight %}

View File

@@ -21,7 +21,7 @@ nav_order: 1
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
system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif
```
ABCDEFGHIJKLMNOPQRSTUVWXYZ