Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Mar 10, 2024
1 parent d6789bc commit 4c6990e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
20 changes: 19 additions & 1 deletion docs/guide/layer.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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).
1 change: 1 addition & 0 deletions emanote/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion emanote/emanote.cabal
Original file line number Diff line number Diff line change
@@ -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: [email protected]
Expand Down

0 comments on commit 4c6990e

Please sign in to comment.