Skip to main content

Module refactor

Module refactor 

Source
Expand description

Knowledge refactoring, concept relocation, deletion, splitting, and merging.

Refactoring a concept graph requires maintaining link integrity across the entire bundle:

  • move_concept: Moves/renames a concept, rewrites all incoming backlinks across the bundle, and rebases outgoing relative links and frontmatter paths.
  • remove_concept: Safely deletes a concept, checking for inbound links and optionally redirecting or unlinking them.
  • split_concept: Extracts a section/heading into a new concept, moves relevant footnote citations/sources, and links to the new concept.
  • merge_concepts: Consolidates two concepts, merging bodies, sources, and verification events, while redirecting incoming backlinks.

Re-exports§

pub use crate::log::append_log_entry;
pub use crate::markdown::LinkRewriteAction;
pub use crate::markdown::heading_slug;
pub use crate::markdown::matches_heading;

Structs§

MergeOptions
Options for merging one concept into another.
MergeReport
Summary report of a merge operation.
MoveOptions
Options for moving or renaming a concept.
MoveReport
Summary report of a move/rename operation.
RemoveOptions
Options for removing a concept.
RemoveReport
Summary report of a removal operation.
RenameSectionOptions
Options for renaming a section heading within a concept.
RenameSectionReport
Summary report of a section rename operation.
SplitOptions
Options for splitting a concept section into a new concept.
SplitReport
Summary report of a split operation.

Enums§

RefactorError
Error returned when a refactoring operation fails.

Functions§

compute_relative_path
Computes the relative markdown link path from from_concept to to_concept.
merge_concepts
Merges source concept into target concept and deletes source.
move_concept
Moves or renames a concept, rewriting all incoming links and rebasing outgoing links.
rebase_relative_path
Rebases a relative file/resource path from old_dir to new_dir.
remove_concept
Safely removes a concept from the bundle.
rename_section
Renames a section heading within a concept and updates all internal and external anchor links.
split_concept
Splits a section from an existing concept into a new concept.