Major clean up and improvements to vimwiki compatibility and documentation.
CI / cargo fmt --check (push) Successful in 33s
CI / cargo clippy (push) Successful in 23s
CI / cargo test (push) Successful in 33s
CI / editor keymaps (push) Successful in 1m25s

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2026-05-30 18:35:40 +00:00
parent 95645a2b91
commit 8ab6015405
71 changed files with 2496 additions and 1914 deletions
+1 -3
View File
@@ -1,6 +1,4 @@
//! Block-level AST nodes and their supporting types.
//!
//! See SPEC.md §6.4.
use super::inline::InlineNode;
use super::span::Span;
@@ -17,7 +15,7 @@ pub enum BlockNode {
DefinitionList(DefinitionListNode),
Table(TableNode),
Comment(CommentNode),
/// Vimwiki tag line — `:tag1:tag2:`. Phase 12 (v1.1). The placement
/// Vimwiki tag line — `:tag1:tag2:`. The placement
/// rule (file / heading / standalone) is captured in `TagScope` so
/// LSP handlers and renderers can treat the three differently.
Tag(TagNode),
+1 -1
View File
@@ -1,6 +1,6 @@
//! Inline AST nodes.
//!
//! See SPEC.md §6.4. The link-related variants (`WikiLink`, `ExternalLink`,
//! The link-related variants (`WikiLink`, `ExternalLink`,
//! `Transclusion`, `RawUrl`) wrap structs defined in `super::link`.
use super::link::{ExternalLinkNode, RawUrlNode, TransclusionNode, WikiLinkNode};
+1 -1
View File
@@ -1,6 +1,6 @@
//! Link-related AST nodes and supporting types.
//!
//! See SPEC.md §6.4. All nodes here are inline (`InlineNode` variants);
//! All nodes here are inline (`InlineNode` variants);
//! they live in their own module because the link model has enough surface
//! area (kinds, anchors, interwiki indirection) to warrant separation.
+4 -5
View File
@@ -1,7 +1,7 @@
//! AST types for nuwiki documents.
//!
//! Types here are syntax-agnostic — both vimwiki and (eventually) markdown
//! produce the same node shapes. See SPEC.md §6.4.
//! produce the same node shapes.
pub mod block;
pub mod inline;
@@ -28,7 +28,7 @@ pub use visit::{
walk_table, walk_table_row, Visitor,
};
/// Root of an AST. See SPEC.md §6.4.
/// Root of an AST.
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct DocumentNode {
pub span: Span,
@@ -37,8 +37,7 @@ pub struct DocumentNode {
}
/// Document-level placeholders parsed from `%title` / `%nohtml` / `%template`
/// / `%date` directives, plus the v1.1 file-level tag accumulator
/// (SPEC §12.3). See SPEC.md §9.
/// / `%date` directives, plus the file-level tag accumulator.
///
/// New fields are added at the bottom; consumers should construct with
/// `..Default::default()` to stay forward-compatible.
@@ -48,7 +47,7 @@ pub struct PageMetadata {
pub nohtml: bool,
pub template: Option<String>,
pub date: Option<String>,
/// File-scope tags parsed by the v1.1 tag lexer (Phase 12). Convenience
/// File-scope tags parsed by the tag lexer. Convenience
/// projection of the `BlockNode::Tag` nodes whose scope is `File`.
pub tags: Vec<String>,
}
+1 -1
View File
@@ -1,6 +1,6 @@
//! Source positions and spans carried on every AST node.
//!
//! See SPEC.md §6.5. Positions are 0-indexed; `column` is a byte offset
//! Positions are 0-indexed; `column` is a byte offset
//! within a line; `offset` is a byte offset from the start of the document.
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
+2 -2
View File
@@ -5,10 +5,10 @@
//! Override any method to short-circuit or augment traversal — call the
//! matching `walk_*` from your override to keep descending.
//!
//! Pattern follows `rustc`'s and `syn`'s visitors. See SPEC.md §6.4 + P4.
//! Pattern follows `rustc`'s and `syn`'s visitors.
//!
//! Read-only for now. A `VisitorMut` flavor can be added when transformations
//! become relevant (post-Phase 5).
//! become relevant.
use super::block::{
BlockNode, BlockquoteNode, CommentNode, DefinitionItemNode, DefinitionListNode, ErrorNode,