\' -%}
+ {%- assign title = title[1] | strip_html -%}
+ {%- assign content = titleAndContent[1] -%}
+ {%- assign url = page.url -%}
+ {%- if title == page.title and parts[0] == \'\' -%}
+ {%- assign title_found = true -%}
+ {%- else -%}
+ {%- assign id = titleAndContent[0] -%}
+ {%- assign id = id | split: \'id="\' -%}
+ {%- if id.size == 2 -%}
+ {%- assign id = id[1] -%}
+ {%- assign id = id | split: \'"\' -%}
+ {%- assign id = id[0] -%}
+ {%- capture url -%}{{ url | append: \'#\' | append: id }}{%- endcapture -%}
+ {%- endif -%}
+ {%- endif -%}
+ {%- unless i == 0 -%},{%- endunless -%}
+ "{{ i }}": {
+ "doc": {{ page.title | jsonify }},
+ "title": {{ title | jsonify }},
+ "content": {{ content | replace: \'
Date: Sat, 27 Jun 2020 17:37:39 -0300
Subject: [PATCH 014/117] Updated native font stack, as suggested in
https://github.com/pmarsceill/just-the-docs/issues/330#issuecomment-650415240
---
_sass/support/_variables.scss | 4 ++--
docs/ui-components/typography.md | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/_sass/support/_variables.scss b/_sass/support/_variables.scss
index bca9a71..d169eba 100644
--- a/_sass/support/_variables.scss
+++ b/_sass/support/_variables.scss
@@ -2,8 +2,8 @@
// Typography
//
-$body-font-family: -apple-system, BlinkMacSystemFont, "helvetica neue",
- "segoe ui", helvetica, roboto, noto, arial, sans-serif !default;
+$body-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
+ Roboto, "Helvetica Neue", Arial, sans-serif !default;
$mono-font-family: "SFMono-Regular", Menlo, Consolas, Monospace !default;
$root-font-size: 16px !default; // Base font-size for rems
$body-line-height: 1.4 !default;
diff --git a/docs/ui-components/typography.md b/docs/ui-components/typography.md
index 3db988c..b879c95 100644
--- a/docs/ui-components/typography.md
+++ b/docs/ui-components/typography.md
@@ -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", "segoe ui", helvetica, roboto, noto, arial, sans-serif
+system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif
```
ABCDEFGHIJKLMNOPQRSTUVWXYZ
From d90482d7194119611163f98c90e6ea1f3a560ba9 Mon Sep 17 00:00:00 2001
From: Paul DeBruicker
Date: Sun, 28 Jun 2020 14:52:15 -0700
Subject: [PATCH 015/117] put the font size variables in variables.scss and
rename the ones misnamed -mq
---
_sass/support/_variables.scss | 14 ++++++++++++++
_sass/support/mixins/_typography.scss | 18 ++----------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/_sass/support/_variables.scss b/_sass/support/_variables.scss
index 3665a36..f32c65b 100644
--- a/_sass/support/_variables.scss
+++ b/_sass/support/_variables.scss
@@ -10,6 +10,20 @@ $body-line-height: 1.4 !default;
$content-line-height: 1.6 !default;
$body-heading-line-height: 1.25 !default;
+// Font size
+$font-size-1: 9px;
+$font-size-1-sm: 10px;
+$font-size-2: 11px; //h4 - uppercased!, h6 not uppercased, text-small
+$font-size-3: 12px; //h5
+$font-size-4: 15px;
+$font-size-5: 16px; //h3
+$font-size-6: 18px; //h2
+$font-size-7: 24px;
+$font-size-8: 32px;//h1
+$font-size-9: 36px;
+$font-size-10: 42px;
+$font-size-10-sm: 48px;
+
//
// Colors
//
diff --git a/_sass/support/mixins/_typography.scss b/_sass/support/mixins/_typography.scss
index 02e5b86..62b7812 100644
--- a/_sass/support/mixins/_typography.scss
+++ b/_sass/support/mixins/_typography.scss
@@ -1,22 +1,8 @@
-// Font size
-$font-size-1: 9px;
-$font-size-1-mq: 10px;
-$font-size-2: 11px; //h4 - uppercased!, h6 not uppercased, text-small
-$font-size-3: 12px; //h5
-$font-size-4: 15px;
-$font-size-5: 16px; //h3
-$font-size-6: 18px; //h2
-$font-size-7: 24px;
-$font-size-8: 32px;//h1
-$font-size-9: 36px;
-$font-size-10: 42px;
-$font-size-10-mq: 48px;
-
@mixin fs-1 {
font-size: $font-size-1 !important;
@include mq(sm) {
- font-size: $font-size-1-mq !important;
+ font-size: $font-size-1-sm !important;
}
}
@@ -93,6 +79,6 @@ $font-size-10-mq: 48px;
line-height: $body-heading-line-height;
@include mq(sm) {
- font-size: $font-size-10-mq !important;
+ font-size: $font-size-10-sm !important;
}
}
From e8d60818ed4c78250392af3104c36ef6741486a3 Mon Sep 17 00:00:00 2001
From: Patrick Marsceill
Date: Tue, 30 Jun 2020 12:46:44 -0400
Subject: [PATCH 016/117] Update _variables.scss
---
_sass/support/_variables.scss | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/_sass/support/_variables.scss b/_sass/support/_variables.scss
index f32c65b..ff32267 100644
--- a/_sass/support/_variables.scss
+++ b/_sass/support/_variables.scss
@@ -10,19 +10,23 @@ $body-line-height: 1.4 !default;
$content-line-height: 1.6 !default;
$body-heading-line-height: 1.25 !default;
+//
// Font size
-$font-size-1: 9px;
-$font-size-1-sm: 10px;
-$font-size-2: 11px; //h4 - uppercased!, h6 not uppercased, text-small
-$font-size-3: 12px; //h5
-$font-size-4: 15px;
-$font-size-5: 16px; //h3
-$font-size-6: 18px; //h2
-$font-size-7: 24px;
-$font-size-8: 32px;//h1
-$font-size-9: 36px;
-$font-size-10: 42px;
-$font-size-10-sm: 48px;
+// `-sm` suffix is the size at the small (and above) media query
+//
+
+$font-size-1: 9px !default;
+$font-size-1-sm: 10px !default;
+$font-size-2: 11px !default; //h4 - uppercased!, h6 not uppercased, text-small
+$font-size-3: 12px !default; //h5
+$font-size-4: 15px !default;
+$font-size-5: 16px !default; //h3
+$font-size-6: 18px !default; //h2
+$font-size-7: 24px !default;
+$font-size-8: 32px !default; //h1
+$font-size-9: 36px !default;
+$font-size-10: 42px !default;
+$font-size-10-sm: 48px !default;
//
// Colors
From b41f28dadee8fe5e02b168341f4b5b46f97f0175 Mon Sep 17 00:00:00 2001
From: PLanCompS <18308236+pdmosses@users.noreply.github.com>
Date: Sat, 4 Jul 2020 19:21:49 +0200
Subject: [PATCH 017/117] Support for the linenos option on highlighted code
The added examples in `docs/index-test.md` extend the previous examplees of highlighting, documenting the required inout.
---
_includes/fix_linenos.html | 33 +++++++++++++++++++
_sass/code.scss | 67 ++++++++++++++++++++++++++++++++++++++
docs/index-test.md | 34 ++++++++++++++++++-
3 files changed, 133 insertions(+), 1 deletion(-)
create mode 100644 _includes/fix_linenos.html
diff --git a/_includes/fix_linenos.html b/_includes/fix_linenos.html
new file mode 100644
index 0000000..bf60027
--- /dev/null
+++ b/_includes/fix_linenos.html
@@ -0,0 +1,33 @@
+{% comment -%}
+Fixes the HTML for highlighted code with linenos.
+
+Derived from the workaround provided by Dmitry Hrabrov (DeXP) at
+https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
+
+Explanation:
+
+The HTML produced by Rouge with the linenos option matches CSS `code table`.
+Jekyll (<= 4.1.1) always wraps the highlighted HTML with `pre`, which is
+unnecessary and non-conforming, and leads to validation error reports.
+The fix removes the `pre` tags around `_code` whenever it contains the pattern
+`
`. This change avoids validation errors, and
+allows the use of [Jekyll layout for compressing HTML](http://jch.penibelst.de),
+which relies on `pre` tags not being nested.
+
+Usage:
+
+{% capture fix_linenos_code %}{% highlight AnyLanguage linenos %}
+Some code
+{% endhighlight %}{% endcapture %}{% include fix_linenos.html %}{{ fix_linenos_code }}
+
+Caveats:
+
+The above does not work when `Some code` happens to contain the matched string
+`
", "" %}
+{% endif %}
diff --git a/_sass/code.scss b/_sass/code.scss
index affc8aa..397f0f0 100644
--- a/_sass/code.scss
+++ b/_sass/code.scss
@@ -26,6 +26,73 @@ figure.highlight {
}
}
+// Using Liquid tags for highlighting, optionally with linenos
+//
+// See docs/index-test.md for tests
+
+// Without linenos: figure.highlight > pre > code > div > span*
+
+figure.highlight {
+ padding: 0;
+ margin-top: 0;
+ margin-bottom: $sp-3;
+ background-color: $code-background-color;
+ border-radius: $border-radius;
+ -webkit-overflow-scrolling: touch;
+
+ pre {
+ padding: $sp-3;
+ margin-top: 0;
+ margin-bottom: 0;
+ }
+}
+
+// With linenos:
+
+figure.highlight > pre > code, figure.highlight > code
+{
+
+td, td > pre {
+ @include fs-2;
+ min-width: 0;
+ padding: 0;
+ background-color: $code-background-color;
+ border-bottom: none;
+ border-left: none;
+}
+
+td.gutter {
+ padding-right: 1rem;
+}
+
+pre {
+ line-height: 2;
+ margin-top: 0;
+}
+
+tbody > tr > td {
+ border-bottom: none;
+ padding-bottom: 0;
+}
+
+}
+
+// Jekyll 4.1.1: figure.highlight > pre > code > div > table > ...
+
+figure.highlight > pre > code .table-wrapper {
+ padding: 0;
+ margin-bottom: 0;
+ box-shadow: none;
+ border: none;
+}
+
+// Using fix_linenos: figure.highlight > code > div > table > ...
+
+figure.highlight > code .table-wrapper {
+ padding: $sp-3;
+}
+
+
.highlighter-rouge {
margin-bottom: $sp-3;
}
diff --git a/docs/index-test.md b/docs/index-test.md
index 967ba6f..ec1239b 100644
--- a/docs/index-test.md
+++ b/docs/index-test.md
@@ -33,12 +33,44 @@ var fun = function lang(l) {
```
```ruby
-# Ruby code with syntax highlighting
+# Ruby code with syntax highlighting in fences
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
```
+{% highlight ruby %}
+# Ruby code with syntax highlighting using Liquid
+GitHubPages::Dependencies.gems.each do |gem, version|
+ s.add_dependency(gem, "= #{version}")
+end
+{% endhighlight %}
+
+{% capture fix_linenos_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 %}{{ fix_linenos_code }}
+
+{% comment %}
+
+The code example below requires the following setting in `_config.yml`:
+```yaml
+compress_html:
+ ignore:
+ envs: all
+```
+
+{% 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 %}
+
+{% endcomment %}
+
#### [](#header-4)Header 4
* This is an unordered list following a header.
From 7df7572d913e44b0cbbe824ff6574c5059a44a9b Mon Sep 17 00:00:00 2001
From: PLanCompS <18308236+pdmosses@users.noreply.github.com>
Date: Sat, 4 Jul 2020 21:12:00 +0200
Subject: [PATCH 018/117] Update code.scss
Correected layout, order, values.
---
_sass/code.scss | 50 ++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/_sass/code.scss b/_sass/code.scss
index 397f0f0..0d70d1a 100644
--- a/_sass/code.scss
+++ b/_sass/code.scss
@@ -43,37 +43,37 @@ figure.highlight {
pre {
padding: $sp-3;
margin-top: 0;
- margin-bottom: 0;
+ margin-bottom: 0;
}
}
-// With linenos:
+// With linenos:
-figure.highlight > pre > code, figure.highlight > code
-{
+figure.highlight > pre > code, figure.highlight > code {
-td, td > pre {
- @include fs-2;
- min-width: 0;
- padding: 0;
- background-color: $code-background-color;
- border-bottom: none;
- border-left: none;
-}
+ td,
+ td > pre {
+ @include fs-2;
+ min-width: 0;
+ padding: 0;
+ background-color: $code-background-color;
+ border-bottom: 0;
+ border-left: 0;
+ }
-td.gutter {
- padding-right: 1rem;
-}
-
-pre {
- line-height: 2;
- margin-top: 0;
-}
+ td.gutter {
+ padding-right: 1rem;
+ }
+
+ pre {
+ margin-top: 0;
+ line-height: 2;
+ }
-tbody > tr > td {
- border-bottom: none;
- padding-bottom: 0;
-}
+ tbody > tr > td {
+ padding-bottom: 0;
+ border-bottom: 0;
+ }
}
@@ -82,8 +82,8 @@ tbody > tr > td {
figure.highlight > pre > code .table-wrapper {
padding: 0;
margin-bottom: 0;
+ border: 0;
box-shadow: none;
- border: none;
}
// Using fix_linenos: figure.highlight > code > div > table > ...
From 74845b4a0ee24907b624ae993d9a912eadd758c5 Mon Sep 17 00:00:00 2001
From: PLanCompS <18308236+pdmosses@users.noreply.github.com>
Date: Sat, 4 Jul 2020 21:17:18 +0200
Subject: [PATCH 019/117] Update code.scss
Fixed more layout details. Numbers of selectors still to be fixed.
---
_sass/code.scss | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/_sass/code.scss b/_sass/code.scss
index 0d70d1a..72fa336 100644
--- a/_sass/code.scss
+++ b/_sass/code.scss
@@ -49,7 +49,8 @@ figure.highlight {
// With linenos:
-figure.highlight > pre > code, figure.highlight > code {
+figure.highlight > pre > code,
+figure.highlight > code {
td,
td > pre {
@@ -64,7 +65,7 @@ figure.highlight > pre > code, figure.highlight > code {
td.gutter {
padding-right: 1rem;
}
-
+
pre {
margin-top: 0;
line-height: 2;
@@ -74,7 +75,6 @@ figure.highlight > pre > code, figure.highlight > code {
padding-bottom: 0;
border-bottom: 0;
}
-
}
// Jekyll 4.1.1: figure.highlight > pre > code > div > table > ...
@@ -92,7 +92,6 @@ figure.highlight > code .table-wrapper {
padding: $sp-3;
}
-
.highlighter-rouge {
margin-bottom: $sp-3;
}
From fdaf5a276bab46b0006b6787e2c1137a4ed4615c Mon Sep 17 00:00:00 2001
From: PLanCompS <18308236+pdmosses@users.noreply.github.com>
Date: Mon, 6 Jul 2020 15:04:30 +0200
Subject: [PATCH 020/117] Moved tests from index-test.md to linenos-test.md
This should revert the changes made to index-test.md
---
docs/index-test.md | 34 +--------------------------
docs/linenos-test.md | 56 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+), 33 deletions(-)
create mode 100644 docs/linenos-test.md
diff --git a/docs/index-test.md b/docs/index-test.md
index ec1239b..967ba6f 100644
--- a/docs/index-test.md
+++ b/docs/index-test.md
@@ -33,44 +33,12 @@ var fun = function lang(l) {
```
```ruby
-# Ruby code with syntax highlighting in fences
+# Ruby code with syntax highlighting
GitHubPages::Dependencies.gems.each do |gem, version|
s.add_dependency(gem, "= #{version}")
end
```
-{% highlight ruby %}
-# Ruby code with syntax highlighting using Liquid
-GitHubPages::Dependencies.gems.each do |gem, version|
- s.add_dependency(gem, "= #{version}")
-end
-{% endhighlight %}
-
-{% capture fix_linenos_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 %}{{ fix_linenos_code }}
-
-{% comment %}
-
-The code example below requires the following setting in `_config.yml`:
-```yaml
-compress_html:
- ignore:
- envs: all
-```
-
-{% 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 %}
-
-{% endcomment %}
-
#### [](#header-4)Header 4
* This is an unordered list following a header.
diff --git a/docs/linenos-test.md b/docs/linenos-test.md
new file mode 100644
index 0000000..48e9603
--- /dev/null
+++ b/docs/linenos-test.md
@@ -0,0 +1,56 @@
+---
+layout: default
+title: Markdown line number test
+nav_order: 999
+---
+
+```
+Some unknown code in fences
+```
+
+Some of the code examples below require the following setting in `_config.yml`:
+```yaml
+compress_html:
+ ignore:
+ envs: all
+```
+
+```js
+// Javascript code with syntax highlighting in fences
+var fun = function lang(l) {
+ dateformat.i18n = require('./lang/' + l)
+ return true;
+}
+```
+
+```ruby
+# Ruby code with syntax highlighting in fences
+GitHubPages::Dependencies.gems.each do |gem, version|
+ s.add_dependency(gem, "= #{version}")
+end
+```
+
+{% highlight ruby %}
+# Ruby code with syntax highlighting using Liquid
+GitHubPages::Dependencies.gems.each do |gem, version|
+ s.add_dependency(gem, "= #{version}")
+end
+{% endhighlight %}
+
+{% 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 %}
+
+{% 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 %}
From b73300595b679c4b6532107b955f30c3195c0ba3 Mon Sep 17 00:00:00 2001
From: PLanCompS <18308236+pdmosses@users.noreply.github.com>
Date: Mon, 6 Jul 2020 15:07:53 +0200
Subject: [PATCH 021/117] Simplified the use of fix_linenos
Now using an include parameter.
Enhanced to support Markdown with code fences.
---
_includes/fix_linenos.html | 68 ++++++++++++++++++++++++++++----------
1 file changed, 50 insertions(+), 18 deletions(-)
diff --git a/_includes/fix_linenos.html b/_includes/fix_linenos.html
index bf60027..6243fb0 100644
--- a/_includes/fix_linenos.html
+++ b/_includes/fix_linenos.html
@@ -1,33 +1,65 @@
-{% comment -%}
-Fixes the HTML for highlighted code with linenos.
+{%- comment -%}
+This file can be used to fix the HTML produced by Jekyll for highlighted
+code with line numbers.
-Derived from the workaround provided by Dmitry Hrabrov (DeXP) at
+It works with `{% highlight some_language linenos %}...{% endhighlight %}`
+and with the Kramdown option to add line numbers to fenced code.
+
+The implementation was derived from the workaround provided by
+Dmitry Hrabrov (DeXP) at
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
-Explanation:
+EXPLANATION
-The HTML produced by Rouge with the linenos option matches CSS `code table`.
-Jekyll (<= 4.1.1) always wraps the highlighted HTML with `pre`, which is
-unnecessary and non-conforming, and leads to validation error reports.
-The fix removes the `pre` tags around `_code` whenever it contains the pattern
-`
`. This change avoids validation errors, and
-allows the use of [Jekyll layout for compressing HTML](http://jch.penibelst.de),
-which relies on `pre` tags not being nested.
+The HTML produced by Rouge highlighting with lie numbers is of the form
+`code table`. Jekyll (<= 4.1.1) always wraps the highlighted HTML
+with `pre`. This wrapping is not only unnecessary, but also transforms
+the conforming HTML produced by Rouge to non-conforming HTML, which
+results in HTML validation error reports.
-Usage:
+The fix removes the outer `pre` tags whenever they contain the pattern
+`
`.
+
+Apart from avoiding HTML validation errors, the fix allows the use of
+the [Jekyll layout for compressing HTML](http://jch.penibelst.de),
+which relies on `pre` tags not being nested, according to
+https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-172069842
-{% capture fix_linenos_code %}{% highlight AnyLanguage linenos %}
+USAGE
+
+(Any names can be used for `some_var` and `some_language`.)
+
+{% capture some_var %}
+{% highlight some_language linenos %}
Some code
-{% endhighlight %}{% endcapture %}{% include fix_linenos.html %}{{ fix_linenos_code }}
+{% endhighlight %}
+{% endcapture %}
+{% include fix_linenos.html code=some_var %}
-Caveats:
+For code fences:
+
+{% capture some_var %}
+```some_language
+Some code
+```
+{% endcapture %}
+{% assign some_var = some_var | markdownify %}
+{% include fix_linenos.html code=some_var %}
+
+CAVEATS
The above does not work when `Some code` happens to contain the matched string
`
`.
-{%- endcomment %}
+The use of this file overwrites the variable `fix_linenos_code` with `nil`.
+{%- endcomment -%}
+
+{% assign fix_linenos_code = include.code %}
{% if fix_linenos_code contains '