From 4c6990e23e352bea76cec449c310b462c2594fa5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sun, 10 Mar 2024 13:45:22 -0400 Subject: [PATCH] docs --- docs/guide/layer.md | 20 +++++++++++++++++++- emanote/CHANGELOG.md | 1 + emanote/emanote.cabal | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/guide/layer.md b/docs/guide/layer.md index a84fd4c50..c76cf69f9 100644 --- a/docs/guide/layer.md +++ b/docs/guide/layer.md @@ -1,6 +1,14 @@ # Layer system -Emanote's layer system allows you to "merge" multiple notebooks and treat them as if they were a single notebook. The `-L` option in the command line accepts layers, and you can specify multiple of them with the leftmost taking the most precedence. +Emanote's layer system allows you to "merge" multiple notebook directories and treat them as if they were a single notebook directory. The `-L` option in the command line accepts layers, and you can specify multiple of them with the leftmost taking the most precedence. + +For example, + +```sh +emanote -L ./docs1:./docs2 run +``` + +Internally, Emante merges both `docs1` and `docs2` folders and treats them as a single directory. Thus, both `docs1` and `docs2` can contain the same file, and the one in `docs1` will take precedence. ## "Default" layer @@ -9,3 +17,13 @@ Emanote *implicitly* includes what is known as the "default" layer. Its contents ## Merge semantics The default merge semantic is to replace with the file on the right layer. For some file types, special merge semantic applies. For example, [[yaml-config|YAML files]] are merged by deep merge, not file-level replacement. This is what allows you to create `index.yaml` that overrides only a subset of the default configuration. + +## Mount point + +Layers can be mounted at a specific path. For example, if you want to mount `docs1` at `/D1` and `docs2` at `/D2`, you can do so with: + +```sh +emanote -L /docs1@D1;/docs2@D2 run +``` + +When two layers are mounted at distinct mount points it becomes impossible for there to be overlaps. This is useful to host sub-sites under a single site, such as in [this case](https://github.com/flake-parts/community.flake.parts). \ No newline at end of file diff --git a/emanote/CHANGELOG.md b/emanote/CHANGELOG.md index 40177ba0e..38588efe9 100644 --- a/emanote/CHANGELOG.md +++ b/emanote/CHANGELOG.md @@ -11,6 +11,7 @@ - Resolve ambiguities based on closer common ancestor ([\#498](https://github.com/srid/emanote/pull/498)) - Support for folder "index.md" notes ([\#512](https://github.com/srid/emanote/pull/512)) - Instead of "foo/qux.md", you can now create "foo/qux/index.md" + - Layers can be mounted in sub-directories, enabling composition of distinct notebooks ([\#523](https://github.com/srid/emanote/pull/523)) - **BACKWARDS INCOMPTABILE** changes - `feed.siteUrl` is now `page.siteUrl` - A new HTML template layout "default" (unifies and) replaces both "book" and "note" layout. ([\#483](https://github.com/srid/emanote/pull/483)) diff --git a/emanote/emanote.cabal b/emanote/emanote.cabal index a393ec1e2..7aa22c860 100644 --- a/emanote/emanote.cabal +++ b/emanote/emanote.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: emanote -version: 1.3.14.3 +version: 1.3.15.0 license: AGPL-3.0-only copyright: 2022 Sridhar Ratnakumar maintainer: srid@srid.ca