From 33b9e5800c48d2a997801ace934034254ca6ddb4 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Mon, 11 Jul 2022 20:15:05 +0200 Subject: [PATCH 01/33] remove draft file --- book/tocexample/draft.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 book/tocexample/draft.md diff --git a/book/tocexample/draft.md b/book/tocexample/draft.md deleted file mode 100644 index 0686950..0000000 --- a/book/tocexample/draft.md +++ /dev/null @@ -1 +0,0 @@ -# Draft chapter \ No newline at end of file From eb46075987d01a7afd83f7e9039bab0e1f309e28 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Mon, 11 Jul 2022 20:15:16 +0200 Subject: [PATCH 02/33] update requirements to nimib 0.3.0 --- nimibook.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimibook.nimble b/nimibook.nimble index 1655184..76bc57f 100644 --- a/nimibook.nimble +++ b/nimibook.nimble @@ -10,7 +10,7 @@ srcDir = "src" # Dependencies requires "nim >= 1.4.0" -requires "nimib#head" +requires "nimib >= 0.3.0" requires "jsony >= 1.0.3" requires "toml_serialization >= 0.2.0" From cef2b20e648de6cfe907e77df2a3307a62bc63e6 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Mon, 11 Jul 2022 20:27:35 +0200 Subject: [PATCH 03/33] quote mdbook description (and test deploy preview) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index caf1bcf..993704e 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ Nimibook allows to create a nice looking book from nim code and markdown, making sure that nim code is running correctly and being able to incorporate code outputs in the final book. An example book is [nimibook documentation][nimibook] itself. -[mdBook] is a command line tool and Rust crate to create books -using Markdown (as by the CommonMark specification) files. -It's very similar to [Gitbook], which is a command line tool (and Node.js library) -for building beautiful books using GitHub/Git and Markdown (or AsciiDoc). +> [mdBook] is a command line tool and Rust crate to create books +> using Markdown (as by the CommonMark specification) files. +> It's very similar to [Gitbook], which is a command line tool (and Node.js library) +> for building beautiful books using GitHub/Git and Markdown (or AsciiDoc). [nimib] is a Nim library to convert your Nim code and its outputs to html documents. The html output can be easily customized thanks to [nim-mustache], From 53bd5e5bb88110b1272af236301a8f59033f80b3 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Tue, 12 Jul 2022 13:26:38 +0200 Subject: [PATCH 04/33] changelog v0.1 --- changelog.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 changelog.md diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..14629ab --- /dev/null +++ b/changelog.md @@ -0,0 +1,30 @@ +# Changelog + +## v0.2.0 (November 2021) + +No official tagged release of 0.1, making 0.2 the first official release of nimibook. + +* nimibook 0.2 is based of nimib 0.2 (the "Theme Maker" release), which makes available the `nb` global object + that simplifies creation of themes. +* nimibook is started as a port of [mdbook](https://rust-lang.github.io/mdBook/index.html) to nim and as such it is based off mdbook templates + and replicates mdbook features. Among these features are: + - book format with a foldable table of contents on the side + - multiple themes (Light, Rust, Coal, Navy, Ayu) + - book page can be created from markdown + - link to github repo +* nimibook is also specific for nim and it diverges from mdbook in these details: + - a book page can be created using nimib with `nbInit(theme = useNimibook)` + - the command to manage the book must be customized, compiled and run in the book project (no universal `nimibook` binary for now) + - the toc is specificied inside the binary used to build the book +* nimibook thus provides library features to build your book building features and in particular it provides: + - a `useNimibook` theme to use in nimib documents + - a `newBookFromToc` DSL to create a table of contents which supports, section (a chapter that opens indented chapters), entry (a standard numbered entry), draft (a placeholder for non existent entry) + - a `nimibookCli` template to create a CLI that supports the following commands: + + `init`: to initialize a book with structure and assets (mustache templates, css styles, javascript, fonts) + + `update`: to update assets in case they change + + `build`: builds the book by rendering all toc entries + + `clean`: removes all files generated from a build command + + `dump`: creates and dumps a `book.json` object that contains table of contents and all the shared data that is needed to build a single page with nimib +* you can still use standard nim with `nim r book/entry.nim` to build a single page, provided that you have dumped a `book.json` +* being based on nimib 0.2, nimibook requires the existence of a `nimib.toml` configuration file where a `srcDir` (folder with sources for entries) + and a `homeDir` (folder where the book will be built) are defined \ No newline at end of file From 45ebe569180bd818d53d10bcc6dc0b67a6d7f071 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Tue, 12 Jul 2022 13:26:44 +0200 Subject: [PATCH 05/33] changelog v0.1 --- changelog.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 14629ab..dcf428a 100644 --- a/changelog.md +++ b/changelog.md @@ -18,7 +18,8 @@ No official tagged release of 0.1, making 0.2 the first official release of nimi - the toc is specificied inside the binary used to build the book * nimibook thus provides library features to build your book building features and in particular it provides: - a `useNimibook` theme to use in nimib documents - - a `newBookFromToc` DSL to create a table of contents which supports, section (a chapter that opens indented chapters), entry (a standard numbered entry), draft (a placeholder for non existent entry) + - a `newBookFromToc` DSL to create a table of contents that supports `section` (a chapter that opens indented chapters), + `entry` (a standard numbered entry), `draft` (a placeholder for non existent entry) - a `nimibookCli` template to create a CLI that supports the following commands: + `init`: to initialize a book with structure and assets (mustache templates, css styles, javascript, fonts) + `update`: to update assets in case they change @@ -27,4 +28,13 @@ No official tagged release of 0.1, making 0.2 the first official release of nimi + `dump`: creates and dumps a `book.json` object that contains table of contents and all the shared data that is needed to build a single page with nimib * you can still use standard nim with `nim r book/entry.nim` to build a single page, provided that you have dumped a `book.json` * being based on nimib 0.2, nimibook requires the existence of a `nimib.toml` configuration file where a `srcDir` (folder with sources for entries) - and a `homeDir` (folder where the book will be built) are defined \ No newline at end of file + and a `homeDir` (folder where the book will be built) are defined + +## v0.1 (May-June 2021) + +The main driving force for the development of nimibook since the beginning has been to support [scinim/getting-started](https://github.com/SciNim/getting-started) +a collection of tutorials to use Nim for Scientific Computing. +The initial idea of using nimib for SciNim came from @HugoGranstrom in +scinim/getting-started's [first issue](https://github.com/SciNim/getting-started/issues/1#issuecomment-837266835) (May 2021), +the idea was then further discussed in a [nimib's issue](https://github.com/pietroppeter/nimib/issues/40). +After an initial proof of concept by @pietroppeter, most of the development during 0.1 was done by @Clonkk. \ No newline at end of file From 0b81ceaa580b187f0bb84d3300507e77a4ceb8ce Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Tue, 12 Jul 2022 13:28:46 +0200 Subject: [PATCH 06/33] changelog v0.2.1 --- changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index dcf428a..f192133 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## v0.2.1 (November 2021) + +* bugfix release to fix path handling (see #42), linked to equivalent bugfix release in nimib 0.2.1 + ## v0.2.0 (November 2021) No official tagged release of 0.1, making 0.2 the first official release of nimibook. From 0de3a22bfcdb8cfe1a977a7cfa941640f11b289e Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Tue, 12 Jul 2022 13:39:30 +0200 Subject: [PATCH 07/33] changelog v0.1 - add link to mdbook release --- changelog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index f192133..3107bd2 100644 --- a/changelog.md +++ b/changelog.md @@ -41,4 +41,7 @@ a collection of tutorials to use Nim for Scientific Computing. The initial idea of using nimib for SciNim came from @HugoGranstrom in scinim/getting-started's [first issue](https://github.com/SciNim/getting-started/issues/1#issuecomment-837266835) (May 2021), the idea was then further discussed in a [nimib's issue](https://github.com/pietroppeter/nimib/issues/40). -After an initial proof of concept by @pietroppeter, most of the development during 0.1 was done by @Clonkk. \ No newline at end of file +After an initial proof of concept by @pietroppeter, most of the development during 0.1 was done by @Clonkk. + +The version of mdbook on which nimibook is based is likely [mdbook v0.4.8](https://github.com/rust-lang/mdBook/tree/v0.4.8) released in May 2021 +(this is deduced from when the initial development started). \ No newline at end of file From 5fa2cf64afba37c864a2a87e558af10392a7f102 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Tue, 12 Jul 2022 13:41:16 +0200 Subject: [PATCH 08/33] update changelog v0.2.0 --- changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog.md b/changelog.md index 3107bd2..be9a09c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## v0.3.0 (July 2022) + + + ## v0.2.1 (November 2021) * bugfix release to fix path handling (see #42), linked to equivalent bugfix release in nimib 0.2.1 @@ -16,6 +20,7 @@ No official tagged release of 0.1, making 0.2 the first official release of nimi - multiple themes (Light, Rust, Coal, Navy, Ayu) - book page can be created from markdown - link to github repo + - next/previous page buttons * nimibook is also specific for nim and it diverges from mdbook in these details: - a book page can be created using nimib with `nbInit(theme = useNimibook)` - the command to manage the book must be customized, compiled and run in the book project (no universal `nimibook` binary for now) From 5a43a425bd331252ab01de84452aadd81c4a6107 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Tue, 12 Jul 2022 16:05:01 +0200 Subject: [PATCH 09/33] changelog v0.3 wip --- changelog.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index be9a09c..592d140 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,17 @@ ## v0.3.0 (July 2022) - +* update to use nimib 0.3 and maintenance (#50): + - fix usage of `blocks` context in `document` template update to reflect change in nimib 0.3 + - templates folder changed to `srcDir / templates` + - ... +* fix next/previous buttons when there is a draft chapter (see [commit 428e482](https://github.com/pietroppeter/nimibook/commit/428e482ac7b86e4f12c5ca8c79e419cb47250ea7)) +* add latex support using katex (activated with `nb.useLatex` as in standard nimib), see #52 +* made building happen async and in multiple process (see #53): + - this improves the speed of building nimibook + - in case there is an error when building a specific entry a `.log` file is created next to the entry which contains the log of failure +* add deploy previews through netlify (#55) +* improve documentation to track recent changes and add a changelog (#56) ## v0.2.1 (November 2021) @@ -30,9 +40,11 @@ No official tagged release of 0.1, making 0.2 the first official release of nimi - a `newBookFromToc` DSL to create a table of contents that supports `section` (a chapter that opens indented chapters), `entry` (a standard numbered entry), `draft` (a placeholder for non existent entry) - a `nimibookCli` template to create a CLI that supports the following commands: + + `help`: prints help and all available commands + `init`: to initialize a book with structure and assets (mustache templates, css styles, javascript, fonts) + `update`: to update assets in case they change + `build`: builds the book by rendering all toc entries + + `check`: checks that all entries that are supposed to be built have been created + `clean`: removes all files generated from a build command + `dump`: creates and dumps a `book.json` object that contains table of contents and all the shared data that is needed to build a single page with nimib * you can still use standard nim with `nim r book/entry.nim` to build a single page, provided that you have dumped a `book.json` From 6b8a35d20ceec47de69094778b6045e1f3e0326d Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Thu, 26 Jan 2023 19:49:56 +0100 Subject: [PATCH 10/33] update to latest nimib (also to run again CI) --- nimibook.nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimibook.nimble b/nimibook.nimble index 76bc57f..a345b09 100644 --- a/nimibook.nimble +++ b/nimibook.nimble @@ -10,7 +10,7 @@ srcDir = "src" # Dependencies requires "nim >= 1.4.0" -requires "nimib >= 0.3.0" +requires "nimib >= 0.3.4" requires "jsony >= 1.0.3" requires "toml_serialization >= 0.2.0" From 6d3d88e63f7c9ecd1641ba98989eb94a13418f6a Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Thu, 26 Jan 2023 20:03:55 +0100 Subject: [PATCH 11/33] add list of sites using nimibook --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 993704e..4959f11 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,14 @@ _nimib documents_ are normal nim files which use nimib library to produce an out The Markdown dialect supported by both nimib and nimibook is the subset of [Github Flavored Markdown][GFM] provided by [nim-markdown]. For a quick reference of supported syntax see the [cheatsheet]. -### Status +## Status and sites using nimibook -nimibook currently provides minimal functionality to create a book and support a local CLI mode. +nimibook currently provides the minimal functionality needed to create a book and support a local CLI mode. +This functionality proved enough to be used for the following projects: + +- [scinim/getting-started](https://scinim.github.io/getting-started/) +- [moigagoo/norm](https://norm.nim.town) +- [PhilippMDoerner/Snorlogue](https://philippmdoerner.github.io/Snorlogue/bookCompiled/) ## Installation @@ -78,7 +83,12 @@ If `book.json` is present, then you can build your page with: `nim r book/mypage * `./nbook update` will update assets and mustache template. * These two commands will modify installed files, use them with caution if you customized files locally. -### Analytics +## Contribute + + + + +## Analytics This website is tracking analytics with [plausible.io](https://plausible.io/index.html), a lightweight and open-source website analytics tool with no cookies and fully compliant with GDPR, CCPA and PECR. Analytics for this website are publicly available [here](https://plausible.io/pietroppeter.github.io%2Fnimibook). You can opt out from analytics tracking with [standard ad-blocking](https://plausible.io/docs/excluding) or typing [`localStorage.plausible_ignore=true`](https://plausible.io/docs/excluding-localstorage) in browser console. From 80c2483ee821066698c6415ce82191e0ec0c88f1 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Thu, 26 Jan 2023 20:15:58 +0100 Subject: [PATCH 12/33] rename task chapter to nimble tasks --- book/tasks.nim | 5 ++++- nbook.nim | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/book/tasks.nim b/book/tasks.nim index c6b188c..21f636a 100644 --- a/book/tasks.nim +++ b/book/tasks.nim @@ -12,7 +12,10 @@ let taskList = collect(newSeq): "* `nimble " & line.replace(" ", "`: ") nbText: fmt""" -# Tasks +# Nimble tasks + +The following are the nimble tasks that can be used +when developing the project: {taskList.join("\n")} """ diff --git a/nbook.nim b/nbook.nim index bc1765e..76069f6 100644 --- a/nbook.nim +++ b/nbook.nim @@ -5,7 +5,7 @@ var book = initBookWithToc: entry("Content", "content") entry("Toc DSL", "tocdsl") entry("Configuration", "configuration") - entry("Tasks", "tasks") + entry("Nimble tasks", "tasks") entry("Latex", "latex") section("Example toc structure", "tocexample/index.md"): section("Nested section", "nested.md"): From 49dc87fef4dc4b0e0b276babeb407243c977951f Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Thu, 26 Jan 2023 20:28:29 +0100 Subject: [PATCH 13/33] add contribute section --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4959f11..5d154e4 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,13 @@ This functionality proved enough to be used for the following projects: - [moigagoo/norm](https://norm.nim.town) - [PhilippMDoerner/Snorlogue](https://philippmdoerner.github.io/Snorlogue/bookCompiled/) +To follow up on recent changes check the [changelog.md](changelog.md) + ## Installation To install Nimibook simply use : `nimble install nimibook` -## Usage +## How to setup your book with nimibook 1. Write your content using [nimib] or simple markdown files in the `book` folder. The basic template for an empty page is: @@ -85,8 +87,15 @@ If `book.json` is present, then you can build your page with: `nim r book/mypage ## Contribute - - +You are more than welcome to contribute! +We usually have some open issues of stuff we need to fix or we would like to do. +You have an overview of the code base in [src/readme.md](src/readme.md) +The CI is setup to run tests and publish a document PR preview +(click on details on the Netlify preview task once it's green), +so that we can all check the changes from PR. +You should also test and build the book locally, there are nimble tasks +to help with that. +Once you make a change, remember to update the [changelog](changelog.md)! ## Analytics From 6d78f7656f11e9482978c9ba5a73508ec0743ef4 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Thu, 26 Jan 2023 20:30:27 +0100 Subject: [PATCH 14/33] fix contribute section --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d154e4..f7da1f0 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,9 @@ The CI is setup to run tests and publish a document PR preview so that we can all check the changes from PR. You should also test and build the book locally, there are nimble tasks to help with that. -Once you make a change, remember to update the [changelog](changelog.md)! +Once you make a change, remember to document your changes somewhere appropriate +and to update the [changelog](changelog.md) +(and if needed also the [src/readme.md](src/readme.md))! ## Analytics From f4e7af29468c983542162c24e7167031beb1bc2b Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sat, 28 Jan 2023 16:39:26 +0100 Subject: [PATCH 15/33] wip update readme and changelog --- README.md | 25 ++++++++++++++++++++++++- changelog.md | 4 +++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7da1f0..d6aaba7 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,28 @@ To install Nimibook simply use : `nimble install nimibook` ## How to setup your book with nimibook +nimibook does not ([yet](https://github.com/pietroppeter/nimibook/issues/63)) provides an executable to manage your book, but it provides the basic building blocks to write your own. + +1. Start from an empty folder and create a `nbook.nim` + file +(you can pick a different name from `nbook`) with the +following content: + +```nim +import nimibook +var book = initBook() +nimibookCli(book) +``` + +2. then compile and run `nbook` (e.g. `nim r nbook`). +you will see an help printed with the available commands + +3. run `nbook init` (or `nim r nbook init`). +This will create a `nimib.toml` file that contains the +minimal configuration for your book. In case you already have a `nimib.toml` file in the folder, do not worry, +it will not be overwritten but nimibook configuration will +not be added. + 1. Write your content using [nimib] or simple markdown files in the `book` folder. The basic template for an empty page is: ```nim @@ -92,9 +114,10 @@ We usually have some open issues of stuff we need to fix or we would like to do. You have an overview of the code base in [src/readme.md](src/readme.md) The CI is setup to run tests and publish a document PR preview (click on details on the Netlify preview task once it's green), -so that we can all check the changes from PR. +so that we can all check the changes directly from the PR. You should also test and build the book locally, there are nimble tasks to help with that. +If the feature can be tested with a unit test, make sure to add one. Once you make a change, remember to document your changes somewhere appropriate and to update the [changelog](changelog.md) (and if needed also the [src/readme.md](src/readme.md))! diff --git a/changelog.md b/changelog.md index 592d140..6d583ea 100644 --- a/changelog.md +++ b/changelog.md @@ -4,8 +4,10 @@ * update to use nimib 0.3 and maintenance (#50): - fix usage of `blocks` context in `document` template update to reflect change in nimib 0.3 - - templates folder changed to `srcDir / templates` + - `nimib.toml` now supports configuration for the book, + no need anymore to specify the configuration inside a nbook.nim file - ... + - templates folder changed to `srcDir / templates` * fix next/previous buttons when there is a draft chapter (see [commit 428e482](https://github.com/pietroppeter/nimibook/commit/428e482ac7b86e4f12c5ca8c79e419cb47250ea7)) * add latex support using katex (activated with `nb.useLatex` as in standard nimib), see #52 * made building happen async and in multiple process (see #53): From b3dcc53ac64a5278816f006728093b409f7c0508 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 29 Jan 2023 10:24:57 +0100 Subject: [PATCH 16/33] update changelog #61 --- changelog.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 6d583ea..0caab1f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,13 @@ # Changelog -## v0.3.0 (July 2022) +## v0.3.0 (Febraury 2023) +* Parallel build fixes (#61) + * Fixed parallel build so it uses the correct folder for saving log files. + * The error messages are printed to terminal as well + * Pass compiler flag `-d:nimibParallelBuild=false` to compile in serial. + * Pass `-d:nimibMaxProcesses=n` to run at most `n` builds in parallel at a time. +* The next-arrow is shown correctly on the second to last page. (#61) * update to use nimib 0.3 and maintenance (#50): - fix usage of `blocks` context in `document` template update to reflect change in nimib 0.3 - `nimib.toml` now supports configuration for the book, From d30a4b2a32a4d0f821c9a0b2f99a9dd0c4a7d672 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 07:22:46 +0100 Subject: [PATCH 17/33] fix typo --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 0caab1f..fc3fb14 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # Changelog -## v0.3.0 (Febraury 2023) +## v0.3.0 (February 2023) * Parallel build fixes (#61) * Fixed parallel build so it uses the correct folder for saving log files. From a7730e25bc56e923ca148fef5d341018730a365b Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 13:48:03 +0100 Subject: [PATCH 18/33] remove rs file --- src/nimibook/assets/fonts/mod.rs | 61 -------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/nimibook/assets/fonts/mod.rs diff --git a/src/nimibook/assets/fonts/mod.rs b/src/nimibook/assets/fonts/mod.rs deleted file mode 100644 index 5d2e29c..0000000 --- a/src/nimibook/assets/fonts/mod.rs +++ /dev/null @@ -1,61 +0,0 @@ -pub static CSS: &[u8] = include_bytes!("fonts.css"); -// An array of (file_name, file_contents) pairs -pub static LICENSES: [(&str, &[u8]); 2] = [ - ( - "fonts/OPEN-SANS-LICENSE.txt", - include_bytes!("OPEN-SANS-LICENSE.txt"), - ), - ( - "fonts/SOURCE-CODE-PRO-LICENSE.txt", - include_bytes!("SOURCE-CODE-PRO-LICENSE.txt"), - ), -]; -// An array of (file_name, file_contents) pairs -pub static OPEN_SANS: [(&str, &[u8]); 10] = [ - ( - "fonts/open-sans-v17-all-charsets-300.woff2", - include_bytes!("open-sans-v17-all-charsets-300.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-300italic.woff2", - include_bytes!("open-sans-v17-all-charsets-300italic.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-regular.woff2", - include_bytes!("open-sans-v17-all-charsets-regular.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-italic.woff2", - include_bytes!("open-sans-v17-all-charsets-italic.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-600.woff2", - include_bytes!("open-sans-v17-all-charsets-600.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-600italic.woff2", - include_bytes!("open-sans-v17-all-charsets-600italic.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-700.woff2", - include_bytes!("open-sans-v17-all-charsets-700.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-700italic.woff2", - include_bytes!("open-sans-v17-all-charsets-700italic.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-800.woff2", - include_bytes!("open-sans-v17-all-charsets-800.woff2"), - ), - ( - "fonts/open-sans-v17-all-charsets-800italic.woff2", - include_bytes!("open-sans-v17-all-charsets-800italic.woff2"), - ), -]; - -// A (file_name, file_contents) pair -pub static SOURCE_CODE_PRO: (&str, &[u8]) = ( - "fonts/source-code-pro-v11-all-charsets-500.woff2", - include_bytes!("source-code-pro-v11-all-charsets-500.woff2"), -); From 4ff5cb59662874ea8e4507607d7ecfb0d48931e4 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 14:51:02 +0100 Subject: [PATCH 19/33] completed improve of readme --- README.md | 168 +++++++++++++++++++++++---------------------------- changelog.md | 4 +- 2 files changed, 77 insertions(+), 95 deletions(-) diff --git a/README.md b/README.md index d6aaba7..9a3acc4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **nimibook** is a port of [mdbook] to [Nim], powered by [nimib]. Nimibook allows to create a nice looking book from nim code and markdown, making sure that nim code is running correctly and being able to incorporate code outputs in the final book. -An example book is [nimibook documentation][nimibook] itself. +An example book is [nimibook] documentation. > [mdBook] is a command line tool and Rust crate to create books > using Markdown (as by the CommonMark specification) files. @@ -15,132 +15,114 @@ The html output can be easily customized thanks to [nim-mustache], and this is what allows it to use it to build nimibook. _nimib documents_ are normal nim files which use nimib library to produce an output document. +One particular advantage of nimib is that it can incorporate interactive content +taking advantage of nim's js backend. +For the basic examples see +[nimib interactivity doc](https://pietroppeter.github.io/nimib/interactivity.html). + The Markdown dialect supported by both nimib and nimibook is the subset of [Github Flavored Markdown][GFM] -provided by [nim-markdown]. For a quick reference of supported syntax see the [cheatsheet]. +provided by [nim-markdown]. For a quick reference of supported syntax see this [cheatsheet] (created with nimib). + + +[mdbook]: https://rust-lang.github.io/mdBook/index.html +[Nim]: https://nim-lang.org/ +[nimib]: https://pietroppeter.github.io/nimib/ +[Gitbook]: https://github.com/GitbookIO/gitbook +[nim-mustache]: https://github.com/soasme/nim-mustache +[nimibook]: https://pietroppeter.github.io/nimibook/ +[GFM]: https://github.github.com/gfm/ +[nim-markdown]: https://github.com/soasme/nim-markdown +[cheasheet]: https://pietroppeter.github.io/nimib/cheatsheet.html -## Status and sites using nimibook +## Status -nimibook currently provides the minimal functionality needed to create a book and support a local CLI mode. -This functionality proved enough to be used for the following projects: +Nimibook is actively maintained ([target issues for 2023](https://github.com/pietroppeter/nimibook/issues?q=is%3Aopen+is%3Aissue+label%3A2023H1%2C2023H2)) +and it provides the basic functionality +needed to create a book with markdown and nimib sources. +It still has some features missing from mdbook +(see [this issue](https://github.com/pietroppeter/nimibook/issues/9#issuecomment-851989939)). + +To follow up on recent changes check the [changelog.md](changelog.md). + +## Example sites using nimibook - [scinim/getting-started](https://scinim.github.io/getting-started/) - [moigagoo/norm](https://norm.nim.town) - [PhilippMDoerner/Snorlogue](https://philippmdoerner.github.io/Snorlogue/bookCompiled/) -To follow up on recent changes check the [changelog.md](changelog.md) +You are welcome to open a PR and add your site using nimibook here. + +## Features + +- table of contents in a collapsible sidebar +- five themes (Light, Rust, Coal, Navy, Ayu) +- buttons to next/previous pages +- build multiple files in parallel +- (optional) latex content with katex +- (optional) link to github repo +- (optional) link to track analytics with plausible analytics ## Installation -To install Nimibook simply use : `nimble install nimibook` +To install Nimibook: `nimble install nimibook` ## How to setup your book with nimibook -nimibook does not ([yet](https://github.com/pietroppeter/nimibook/issues/63)) provides an executable to manage your book, but it provides the basic building blocks to write your own. +Nimibook does not ([yet](https://github.com/pietroppeter/nimibook/issues/63)) provides an executable to manage your book, but it provides the basic building blocks to write your own. -1. Start from an empty folder and create a `nbook.nim` - file +**1. example nbook.nim**: start from a (not necessarily) empty folder and create a `nbook.nim` file (you can pick a different name from `nbook`) with the following content: ```nim import nimibook -var book = initBook() + +var book = initBookWithToc: + entry("Preface", "preface.md", numbered = false) + entry("Introduction", "intro.md") + section("Chapter 1", "chapter1/index.nim"): + entry("Content", "content.nim") + draft("Nothing yet") + section("Sub chapter", "no_ext"): + entry("and some more content", "more.md") + nimibookCli(book) ``` -2. then compile and run `nbook` (e.g. `nim r nbook`). -you will see an help printed with the available commands +**2. write a TOC**: modify `nbook.nim` to specify +the planned Table of Content (TOC) for your book. -3. run `nbook init` (or `nim r nbook init`). -This will create a `nimib.toml` file that contains the -minimal configuration for your book. In case you already have a `nimib.toml` file in the folder, do not worry, -it will not be overwritten but nimibook configuration will -not be added. +**3. nbook init**: running `nim r nbook init` (or compile `nbook` and run `nbook init`) will set up the book with: +- a `nimib.toml` that contains the default configuration for the book +- a `book` folder that contains sources for all chapters mentioned in the TOC. Note that `.nim` files already contain default `nimib` content to be used in nimibook. +- a `docs` folder that contains static assets for the book +and that will contain the built book -1. Write your content using [nimib] or simple markdown files in the `book` folder. - The basic template for an empty page is: -```nim -import nimib, nimibook - -nbInit(theme = useNimibook) -# content here -nbSave -``` +**4. nbook build**: run `nim r nbook build` to build the book. Open any `.html` file in `docs` folder to navigate your book. -2. Use the Table of Content (ToC) DSL to link chapters to content in `nbook.nim`. -Example : -```nim -import nimibook +**5. create your content and enjoy!**: now you are ready to start creating content in your sources and publish your book. -# Create a new book called "Dummy", whose content is in the folder "book" -var book = newBookFromToc("Dummy Book", "book"): - # Create a new section called "Dummy", its content is the file "index.nim" - section("Dummy", "index"): # Note how the .nim extensions is optional - # Create a new entry called "Simple example", its content is the file "page_1.nim" - entry("Simple example", "page_1.nim") + -# access to nimibook cli which will allow to build the book -nimibookCli(book) -``` -See [nimibook] or [Nimibook repo](https://github.com/pietroppeter/nimibook -) for more documentations and examples. - -3. Generate your very own CLI tools or use Nimble tasks with `nim c -d:release nbook.nim`. - * `./nbook init` to init your book structure. **This command must be ran at least once**. - * `./nbook build` to build your book. - -4. Whenever your Table of Content changes (add/remove files, changes sections organization), recompile your `nbook` and run the `build` command : `nim c -d:release nbook.nim && ./nbook build` - * It is also doable in one command : `nim r -d:release nbook.nim build` - * You don't need to call the `init` command again. - * Rinse and repeat until your ToC is done ! Then you can just edit files and call `build` without recompiling. - -## Tips and Tricks - -* to build a single page (e.g. `book/mypage.nim`) run first `./nbook dump` -(which dumps a `book.json` file that contains a table of contents and other context data). -If `book.json` is present, then you can build your page with: `nim r book/mypage.nim` -* Each book requires its own ToC and thus will be its own CLI Apps -* `nbook.nim` is the default name used - it is possible to use another name. -* Multiple books `nbook.nim` cannot share the same folder. Instead, either split them into two separate books, or merge them into one. -* Some commands : - * `./nbook clean` will remove generated files and restart from a clean state. - * `./nbook update` will update assets and mustache template. - * These two commands will modify installed files, use them with caution if you customized files locally. +See [nimibook] documentation for more details. ## Contribute You are more than welcome to contribute! -We usually have some open issues of stuff we need to fix or we would like to do. -You have an overview of the code base in [src/readme.md](src/readme.md) -The CI is setup to run tests and publish a document PR preview -(click on details on the Netlify preview task once it's green), -so that we can all check the changes directly from the PR. -You should also test and build the book locally, there are nimble tasks -to help with that. -If the feature can be tested with a unit test, make sure to add one. -Once you make a change, remember to document your changes somewhere appropriate -and to update the [changelog](changelog.md) -(and if needed also the [src/readme.md](src/readme.md))! + +- We usually have some open issues of stuff we need to fix or we would like to do. +- You have an overview of the code base in [src/readme.md](src/readme.md) +- The CI is setup to run tests and publish a document PR preview (click on details on the Netlify preview task once it's green), so that we can all check the changes directly from the PR. +- You should also test and build the book locally, there are nimble tasks to help with that (run `nimble tasks` for the list). +- If the feature can be tested with a unit test, make sure to add one. +- Once you make a change, remember to document your changes in the appropriate place in the docs. +- If you add a module, remember to update the code guide. +- bump the version (usually a patch increment) so that we can immediately tag and release your contribution. +- Make sure that the title of your PR is clear and edit the initial message with a few short sentences that will be added to the changelog once we release. ## Analytics This website is tracking analytics with [plausible.io](https://plausible.io/index.html), a lightweight and open-source website analytics tool with no cookies and fully compliant with GDPR, CCPA and PECR. Analytics for this website are publicly available [here](https://plausible.io/pietroppeter.github.io%2Fnimibook). You can opt out from analytics tracking with [standard ad-blocking](https://plausible.io/docs/excluding) or typing [`localStorage.plausible_ignore=true`](https://plausible.io/docs/excluding-localstorage) in browser console. - - -[mdbook]: https://rust-lang.github.io/mdBook/index.html -[Nim]: https://nim-lang.org/ -[nimib]: https://pietroppeter.github.io/nimib/ -[Gitbook]: https://github.com/GitbookIO/gitbook -[nim-mustache]: https://github.com/soasme/nim-mustache -[nimibook]: https://pietroppeter.github.io/nimibook/ -[GFM]: https://github.github.com/gfm/ -[nim-markdown]: https://github.com/soasme/nim-markdown - - - -## Code structure - -For an introduction to nimibook's code see [Code Guide](src/readme.md) diff --git a/changelog.md b/changelog.md index fc3fb14..8e92294 100644 --- a/changelog.md +++ b/changelog.md @@ -6,14 +6,14 @@ * Fixed parallel build so it uses the correct folder for saving log files. * The error messages are printed to terminal as well * Pass compiler flag `-d:nimibParallelBuild=false` to compile in serial. - * Pass `-d:nimibMaxProcesses=n` to run at most `n` builds in parallel at a time. + * Pass `-d:nimibMaxProcesses=n` to run at most `n` builds in parallel at a time (default is 10) * The next-arrow is shown correctly on the second to last page. (#61) * update to use nimib 0.3 and maintenance (#50): - fix usage of `blocks` context in `document` template update to reflect change in nimib 0.3 - `nimib.toml` now supports configuration for the book, no need anymore to specify the configuration inside a nbook.nim file - - ... - templates folder changed to `srcDir / templates` + - ... * fix next/previous buttons when there is a draft chapter (see [commit 428e482](https://github.com/pietroppeter/nimibook/commit/428e482ac7b86e4f12c5ca8c79e419cb47250ea7)) * add latex support using katex (activated with `nb.useLatex` as in standard nimib), see #52 * made building happen async and in multiple process (see #53): From f4d876f8f673b6dea79631b406479868733b48e7 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 15:15:16 +0100 Subject: [PATCH 20/33] minor fix to readme --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 9a3acc4..07e53b6 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,7 @@ To install Nimibook: `nimble install nimibook` Nimibook does not ([yet](https://github.com/pietroppeter/nimibook/issues/63)) provides an executable to manage your book, but it provides the basic building blocks to write your own. -**1. example nbook.nim**: start from a (not necessarily) empty folder and create a `nbook.nim` file -(you can pick a different name from `nbook`) with the -following content: +**1. example nbook.nim**: in a folder of your choice create a `nbook.nim` file with the following content: ```nim import nimibook From d6ae55e72a7187ced23299e60124d2a9d3f54c22 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 15:26:05 +0100 Subject: [PATCH 21/33] improve nbook cli help (dump + build options) --- changelog.md | 5 +++-- src/nimibook.nim | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 8e92294..4239349 100644 --- a/changelog.md +++ b/changelog.md @@ -8,10 +8,11 @@ * Pass compiler flag `-d:nimibParallelBuild=false` to compile in serial. * Pass `-d:nimibMaxProcesses=n` to run at most `n` builds in parallel at a time (default is 10) * The next-arrow is shown correctly on the second to last page. (#61) -* update to use nimib 0.3 and maintenance (#50): +* update to use nimib 0.3 and lots of maintenance (#50) including some breaking: - fix usage of `blocks` context in `document` template update to reflect change in nimib 0.3 - `nimib.toml` now supports configuration for the book, - no need anymore to specify the configuration inside a nbook.nim file + no need anymore to specify the configuration inside a nbook. + - `book.json` is now published in docs folder and can work as a static api - templates folder changed to `srcDir / templates` - ... * fix next/previous buttons when there is a draft chapter (see [commit 428e482](https://github.com/pietroppeter/nimibook/commit/428e482ac7b86e4f12c5ca8c79e419cb47250ea7)) diff --git a/src/nimibook.nim b/src/nimibook.nim index 94a1fc9..7ff50b9 100644 --- a/src/nimibook.nim +++ b/src/nimibook.nim @@ -13,9 +13,12 @@ proc printHelp() = echo """ Choose one of the following options : init, clean, check, build, update init : Initialize book structure. +build : Build your book. + You can add options (e.g. --verbosity:0, -d:release) + and they will be passed when compiling and running nimib documents +dump : dump the content of book.json (required to build single documents) clean : Delete generated files and files that are not supposed to be here (use this with caution). check : Check generated book is correct. -build : Build your book ! update : Update assets (css, js, fonts). """ From 2b2c5bd8e4cbf3d45a4c146e7c6d72eb388ec174 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 16:02:12 +0100 Subject: [PATCH 22/33] completed changelog with recent changes --- changelog.md | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index 4239349..c1a7fba 100644 --- a/changelog.md +++ b/changelog.md @@ -8,13 +8,34 @@ * Pass compiler flag `-d:nimibParallelBuild=false` to compile in serial. * Pass `-d:nimibMaxProcesses=n` to run at most `n` builds in parallel at a time (default is 10) * The next-arrow is shown correctly on the second to last page. (#61) -* update to use nimib 0.3 and lots of maintenance (#50) including some breaking: +* update to use nimib 0.3 and lots of maintenance (#50) including some breaking changes and some additional features: - fix usage of `blocks` context in `document` template update to reflect change in nimib 0.3 - - `nimib.toml` now supports configuration for the book, - no need anymore to specify the configuration inside a nbook. + - `nimib.toml` now supports configuration for the book (in a [nimibook] section), + no need anymore to specify the configuration inside a nbook.nim file: + - in particular now you can specify the name of folder for source and build of book, fixes #48 - `book.json` is now published in docs folder and can work as a static api - - templates folder changed to `srcDir / templates` - - ... + - removed default options from build command (they were `"-d:release", "-f", "--verbosity:0", "--hints:off"`); + build command now supports options that are passed to nim compiler + - also now build fails at the end + - init command now creates default sources for toc elements (in particular it creates a default nimib document that uses nimibook) + - mustache templates are now in-memory partials, fixes #32 + - removed book source folder in toc (taken from config) and removed `path` field from `Toc` object + - minor breaking changes: + - templates folder changed to `srcDir / templates` + - remove `nbUseNimibook` (use `nbInit(theme = useNimibook)`) + - `newBookFromToc` deprecated and replaced with `initBookWithToc` + - various changes to `Book` type: + - refactored `Book.book_title` into `Book.title`. Overrides previously existing `Book.title` which was supposed to be used for the Chapter title (not used) + - removed `book.path_to_root` (it is a document/chapter thing) + - default title for a page is now entry title/label, fix #46 + - rename and fix of draft entry, fix #44 + - also fix for init and build when entry is a draft (skip) + - improved check command, fails after checking both sources and output and reports failures + - general code refactoring. code structure is now documented in a readme.md inside src folder: + - asset management moved to `assets` module and default assets moved in source + - books and docs module removed and new modules builds, commands and configs added + - renames examples to example_book and improved example + - added unit tests, which are added to CI and we also test example book * fix next/previous buttons when there is a draft chapter (see [commit 428e482](https://github.com/pietroppeter/nimibook/commit/428e482ac7b86e4f12c5ca8c79e419cb47250ea7)) * add latex support using katex (activated with `nb.useLatex` as in standard nimib), see #52 * made building happen async and in multiple process (see #53): From e6d0f222ae45db8574aa6e21b8ca20b8cc37d428 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 16:07:34 +0100 Subject: [PATCH 23/33] vendor the assets for github linguist --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8865e78 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +src/nimibook/assets/* linguist-vendored \ No newline at end of file From 94c69649b6819d7868346561835d44b054caf8f0 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 16:24:32 +0100 Subject: [PATCH 24/33] remove dependency from toml serialization --- changelog.md | 4 ++++ nimibook.nimble | 5 ++--- src/nimibook/configs.nim | 6 +----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index c1a7fba..8ed551e 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,10 @@ ## v0.3.0 (February 2023) +* Improved docs and nim 2.0 compatibility (added to CI) (#56). other minor changes: + - improve nbook help (document dump and build options) + - remove the rust file in assets/fonts + - add as vendored the assets (css, font and js stuff) * Parallel build fixes (#61) * Fixed parallel build so it uses the correct folder for saving log files. * The error messages are printed to terminal as well diff --git a/nimibook.nimble b/nimibook.nimble index f08cb3b..a9f9656 100644 --- a/nimibook.nimble +++ b/nimibook.nimble @@ -10,9 +10,8 @@ srcDir = "src" # Dependencies requires "nim >= 1.4.0" -requires "nimib >= 0.3.5" -requires "jsony >= 1.0.3" -requires "toml_serialization >= 0.2.0" +requires "nimib >= 0.3.6" +requires "jsony >= 1.1.5" import os diff --git a/src/nimibook/configs.nim b/src/nimibook/configs.nim index 72d5fc9..885d570 100644 --- a/src/nimibook/configs.nim +++ b/src/nimibook/configs.nim @@ -1,7 +1,6 @@ import std / [os, strformat] import nimibook / types import nimib / [config, paths] -import toml_serialization proc renderConfig*(book: Book): string = fmt""" @@ -26,8 +25,5 @@ proc loadConfig*(book: var Book) = book.cfgDir = cfg.dir book.rawCfg = cfg.raw book.nbCfg = cfg.nb - try: - book.cfg = Toml.decode(book.rawCfg, BookConfig, "nimibook") - except TomlError: - echo "[nimibook.warning] failed to load nimibook config" + book.cfg = loadTomlSection(book.rawCfg, "nimibook", BookConfig) echo book.renderConfig From 6c6372ada2993f0baf18c0f2b3eb3fd1fa4715a9 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 16:27:09 +0100 Subject: [PATCH 25/33] update test CI to use stable and devel --- .github/workflows/tests.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/valid.yml | 27 --------------------------- 2 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .github/workflows/valid.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..56a5429 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,31 @@ +name: Run tests +on: + push: + branches: + - main + pull_request: +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + nim: + - '1.6.x' + - 'stable' + - 'devel' + fail-fast: false + name: Nim ${{ matrix.nim }} + steps: + - uses: actions/checkout@v3 + - uses: jiro4989/setup-nim-action@v1.4.3 + with: + nim-version: ${{ matrix.nim }} + - run: nimble -y install + - run: nimble test + - name: Test generation of nimibook documentation + run: nimble genbook + - name: Test example book + run: nimble test_example + - name: Clean example book + run: nimble clean_example + diff --git a/.github/workflows/valid.yml b/.github/workflows/valid.yml deleted file mode 100644 index 37e5d2a..0000000 --- a/.github/workflows/valid.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - pull_request: - branches: - - main - push: - branches: - - main - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: "install_nim" - id: install_nim - uses: iffy/install-nim@v3 - - run: cat nimibook.nimble - - run: nimble install -y - - name: Test - run: nimble test - - name: Test generation of nimibook documentation - run: nimble genbook - - name: Test example book - run: nimble test_example - - name: Clean example book - run: nimble clean_example - From 2d3ac3651130f492e942d6c7a46dfa1576c29b11 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 16:31:50 +0100 Subject: [PATCH 26/33] update changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 8ed551e..fddea55 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## v0.3.0 (February 2023) * Improved docs and nim 2.0 compatibility (added to CI) (#56). other minor changes: + - updated CI to test on 1.6.x, devel, stable - improve nbook help (document dump and build options) - remove the rust file in assets/fonts - add as vendored the assets (css, font and js stuff) From 7b2ca977410cf0180fd60f4d9ed1932a2a2e843c Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 17:33:31 +0100 Subject: [PATCH 27/33] change toc structure + latex in content chapter --- book/cli.nim | 5 +++ book/content.nim | 79 ++++++++++++++++++++++++++++++++++++++++++------ book/latex.nim | 66 ---------------------------------------- book/toc.nim | 5 +++ nbook.nim | 11 +++---- 5 files changed, 84 insertions(+), 82 deletions(-) create mode 100644 book/cli.nim delete mode 100644 book/latex.nim create mode 100644 book/toc.nim diff --git a/book/cli.nim b/book/cli.nim new file mode 100644 index 0000000..d521047 --- /dev/null +++ b/book/cli.nim @@ -0,0 +1,5 @@ +import nimib, nimibook + +nbInit(theme = useNimibook) +nbText: "## Commands" +nbSave diff --git a/book/content.nim b/book/content.nim index 6b4a96f..90393d5 100644 --- a/book/content.nim +++ b/book/content.nim @@ -1,23 +1,82 @@ +import std / strformat import nimib, nimibook +import nimib / themes +from nimibook / commands import emptySrcFile nbInit(theme = useNimibook) nbText: """ # Content -The content of a chapter of a book can be a standard Markdown file or a nim file. +The content of a chapter of a book can be a standard Markdown file (`.md`) or a `.nim` file. -For the nim file the structure is the following: +The nim file must be a nimib document and the default content (created by `init` command) is: +""" +nbCode: + discard +nb.blk.code = emptySrcFile("Default Content", ".nim") -```nim -import nimib, nimibook -... # other imports -nbInit # initializes a nimib document -nbUseNimibook # overrides nimib defaults with nimibooks and loads book configuration +nbText: """## Latex + +Latex is available through [Katex](https://www.latex-project.org) as in Nimib. +It is enabled on a specific document with the command +""" +nbCode: + nb.useLatex + +nbText: &""" +which adds the following content in the head of the document: + +```html +{themes.latex} +``` +""" + +let inline_paragraph = """ +> Euler's identity is the equality +> $e^{i\pi} + 1 = 0$, where $e$ is the base of natural logarithms, +> $i$ is the imaginary unit, and $\pi$ is the ratio of circumference of a circle +> to its diameter. +""" +let block_equation = """ +$$ + f(x) = \frac{1}{\sigma\sqrt{2\pi}} + \exp\left( -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^{\!2}\,\right) +$$ +""" + +nbText: &"""## Inline equations + +**Inline equations** are obtained with delimiters `$..$`. The following inline paragraph: + +{inline_paragraph} + +...is created with the following source: -... # content of chapter using nbText, nbCode and other nimib functionalities +```md +{inline_paragraph} +``` + +## Block equations + +**Block equations** are obtained with delimiters `$$..$$`. The follwing block equation: -nbSave # save the document to html output +{block_equation} + +...is created with the following source: + +```md +{block_equation} ``` -""" # todo: highlight nim code + +### MathJax support + +As in the original mdbook, you can opt instead to activate [MathJax support](https://rust-lang.github.io/mdBook/format/mathjax.html) +with: + +```nim +nb.context["mathjax_support"] = true +``` +""" + nbSave \ No newline at end of file diff --git a/book/latex.nim b/book/latex.nim deleted file mode 100644 index 282a4af..0000000 --- a/book/latex.nim +++ /dev/null @@ -1,66 +0,0 @@ -import nimib, nimibook, std / strformat, nimib / themes - -nbInit(theme = useNimibook) -nbText: """## Latex - -Latex is available through [Katex](https://www.latex-project.org) as in Nimib. -It is enabled on a specific document with the command -""" -nbCode: - nb.useLatex - -nbText: &""" -which adds the following content in the head of the document: - -```html -{themes.latex} -``` -""" - -let inline_paragraph = """ -> Euler's identity is the equality -> $e^{i\pi} + 1 = 0$, where $e$ is the base of natural logarithms, -> $i$ is the imaginary unit, and $\pi$ is the ratio of circumference of a circle -> to its diameter. -""" -let block_equation = """ -$$ - f(x) = \frac{1}{\sigma\sqrt{2\pi}} - \exp\left( -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^{\!2}\,\right) -$$ -""" - -nbText: &"""## Inline equations - -**Inline equations** are obtained with delimiters `$..$`. The follwing inline paragraph: - -{inline_paragraph} - -...is created with the following source: - -```md -{inline_paragraph} -``` - -## Block equations - -**Block equations** are obtained with delimiters `$$..$$`. The follwing block equation: - -{block_equation} - -...is created with the following source: - -```md -{block_equation} -``` - -## MathJax support - -As in the original mdbook, you can opt instead to activate [MathJax support](https://rust-lang.github.io/mdBook/format/mathjax.html) -with: - -```nim -nb.context["mathjax_support"] = true -``` -""" -nbSave diff --git a/book/toc.nim b/book/toc.nim new file mode 100644 index 0000000..b4602a2 --- /dev/null +++ b/book/toc.nim @@ -0,0 +1,5 @@ +import nimib, nimibook + +nbInit(theme = useNimibook) +nbText: "## Table of Contents" +nbSave diff --git a/nbook.nim b/nbook.nim index 76069f6..ed3e060 100644 --- a/nbook.nim +++ b/nbook.nim @@ -1,12 +1,11 @@ import nimibook var book = initBookWithToc: - section("Introduction", "index"): # .nim extension is optional - entry("Content", "content") - entry("Toc DSL", "tocdsl") - entry("Configuration", "configuration") - entry("Nimble tasks", "tasks") - entry("Latex", "latex") + entry("Introduction", "index", numbered = false) # .nim extension is optional + entry("Content", "content") + entry("Table of Contents", "toc") + entry("Configuration", "configuration") + entry("Commands", "cli") section("Example toc structure", "tocexample/index.md"): section("Nested section", "nested.md"): entry("Entry in nested section", "nested_entry.md") From 10158cd1a7bfd52f863b3636154fa9524b90d85a Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 18:11:11 +0100 Subject: [PATCH 28/33] toc + configuration completed --- book/configuration.nim | 57 ++++++++++++++++++++++++++++++++++-------- book/tasks.nim | 22 ---------------- book/toc.nim | 22 +++++++++++++++- book/tocdsl.nim | 26 ------------------- 4 files changed, 67 insertions(+), 60 deletions(-) delete mode 100644 book/tasks.nim delete mode 100644 book/tocdsl.nim diff --git a/book/configuration.nim b/book/configuration.nim index 07d76c1..0c94fc8 100644 --- a/book/configuration.nim +++ b/book/configuration.nim @@ -1,8 +1,13 @@ import nimib, nimibook import std / [os, strutils, strscans, strformat] +import nimibook / [defaults, configs] nbInit(theme = useNimibook) +template debug(message: string) = + when defined(nimibookDebugConfigurationDoc): + debugEcho message + # the following is very dependent on how source is written proc readBookConfigFields: seq[string] = # current folder is docs @@ -10,38 +15,68 @@ proc readBookConfigFields: seq[string] = var process = false var field, typ, description: string for line in src.lines: - # debugEcho line - if line.strip.startsWith("Book"): - # debugEcho ">start processing" + debug line + if line.strip.startsWith("BookConfig"): + debug ">start processing" process = true continue if line.strip.startsWith("#"): - # debugEcho ">skip" + debug ">skip" continue - if line.strip.startsWith("toc"): - # debugEcho ">stop processing" + if line.strip.startsWith("Book"): + debug ">stop processing" break if process and line.contains("##"): - # debugEcho ">match" + debug ">match" description = line.split("##")[1].strip field = line.split("##")[0].split("*:")[0].strip typ = line.split("##")[0].split("*:")[1].strip result.add fmt"* **{field}** (`{typ}`): {description}" - # else: debugEcho ">noMatch" + else: + debug ">noMatch" let fieldList = readBookConfigFields().join("\n") nbText: fmt""" # Configuration -Book configuration is done with the `Book` object that has been created with `newBookFromToc`. +Book configuration is done inside the `[nimibook]` section of `nimib.toml` configuration file. -The `Book` object has the following fields which are relevant for the documentation: +Here are the available fields: {fieldList} -Notes: +As an example here is nimibook configuration:""" +func skipUntil(text: string, keyword: string): string = + var untilReached = false + var lines: seq[string] + for line in text.splitLines: + if line.startsWith(keyword): + untilReached = true + if untilReached: + lines.add line + result = lines.join("\n") +nbCode: # highlight as nim since it is better than no highlighting... + discard +nb.blk.code = "../nimib.toml".readFile +nbText: "This is the default configuration created by the `init command`:" +nbCode: # highlight as nim since it is better than no highlighting... + discard +nb.blk.code = block: + var book = Book() + book.setDefaults + book.renderConfig.skipUntil("[nimibook]") + + +nbText: """ +## Folder structure +By default the nimibook folder structure is to put all sources in a `book` folder +and to put the book built output in a `docs` folder (so that it is straightforward to publish the book wit github pages). + +These folders can be customized since they are taken from [nimib] section of `nimib.toml` +as `srcDir` and `outDir`. +## Additional remarks * for consistency with template values, we use snake case for fields of this object. * the book object replicates functionalities available in mdbook * relevant documentation for mdbook is in this two pages: diff --git a/book/tasks.nim b/book/tasks.nim deleted file mode 100644 index 21f636a..0000000 --- a/book/tasks.nim +++ /dev/null @@ -1,22 +0,0 @@ -import nimib, nimibook -import osproc, sugar, strutils, strformat - -nbInit(theme = useNimibook) - -var tasks: string -withDir("..".AbsoluteDir): - tasks = execProcess("nimble", args=["tasks"], options={poUsePath}) - -let taskList = collect(newSeq): - for line in tasks.strip.splitLines: - "* `nimble " & line.replace(" ", "`: ") - -nbText: fmt""" -# Nimble tasks - -The following are the nimble tasks that can be used -when developing the project: - -{taskList.join("\n")} -""" -nbSave \ No newline at end of file diff --git a/book/toc.nim b/book/toc.nim index b4602a2..ed0160a 100644 --- a/book/toc.nim +++ b/book/toc.nim @@ -1,5 +1,25 @@ import nimib, nimibook nbInit(theme = useNimibook) -nbText: "## Table of Contents" +nbText: """## Table of Contents + +The Table of Contents (ToC) is defined inside the `nbook.nim`. +As an example here is `nbook.nim` for this book (nimibook documentation): +""" +nbCode: + discard +nb.blk.code = "../nbook.nim".readFile +nbText: """ +From the above example you can see that: + - ToC is defined inside `initBookWithToc` block + - chapters that do not start a section are created with `entry` + - `entry` accepts two string parameters: chapter title and source path + - source path is relative to book source folder + - source extension defaults to `.nim`, to use a markdown source you need to explict mark it as `.md` + - chapters that start a section are created with `section` and start a new block + - draft chapters (placeholders in the ToC without source) are created with `draft` + +In the future nimibook will support the same `SUMMARY.md` mechanism as in mdbook. +Note that currently nimibook does not support part title and separators (available in mdbook). +""" nbSave diff --git a/book/tocdsl.nim b/book/tocdsl.nim deleted file mode 100644 index b40de0b..0000000 --- a/book/tocdsl.nim +++ /dev/null @@ -1,26 +0,0 @@ -import nimib, nimibook - -nbInit(theme = useNimibook) - -nbText: """ -# Table of Contents DSL - -The table of content supports (numbered) chapters (`entry`), -sections (`section`) and draft chapters (`draft`, not numbered). - -Here is an example on how it looks like -```nim -import nimibook, os # os is used inside Toc DSL - -let book = newBookFromToc("Example book", "book"): - entry("Introduction", "index") # .nim extension is optional - entry("Pure Markdown", "pure.md") # for md files you need to use extension - # every entry in this section will have a path relative to basics - section("Basics", "basics/index.nim"): - section("Plotting", "plotting.nim"): # nested sections - entry("Data Manipulation", "data_manipulation") - entry("Models", "models") - draft("Contributors", "misc/but/very/far/contributors") -``` -""" # todo: highlight nim code -nbSave \ No newline at end of file From 3274765ed9ccc3addd34ccbeccd45ee40898a2ce Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 19:10:20 +0100 Subject: [PATCH 29/33] completed book improvements + command changes --- book/cli.nim | 52 ++++++++++++++++++++++++++++++++++++++- book/configuration.nim | 21 ++++++++-------- book/toc.nim | 3 ++- changelog.md | 4 +++ src/nimibook.nim | 28 ++++++++++++--------- src/nimibook/commands.nim | 16 ------------ src/nimibook/configs.nim | 2 +- 7 files changed, 85 insertions(+), 41 deletions(-) diff --git a/book/cli.nim b/book/cli.nim index d521047..ef46584 100644 --- a/book/cli.nim +++ b/book/cli.nim @@ -1,5 +1,55 @@ import nimib, nimibook +import std / strformat nbInit(theme = useNimibook) -nbText: "## Commands" +nbText: fmt"""# Commands + +With the `nimibookCli(book)` command at the end of `nbook.nim` file, +the executable is provided with a number of commands. +The help on the executable can be obtained running `nbook` without arguments: + +``` +{cliHelp} +``` + +## Customize nim compile time parameters + +During build nimibook compiles and runs a `example.nim` file +with `nim r /example.nim`. +Any additional argument after `build` is used as-is in ``. + +For example to compile the whole book in release mode with no hints +or other messages from the compiler you can run: + +``` +nbook build -d:release --hints:off --verbosity:0 +``` + +## Single nimib document build + +When you are working on a single nimib document you are not interested in +building the complete book. In order to build a single file +you need first to dump the `book.json` with `nbook dump`. +After this is done you can build the single `example.nim` file +as you would with standard nimib. For example to show it in the browser after +build is completed you can run: + +``` +nim r book/example.nim --nbShow +``` + +## Parallel build and error logs + +By default nimibook builds source files in parallel. +If an error is produced when building a source file a `.log` file +with the output of build command is created next to source file. + +If you need to disable the parallel builds you can set +`-d:nimibParallelBuild=false` when compiling `nbook`. + +By default it builds up to a maximum of 10 source files in parallel. +To change the default maximum to `n` you can set +`-d:nimibMaxProcesses=n` when compiling `nbook`. + +""" nbSave diff --git a/book/configuration.nim b/book/configuration.nim index 0c94fc8..b0ac74c 100644 --- a/book/configuration.nim +++ b/book/configuration.nim @@ -1,7 +1,17 @@ import nimib, nimibook -import std / [os, strutils, strscans, strformat] +import std / [os, strutils, strformat] import nimibook / [defaults, configs] +func skipUntil*(text: string, keyword: string): string = + var untilReached = false + var lines: seq[string] + for line in text.splitLines: + if line.startsWith(keyword): + untilReached = true + if untilReached: + lines.add line + result = lines.join("\n") + nbInit(theme = useNimibook) template debug(message: string) = @@ -47,15 +57,6 @@ Here are the available fields: {fieldList} As an example here is nimibook configuration:""" -func skipUntil(text: string, keyword: string): string = - var untilReached = false - var lines: seq[string] - for line in text.splitLines: - if line.startsWith(keyword): - untilReached = true - if untilReached: - lines.add line - result = lines.join("\n") nbCode: # highlight as nim since it is better than no highlighting... discard nb.blk.code = "../nimib.toml".readFile diff --git a/book/toc.nim b/book/toc.nim index ed0160a..7d5bf1d 100644 --- a/book/toc.nim +++ b/book/toc.nim @@ -3,7 +3,8 @@ import nimib, nimibook nbInit(theme = useNimibook) nbText: """## Table of Contents -The Table of Contents (ToC) is defined inside the `nbook.nim`. +The Table of Contents (ToC) is defined inside the `nbook.nim` +(you can pick another name for the file but in the documentation we will refer to it as `nbook.nim`). As an example here is `nbook.nim` for this book (nimibook documentation): """ nbCode: diff --git a/changelog.md b/changelog.md index fddea55..8f49220 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,10 @@ ## v0.3.0 (February 2023) * Improved docs and nim 2.0 compatibility (added to CI) (#56). other minor changes: + - changes to commands: + - clean command now only cleans the docs (outDir) folder, it does not clean srcFolder + - update command now only forces update of assets (to create sources use init) + - nimibook does not log anymore config and ToC every command it runs - updated CI to test on 1.6.x, devel, stable - improve nbook help (document dump and build options) - remove the rust file in assets/fonts diff --git a/src/nimibook.nim b/src/nimibook.nim index 7ff50b9..e07e15f 100644 --- a/src/nimibook.nim +++ b/src/nimibook.nim @@ -9,17 +9,21 @@ import nimib / paths template nbUseNimibook* = {. error: "nbUseNimibook has been removed in nimibook 0.3, use nbInit(theme = useNimibook)" .} -proc printHelp() = - echo """ -Choose one of the following options : init, clean, check, build, update -init : Initialize book structure. -build : Build your book. - You can add options (e.g. --verbosity:0, -d:release) +# stop at the sign in order to make sure it shows without scroll in nimibook: V +const cliHelp* = """ +Choose one of the following options : init, build, dump, check, clean, update +init : Initialize book structure: + - creates a default nimib.toml config (if not already present) + - creates required nimibook assets in output folder (if not already present) + - creates default sources file for entries listed in toc + After first usage it can be used to create source files from ToC +build : Build your complete book. + You can add options (e.g. --verbosity:0, -d:release, ...) and they will be passed when compiling and running nimib documents dump : dump the content of book.json (required to build single documents) -clean : Delete generated files and files that are not supposed to be here (use this with caution). -check : Check generated book is correct. -update : Update assets (css, js, fonts). +check : Check that sources and outputs are present as expected in ToC. +clean : Removes (almost) everything from output folder except assets. +update : Update assets (css, js, fonts) in case they changed in last nimibook release. """ proc nimibookCli*(book: var Book) = @@ -33,7 +37,7 @@ proc nimibookCli*(book: var Book) = case p.kind of cmdEnd: if not hasArgs: - printHelp() + echo cliHelp break of cmdShortOption, cmdLongOption: discard @@ -54,7 +58,7 @@ proc nimibookCli*(book: var Book) = elif p.key == "dump": dump book else: - printHelp() + echo cliHelp proc initBook*: Book = result.loadConfig @@ -64,7 +68,7 @@ template initBookWithToc*(body: untyped): Book = var book = initBook() book.toc = initToc: body - echo book.renderToc + # echo book.renderToc book # deprecated: api superseded by config based api (and wrong use of New) diff --git a/src/nimibook/commands.nim b/src/nimibook/commands.nim index f53b020..f429c78 100644 --- a/src/nimibook/commands.nim +++ b/src/nimibook/commands.nim @@ -22,19 +22,6 @@ proc getSrcUrls*(book: Book): seq[string] = for e in book.toc.entries: book.srcPath e -proc cleanJson*(book: Book) = - let uri = normalizedPath(book.homeDir / "book.json") - echo "[nimibook] remove file: ", uri - removeFile(uri) - -proc cleanSrcFolder(book: Book) = - let srcUrls: seq[string] = book.getSrcUrls - for f in walkDirRec(book.srcDir): - let ext = f.splitFile().ext - if f notin srcUrls and ext != ".mustache" and ext != ".nims" and ext != ".cfg" and not f.contains(".git"): - echo "[nimibook] remove file: ", f - removeFile(f) - proc shouldDelete(book: Book, dir, f: string): bool = # Remove anything that's not in "docs/assets" or it is in keep (as a file or inside a keep folder) if isRelativeTo(f, dir / "assets"): @@ -66,8 +53,6 @@ proc cleanOutFolder(book: Book) = removeDir(d) proc clean*(book: Book) = - cleanJson(book) - cleanSrcFolder(book) cleanOutFolder(book) proc check*(book: Book) = @@ -128,4 +113,3 @@ proc init*(book: Book) = proc update*(book: Book) = populateAssets(book.homeDir, force = true) - initBookSrc(book) diff --git a/src/nimibook/configs.nim b/src/nimibook/configs.nim index 885d570..569975c 100644 --- a/src/nimibook/configs.nim +++ b/src/nimibook/configs.nim @@ -26,4 +26,4 @@ proc loadConfig*(book: var Book) = book.rawCfg = cfg.raw book.nbCfg = cfg.nb book.cfg = loadTomlSection(book.rawCfg, "nimibook", BookConfig) - echo book.renderConfig + # echo book.renderConfig From 1c8cda913bdf05a99a2342382c3028bcdecd60f9 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 20:28:06 +0100 Subject: [PATCH 30/33] Update book/content.nim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hugo Granström <5092565+HugoGranstrom@users.noreply.github.com> --- book/content.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/content.nim b/book/content.nim index 90393d5..d8e5272 100644 --- a/book/content.nim +++ b/book/content.nim @@ -59,7 +59,7 @@ nbText: &"""## Inline equations ## Block equations -**Block equations** are obtained with delimiters `$$..$$`. The follwing block equation: +**Block equations** are obtained with delimiters `$$ ... $$`. The follwing block equation: {block_equation} From 2eda939a8718857b22b38be827b68a235213d4d5 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 20:28:12 +0100 Subject: [PATCH 31/33] Update book/content.nim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hugo Granström <5092565+HugoGranstrom@users.noreply.github.com> --- book/content.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/content.nim b/book/content.nim index d8e5272..b36936b 100644 --- a/book/content.nim +++ b/book/content.nim @@ -47,7 +47,7 @@ $$ nbText: &"""## Inline equations -**Inline equations** are obtained with delimiters `$..$`. The following inline paragraph: +**Inline equations** are obtained with delimiters `$ ... $`. The following inline paragraph: {inline_paragraph} From a5deb879b464c6bf8a869d175424638e0bae44d9 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 20:28:23 +0100 Subject: [PATCH 32/33] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hugo Granström <5092565+HugoGranstrom@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 07e53b6..ab01752 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ provided by [nim-markdown]. For a quick reference of supported syntax see this [ [nimibook]: https://pietroppeter.github.io/nimibook/ [GFM]: https://github.github.com/gfm/ [nim-markdown]: https://github.com/soasme/nim-markdown -[cheasheet]: https://pietroppeter.github.io/nimib/cheatsheet.html +[cheatsheet]: https://pietroppeter.github.io/nimib/cheatsheet.html ## Status From a2a925b216559ee242dfa37c81f5a04527a29343 Mon Sep 17 00:00:00 2001 From: Pietro Peterlongo Date: Sun, 19 Feb 2023 20:59:08 +0100 Subject: [PATCH 33/33] Fix changelog link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab01752..6f8780f 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ needed to create a book with markdown and nimib sources. It still has some features missing from mdbook (see [this issue](https://github.com/pietroppeter/nimibook/issues/9#issuecomment-851989939)). -To follow up on recent changes check the [changelog.md](changelog.md). +To follow up on recent changes check the [changelog.md](https://github.com/pietroppeter/nimibook/blob/main/changelog.md). ## Example sites using nimibook