diff --git a/404.html b/404.html
index 1e7a37e..5fde966 100644
--- a/404.html
+++ b/404.html
@@ -1,6 +1,6 @@
---
layout: default
-title: Page not found
+title: 404
permalink: /404
nav_exclude: true
search_exclude: true
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..5f0ddae
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,13 @@
+FROM ruby:2.6
+
+ENV LC_ALL C.UTF-8
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US.UTF-8
+
+WORKDIR /usr/src/app
+
+COPY Gemfile just-the-docs.gemspec ./
+RUN gem install bundler && bundle install
+
+EXPOSE 4000
+
diff --git a/README.md b/README.md
index 90dfb6f..4d1c1e8 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,10 @@ Or install it yourself as:
$ gem install just-the-docs
+Alternatively, you can run it inside Docker while developing your site
+
+ $ docker-compose up
+
## Usage
[View the documentation](https://pmarsceill.github.io/just-the-docs/) for usage information.
diff --git a/_config.yml b/_config.yml
index 20bf8a1..ad42809 100644
--- a/_config.yml
+++ b/_config.yml
@@ -19,7 +19,15 @@ baseurl: "/just-the-docs" # the subpath of your site, e.g. /blog
url: "https://pmarsceill.github.io" # the base hostname & protocol for your site, e.g. http://example.com
permalink: pretty
-exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"]
+exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"
+, "docs/tests/"
+]
+
+# Regression tests
+# By default, the pages in /docs/tests are excluded when the ste is built.
+# To include them, comment-out the relevant line above.
+# Uncommenting the following line doesn't work - see https://github.com/jekyll/jekyll/issues/4791
+# include: ["docs/tests/"]
# Set a path/url to a logo that will be displayed instead of the title
#logo: "/assets/images/just-the-docs.png"
@@ -33,13 +41,13 @@ search:
heading_level: 2
# Maximum amount of previews per search result
# Default: 3
- previews: 3
+ previews: 2
# Maximum amount of words to display before a matched word in the preview
# Default: 5
- preview_words_before: 5
+ preview_words_before: 3
# Maximum amount of words to display after a matched word in the preview
# Default: 10
- preview_words_after: 10
+ preview_words_after: 3
# Set the search token separator
# Default: /[\s\-/]+/
# Example: enable support for hyphenated search words
@@ -63,8 +71,8 @@ aux_links:
aux_links_new_tab: false
# Sort order for navigation links
-nav_sort: case_insensitive # default, equivalent to nil
-# nav_sort: case_sensitive # Capital letters sorted before lowercase
+# nav_sort: case_insensitive # default, equivalent to nil
+nav_sort: case_sensitive # Capital letters sorted before lowercase
# Footer content
# appears at the bottom of every page's main content
@@ -86,6 +94,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
# Color scheme currently only supports "dark", "light"/nil (default), or a custom scheme that you define
@@ -99,6 +108,11 @@ ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (t
plugins:
- jekyll-seo-tag
+kramdown:
+ syntax_highlighter_opts:
+ block:
+ line_numbers: false
+
compress_html:
clippings: all
comments: all
@@ -106,3 +120,5 @@ compress_html:
startings: []
blanklines: false
profile: false
+ # ignore:
+ # envs: all
diff --git a/_includes/fix_linenos.html b/_includes/fix_linenos.html
new file mode 100644
index 0000000..6243fb0
--- /dev/null
+++ b/_includes/fix_linenos.html
@@ -0,0 +1,65 @@
+{%- comment -%}
+This file can be used to fix the HTML produced by Jekyll for highlighted
+code with line numbers.
+
+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
+
+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.
+
+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
+
+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 code=some_var %}
+
+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
+`
`.
+
+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 '