generated from srid/ema-template
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folgezettel-aware sidebar + new configurable 'default' layout (#483)
- **BACKWARDS INCOMPATIBLE** A new HTML template layout "default" (unifies and) replaces both "book" and "note" layout. - Sidebar tree is now computed from the folgezettel graph, which is a superset of the folder hierarchy. The index page's tree inherits the same. - The semantics of `folder-folgezettel` is now applied in inverse (see docs)
- Loading branch information
Showing
23 changed files
with
336 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
slug: folgezettel | ||
--- | ||
|
||
# Folgezettel links | ||
|
||
Wikilinks can be of special type called a "folgezettel". They are created with a special variation of emanote link syntax. | ||
|
||
Conceptually, a [folgezettel](https://neuron.zettel.page/folgezettel-heterarchy) link can be thought of as an arrow from a parent note to a descendent note. | ||
|
||
## Syntax | ||
|
||
```markdown | ||
## A folgezettel link from another page to this one: | ||
|
||
Here is the #[[source-note]] | ||
|
||
## A folgezettel link from this page to another one: | ||
|
||
Here is the [[target-note]]# | ||
``` | ||
|
||
{#folder} | ||
## Folder notes | ||
|
||
By default, Emanote includes any directories in your note's path as vertices in the folgezettel graph. This makes the folder note a folgezettel parent of the child note. The contents of a folder, likewise, become folgezetten children of the folder note. For eg., in `foo/bar/qux.md`, "foo" is a folgezettel parent of "bar", and "bar" is a folgezettel parent of "qux". | ||
|
||
>[!note] | ||
> The top-level root folder is not considered a folgezettel by default, unless you specify it (as shown below). This is to support the use-case of the user having a *flat list* of notes *without* subdirectories, but connected through [[folgezettel]]. | ||
This behavior can be configured. To turn it off on a per-folder basis, set the corresponding flag in [[yaml-config|your configuration]] to `false` as shown here: | ||
|
||
```yaml | ||
emanote: | ||
# Whether to automatically treat the contents of this | ||
# folder note as its folgezettel children | ||
folder-folgezettel: false | ||
``` | ||
>[!tip] | ||
> Put this configuration in `foo.md` if you want to disable folder folgezettel for just that folder `foo/`. Put it in `foo.yaml` if you want to disable it for `foo/` and all subfolders under it recursively. Put it in top-level `index.yaml` to disable it for all folders. See [[yaml-config]] for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
slug: breadcrumbs | ||
--- | ||
|
||
|
||
# Breadcrumbs | ||
|
||
On mobile view, [breadcrumbs] are displayed at the top. The path of the crumbs is determined from the filesystem path of the associated source file. Breadcrumbs can be disabled in [[yaml-config]]; see [[neuron-layout]] for an example. | ||
|
||
>[!warning] Folgezettel | ||
> Breadcrumbs do not use [[folgezettel]]. | ||
[breadcrumbs]: https://en.wikipedia.org/wiki/Breadcrumb_navigation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,40 @@ | ||
--- | ||
template: | ||
name: /templates/layouts/note | ||
uptree: | ||
enable: true | ||
sidebar: | ||
enable: false | ||
breadcrumbs: | ||
enable: false | ||
base: | ||
containerClass: container mx-auto max-w-prose | ||
--- | ||
|
||
# Neuron-like layout | ||
|
||
Emanote comes with two built-in [[html-template|HTML template]] layouts. The default layout is called "book", but you may select the "note" layout (which mimics [Neuron](https://neuron.zettel.page/)) by adding the following to your [[yaml-config|index.yaml]], | ||
Emanote's builtin [[html-template|HTML template]] layout can be configured to toggle UX features on or off. The default configuration includes [[sidebar]] and [[breadcrumbs]] but hides the [[uptree]]. To mimic the layout used by [Neuron](https://neuron.zettel.page/), turn off sidebar and breadcrumbs while enabling the uptree. Add this to your [[yaml-config]]: | ||
|
||
```yml | ||
template: | ||
name: /templates/layouts/note | ||
uptree: | ||
enable: true | ||
sidebar: | ||
enable: false | ||
breadcrumbs: | ||
enable: false | ||
base: | ||
containerClass: container mx-auto max-w-prose | ||
``` | ||
The "note" layout includes the [[uptree]] of Neuron based on folgezettel links as well as directory layout. Note that all top-level notes are automatically made a folgezettel branch of the root note (index), such that the "home" link appears on top in the uplink tree of all notes. | ||
This includes the [[uptree]] of Neuron based on folgezettel links as well as directory layout. Note that all top-level notes are automatically made a folgezettel branch of the root note (index), such that the "home" link appears on top in the uplink tree of all notes. | ||
> [!tip] Demo | ||
> As a demo, the very page you are viewing is rendered using the "note" layout (whilst leaving the rest of the site to use the default "book" layout.) | ||
> As a demo, the very page you are viewing is rendered using this template configuration (whilst leaving the rest of the site to use the default configuration) | ||
## In lieu of sidebar | ||
In the absence of [[sidebar]], you may use the [[query|folgezettel children query]] to show the children of the current note. Example below: | ||
```query | ||
children:. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
# Sidebar | ||
|
||
In [[html-template|the `book` template]], the sidebar is rendered on the left side. The sidebar tree is determined from the directory layout of the [[markdown|Markdown]] or [[orgmode|Org]] files. | ||
In [[html-template|the default template]], the sidebar is rendered on the left side. The sidebar tree is determined from [[folgezettel|folgezettel heterarchy]]. | ||
|
||
- The sidebar tree is collapsed by default. But this can be disabled by setting `template.sidebar.collapsed` to `false` in [[yaml-config]] | ||
- The ordering of children in the tree is determined in the following order (this is also the order in which [[query]] results are rendered by default): | ||
1. if `template.sidebar.folders-first` is set to `true` (default `false`), directories are put before single notes, respecting the other order criteria. Otherwise, directories and notes will be interleaved. | ||
2. If the `order` [[yaml-config|frontmatter]] metadata exists, use that as the primary sort key. | ||
3. If the note has a H1 title, use that as the secondary sort key; otherwise, use the note filename as the secondary sort key. | ||
|
||
## Disabling the sidebar | ||
|
||
In [[yaml-config]], | ||
|
||
```yaml | ||
template: | ||
sidebar: | ||
enable: false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,18 @@ | ||
# Uplink tree | ||
|
||
The _uplink tree_ or "uptree"[^neuron] is a feature available in #[[neuron-layout|the `note` template]], which visualizes hierarchical relationships between notes as a graph at the top of the page. | ||
The _uplink tree_ or "uptree"[^neuron] is a feature available in #[[html-template]], which visualizes hierarchical relationships between notes as a graph at the top of the page. | ||
|
||
[^neuron]: This feature was inspired by an equivalent feature [from Neuron](https://neuron.zettel.page/uplink-tree). | ||
|
||
These relationships are called by _folgezettel links_ and created with a special variation of emanote link syntax. | ||
These relationships are called by [[folgezettel]]. | ||
|
||
Conceptually, a [folgezettel](https://neuron.zettel.page/folgezettel-heterarchy) link can be thought of as an arrow from a parent note to a descendent note. | ||
|
||
## Syntax | ||
|
||
```markdown | ||
## A folgezettel link from another page to this one: | ||
|
||
Here is the #[[source-note]] | ||
|
||
## A folgezettel link from this page to another one: | ||
|
||
Here is the [[target-note]]# | ||
``` | ||
|
||
## Folder nodes | ||
|
||
By default, Emanote also includes any directories in your note's path as vertices in the uptree graph. | ||
|
||
This behavior can be configured. To turn off the implicit folder nodes, set to `false` the corresponding flag in [[yaml-config|your configuration]] as shown here: | ||
To enable the uptree, add the following to your [[yaml-config]]: | ||
|
||
```yaml | ||
emanote: | ||
# Whether to automatically treat folder notes as a folgezettel parent of its contents | ||
folder-folgezettel: false | ||
template: | ||
sidebar: | ||
enable: false | ||
``` | ||
>[!tip] See also | ||
> #[[neuron-layout]]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.