Major clean up and improvements to vimwiki compatibility and documentation.
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
//! Walks a `DocumentNode` and writes HTML5 fragments. The renderer is
|
||||
//! configured with a link resolver (callback that turns a `LinkTarget` into
|
||||
//! a URL string) and, optionally, an enclosing template with substitution
|
||||
//! placeholders (SPEC.md §6.8 + §12.8).
|
||||
//! placeholders.
|
||||
//!
|
||||
//! Substitution model: `{{content}}` and `{{title}}` are computed from
|
||||
//! the rendered body and the document's metadata; `with_var(k, v)` /
|
||||
//! `with_vars(map)` add arbitrary key→value pairs (Phase 17 ships
|
||||
//! `{{date}}`, `{{root_path}}`, `{{toc}}`). Order: `{{content}}` is
|
||||
//! `with_vars(map)` add arbitrary key→value pairs (`{{date}}`,
|
||||
//! `{{root_path}}`, `{{toc}}`). Order: `{{content}}` is
|
||||
//! substituted first so a body that happens to contain a literal
|
||||
//! `{{title}}` isn't itself rewritten in the next pass.
|
||||
//!
|
||||
@@ -44,7 +44,7 @@ pub struct HtmlRenderer {
|
||||
/// `color_dic`-style override: vimwiki colour-tag names → CSS
|
||||
/// values (`"red"` / `"#ffe119"` / `"oklch(…)"`). Unspecified
|
||||
/// names fall through to the default `class="color-<name>"`
|
||||
/// rendering. Matches SPEC §12.11 `color_dic`.
|
||||
/// rendering. Matches vimwiki's `color_dic`.
|
||||
colors: HashMap<String, String>,
|
||||
}
|
||||
|
||||
@@ -662,7 +662,7 @@ fn table_spans(table: &TableNode) -> Vec<Vec<CellLayout>> {
|
||||
|
||||
// ===== Default link resolver =====
|
||||
|
||||
/// Default `LinkResolver`. Mirrors the conventions in SPEC.md §9:
|
||||
/// Default `LinkResolver`. Mirrors the vimwiki link conventions:
|
||||
/// wiki pages become `path.html`; interwiki links land in sibling
|
||||
/// directories; diary entries land under `diary/`; file/local schemes
|
||||
/// use their literal path; anchor-only links collapse to a fragment.
|
||||
|
||||
Reference in New Issue
Block a user