From 6cc91f918780409b855f5072bd2efa65ca405ffd Mon Sep 17 00:00:00 2001 From: Marcin S <marcin@bytedude.com> Date: Tue, 8 Nov 2022 08:06:02 -0500 Subject: [PATCH] Add a `last change` footer to the implementers guide (#6216) * Add a `last change` footer to the implementers guide Some of the newcomers were noticing outdated pages in the implementer's guide. This idea came up as a heuristic for how up-to-date an individual page is. * Update `build-implementers-guide` CI job --- polkadot/roadmap/implementers-guide/README.md | 7 ++++--- polkadot/roadmap/implementers-guide/book.toml | 6 ++++++ polkadot/roadmap/implementers-guide/last-changed.css | 7 +++++++ polkadot/scripts/ci/gitlab/pipeline/build.yml | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 polkadot/roadmap/implementers-guide/last-changed.css diff --git a/polkadot/roadmap/implementers-guide/README.md b/polkadot/roadmap/implementers-guide/README.md index 1775fb44d87..7f3f8cef7e6 100644 --- a/polkadot/roadmap/implementers-guide/README.md +++ b/polkadot/roadmap/implementers-guide/README.md @@ -4,13 +4,14 @@ The implementers' guide is compiled from several source files with [`mdBook`](ht ## Hosted build -This is avalible at https://paritytech.github.io/polkadot/book/ +This is available [here](https://paritytech.github.io/polkadot/book/). ## Local build To view it locally from the repo root: Ensure graphviz is installed: + ```sh brew install graphviz # for macOS sudo apt-get install graphviz # for Ubuntu/Debian @@ -19,11 +20,11 @@ sudo apt-get install graphviz # for Ubuntu/Debian Then install and build the book: ```sh -cargo install mdbook mdbook-linkcheck mdbook-graphviz mdbook-mermaid +cargo install mdbook mdbook-linkcheck mdbook-graphviz mdbook-mermaid mdbook-last-changed mdbook serve roadmap/implementers-guide open http://localhost:3000 ``` ## Specification -See also the Polkadot specificaton [hosted](https://spec.polkadot.network/), and it's [source](https://github.com/w3f/polkadot-spec)). +See also the Polkadot specification [hosted](https://spec.polkadot.network/), and its [source](https://github.com/w3f/polkadot-spec). diff --git a/polkadot/roadmap/implementers-guide/book.toml b/polkadot/roadmap/implementers-guide/book.toml index 8805ca4c38c..0ced0e26f9a 100644 --- a/polkadot/roadmap/implementers-guide/book.toml +++ b/polkadot/roadmap/implementers-guide/book.toml @@ -9,8 +9,14 @@ title = "The Polkadot Parachain Host Implementers' Guide" command = "mdbook-graphviz" [preprocessor.mermaid] command = "mdbook-mermaid" +[preprocessor.last-changed] +command = "mdbook-last-changed" +renderer = ["html"] [output.html] +additional-css = ["last-changed.css"] additional-js = ["mermaid.min.js", "mermaid-init.js"] +# Repository URL used in the last-changed link. +git-repository-url = "https://github.com/paritytech/polkadot" [output.linkcheck] diff --git a/polkadot/roadmap/implementers-guide/last-changed.css b/polkadot/roadmap/implementers-guide/last-changed.css new file mode 100644 index 00000000000..744dc6efc7e --- /dev/null +++ b/polkadot/roadmap/implementers-guide/last-changed.css @@ -0,0 +1,7 @@ +footer { + font-size: 0.8em; + text-align: center; + margin-top: 50px; + border-top: 1px solid black; + padding: 5px 0; +} diff --git a/polkadot/scripts/ci/gitlab/pipeline/build.yml b/polkadot/scripts/ci/gitlab/pipeline/build.yml index 791b01c2b63..c6fe5916c3b 100644 --- a/polkadot/scripts/ci/gitlab/pipeline/build.yml +++ b/polkadot/scripts/ci/gitlab/pipeline/build.yml @@ -170,7 +170,7 @@ build-implementers-guide: - .collect-artifacts-short script: - apt-get -y update; apt-get install -y graphviz - - cargo install mdbook mdbook-mermaid mdbook-linkcheck mdbook-graphviz + - cargo install mdbook mdbook-mermaid mdbook-linkcheck mdbook-graphviz mdbook-last-changed - mdbook build ./roadmap/implementers-guide - mkdir -p artifacts - mv roadmap/implementers-guide/book artifacts/ -- GitLab