novident_project_manager library
Public API of novident_project_manager.
Exposes the schema layer (typed models and codecs), the stores and their I/O contracts, the reducer, the schema registry/migration, and the compiler (layout/editor → AST parsers and the AST model).
Classes
- Author
-
Author block of the project metadata (
files/metadata.json→author). - Backup
-
Backup manifest (
files/backup.json): a compact mirror of the binder with a checksum. Generated on save, never user-edited. - BackupDocument
-
{n, p, x?}— name, parent id, trashed flag (only present when true). - BackupExternal
-
{n, a}— name and the node id it is attached to. - BackupFolder
-
{n, t, p, c}— name, folder type, parent id (null at top level), children. - BackupTree
-
Compact tree mirror. The on-disk entry keys are single letters (
n/t/p/c/x/a); the Dart fields use descriptive names and the codec maps them so the serialized form stays byte-compatible with the format. - Binder
- The decoded binder: project identity + the root folder tree, plus the flat metadata the file carries alongside it: the external-files map (kept up to date by the caller and written back on BinderCodec.encode).
- BinderActions
-
Binder tree operations (the tree lives in a
Folderroot). - BinderCodec
-
Maps the
.novbinder (indexation/binder.index.json) to/from thenovident_document_formattree (Folder/Document/DocumentResource). - BinderCounts
-
Recomputes structural node counts by walking the binder
rootonce. - BinderIo
-
I/O boundary for the binder (
indexation/binder.index.json). - BinderStore
- Stateful host of the binder tree.
- Book
-
Book/publication metadata (
bookblock): title-page and bibliographic info used when compiling (PDF/LaTeX/EPUB) and by the placeholder rules (<$projecttitle>,<$abbr_title>,<$iscode>). - CollectionIo
-
I/O for a collection directory: one JSON file per item, keyed by an
identifier (an
idor a date, depending on the collection). -
CollectionStore<
T> - Lazy host (not a cache with eviction) of one collection directory.
- Column
-
A single column inside a Columns group (editor
columnblock). - Columns
-
A columns group in the AST (editor
columnsblock): a list of Columns rendered side by side. - Comment
- A single anchored comment.
- Comments
-
Inline comments of a node (
files/<id>/comments.json). - CompileDefaults
- Compilation defaults: which format and output type are used by default.
- CompilerIo
- I/O boundary for the compiler store (formats + layouts).
- ConflictResolution
- A merge-conflict resolution choice (tagged enum from Rust serde).
-
Content<
T extends Object?> - ContentCodec
-
Thin typed wrapper around
novident_editor_document'sDocument. - ContentParser
-
Converts a
novident_editor_documentDocumentinto the AST content model. - Context
- Corkboard
- Visual state persisted for one binder element shown on a corkboard.
- CorkboardIndex
-
Corkboard visual state (
indexation/corkboard.index.json). - CorkboardValues
- CountAdjustment
- A manual, incremental count adjustment.
- CustomSeparatorStrategy
- A separator that writes user-supplied content.
- Divider
-
A divider block in the AST (editor
dividerblock). It carries no value and is never merged. - DocumentCache
- On-demand, LRU-bounded document content cache with debounced writes.
- DocumentIo
-
I/O boundary for document content (
content.json). - DocumentPage
- EditorPreferences
- Editor preferences (panels visibility, base style, page width, theme).
-
Embed<
T> - EmptyLineSeparatorStrategy
- A separator that writes a single new line, breaking the current line so the next content starts on a fresh one.
- EngineClient
- Typed wrapper over the generated FRB binding.
- Export
-
Record of a performed compilation export (
compiler/exports/<id>.json). - ExportConfig
- Options of an export run.
- ExternalFile
-
Metadata of one external file (
binder.index.json→external_files). - Format
-
A compilation format (
compiler/formats/<id>.json). - FormatStore
- Lazy host (not a cache) of all compilation formats and their layouts.
- Freeform
- FreeformViewport
- FreeformWorld
- GitBranchInfo
- A branch summary.
- GitCommitDiff
- Diff introduced by a commit.
- GitCommitInfo
- A commit in the history log.
- GitConflictInfo
-
A single conflicted file reported by
git_conflict_detect. - GitCredentials
- Git credentials (commit author and/or remote auth).
- GitFileDiff
- Per-file diff inside a commit diff.
- GitMergeResult
- Result of a merge/pull (tagged enum from Rust serde).
- GitRemoteInfo
- A configured git remote and its URL.
- GitStatusEntry
- A git working-tree status entry.
- GitTreeDiff
-
Structural document diff (
TreeDiff) returned by the engine. -
Running headers/footers used when compiling. Values are token strings
(
<$doctitle>,<$n>,<$page>, …). - IconIndex
-
Icon rules (
indexation/icon.index.json). - IconRule
-
The icon for a node type (in
defaults) or for a single node id (inoverrides).variationsmaps an expression (exp:/state:, see the format spec §9) to the icon name that replaces the base one when true. - Image
- Layout
- Layouts provide centralized control over document presentation by defining formatting rules for different content sections (title, metadata, synopsis, etc.). When applied to documents, these layouts automatically enforce consistent styling without manual formatting effort.
- LayoutCompiler
- External Layout → AST compiler.
- LayoutDocument
- LayoutSection
- Configuration of one layout part (title, metadata, synopsis, notes or text): whether it is shown, whether it overrides editor formatting, its heading and its SectionAttributes.
- LayoutSectionBuilder
- External conversion of a LayoutSection into AST content.
- LayoutSectionManager
- Holds the five LayoutSections of a layout: title, metadata, synopsis, notes and text. Each section decides whether it is shown and how it is styled during compilation.
- LayoutSeparator
- A separator strategy inserted between pieces of compiled content.
- LayoutSettingsIndent
-
Indentation settings of a layout's
settingsblock. - ListItem
-
A list item in the AST, mirroring an editor list block
(
bulleted_list/numbered_list/todo_list). - LookupEntry
-
Flat entry of the binder
lookup: id → position metadata. -
LruCache<
K, V> - A minimal LRU cache backed by a LinkedHashMap (insertion order = recency).
- Margins
- Page margins in the format's units.
- Metadata
-
Global project metadata (
files/metadata.json). - NewLine
- NewPageOptions
- Page-break behavior of a layout: how many empty lines are written before the content and how many leading characters are uppercased after the break.
- NewPageOptionsBuilder
- External conversion of NewPageOptions into AST page-break content.
- NodeCounts
- Aggregated structural counts computed from the binder tree.
- NodeTarget
- The writing target that applies to one node.
- NovidentConstants
- NovidentProjectDefaults
- This class contains all the default variables that are used when some values are not passed by the user or something fails and these are used to avoid exception calls
-
ObjectValue<
T> - Mutable holder for a value (used so counters can be shared and updated).
- PageBreakSeparatorStrategy
- A separator that breaks the page: the following content is written on a completely different page from the current one.
- PageSetup
-
Paper setup of a format (the
page_setupblock ofcompiler/formats/). - Paragraph
- PatternDefaults
- PlaceholderRules
- Immutable set of placeholder replacement rules, grouped by family.
- ProjectInfo
-
The
projectblock: identity, timestamps and cosmetic settings. - ProjectManager
-
The Dart
ProjectManager— the single entry point the app uses to talk to a.novproject. - ProjectMetadata
- Legacy publication metadata model.
- ProjectRules
- All the rules that must run every time we import or export a project.
- ProjectStatusResponse
- ReplaceAbbreviateTitlePlaceholderRule
- Gets replaced with the abbreviated project name during the Compile process. The abbreviated project name is taken from metadata pane of the Compile panel.
- ReplaceAuthorInfoPlaceholderRule
- Gets replaced with the author info during the Compile process.
- ReplaceCharacterCountPlaceholderRule
- Gets replaced during the Compile process with the total character count of the text currently being compiled.
- ReplaceDayPlaceholderRule
- ReplaceDocumentTitlePlaceholderRule
- Gets replaced with the document title name during the Compile process.
- ReplaceDoubleNumberingPlaceholderRule
- ReplaceHourFormatPlaceholderRule
- ReplaceHourPlaceholderRule
- ReplaceImagePlaceholderRule
- ReplaceISBNPlaceholderRule
- Gets replaced with the document title name during the Compile process.
- ReplaceLineCountPlaceholderRule
- Gets replaced with the line count of the document during the Compile process. If associated with an internal document link, the line count will show the number of lines in the linked document.
- Replacement
- A single find-and-replace pattern used during compilation.
- ReplacementsValues
- The replacement patterns of a Format.
- ReplaceMicrosecondsPlaceholderRule
- ReplaceMillisecondsPlaceholderRule
- ReplaceMinutePlaceholderRule
- ReplaceMonthPlaceholderRule
- ReplaceNumCountPlaceholderRule
- ReplaceProjectTitlePlaceholderRule
- Gets replaced with the project name during the Compile process. The project name is taken from the metadata pane of the Compile panel. If the placeholder appears in uppercase, the project name will be uppercased too.
- ReplaceRomanNumberPlaceholderRule
- ReplaceSecondsPlaceholderRule
- ReplaceSubNumCountPlaceholderRule
- ReplaceTodayPlaceholderRule
- ReplaceWeekdayPlaceholderRule
- ReplaceWordCountPlaceholderRule
- Gets replaced during the Compile process with the total word count of the text currently being compiled.
- ReplaceWordNumberPlaceholderRule
- ReplaceYearPlaceholderRule
- ResetPlaceholderInvokation
-
SchemaCollection<
T> - Codec binding for one collection directory: a role, the directory that holds one file per item, and the item's key field used for the file name.
-
SchemaFile<
T> - Codec binding for one top-level schema file: a logical role, its path relative to the project root, and a string-level codec (raw JSON in, raw JSON out) so the registry stays engine-agnostic.
- SchemaMigration
- One version bump of a schema file.
- SchemaMigrator
- Chains SchemaMigrations up to the current schema version.
- SchemaRegistry
-
Dart-side structural description of a
.novproject. - SearchIndexStatus
- Status of the in-memory search index.
- SearchMatch
- A quick-search match (document-level, offset in one plain-text field).
- SearchOptions
- Options controlling a search query.
- Section
- A writing section type (a category of material with its own layout).
- SectionAttributes
- Text/block attributes of a layout section.
- SectionManager
-
Runtime holder of the project sections: the list of Section types plus
the depth outline that resolves
structured-basednodes. - SectionsCodec
-
Maps
indexation/sections.index.jsonto/from the Dart section model (SectionManager+SectionTypeConfigurations). - SectionTypeConfigurations
- Outline configuration of the sections: for each content type (folder or document) a map of depth level → section id.
- SeparatorOptions
- Separator behavior of a layout: which LayoutSeparator is written before, between and after sections, plus two tuning flags.
- Session
-
A writing session (
history/<date>.json). - SessionDiff
- Difference between two history sessions.
- SessionFileCounters
- Counters for one node: originals are the values at session start, the unprefixed fields are the values at session end.
- SessionFileDelta
- Per-file counters delta between two sessions.
- SessionHistory
- Opens the current writing session, continuing it when one is still active.
- SessionMetadata
- SessionNodeMeasures
- Live word/character measures of one node when a session closes.
- SessionState
- State of the last editing session.
- SessionSummary
- The per-file counters + totals produced when a session ends.
- SessionTotal
- SingleReturnSeparatorStrategy
- A separator that writes nothing, letting the next document continue together with the previous content.
- SnapshotInfo
- Metadata for a stored project snapshot.
- Statistics
- Aggregated word/character statistics.
- StringContants
- StructuralMatch
- A full (structural) search match, resolved to the containing block.
- Synopsis
- SynopsisCodec
- Table
- TargetFile
- TargetGeneral
-
Project-wide goal, reused by
history/to measure distance to the target. - TargetIndex
-
Writing targets, global and per node (
indexation/target.index.json). - TargetResolver
- Resolves the effective writing target of any node.
- TextCount
-
Word/character counters, mirroring the editor's own
word_counter_service. - TextSpan
- TitleOptions
- Title prefix/suffix options of a layout.
- TitleOptionsBuilder
- External conversion of TitleOptions into AST paragraphs.
- ValidationIssue
- A single structural-validation issue.
- WordCounts
- Word totals grouped by tree region.
- WorldNode
Enums
- FolderType
- FormatScope
- Scope of a compilation format.
- LetterCase
- How the case of a string is transformed.
- Region
- The region of the tree a node lives in, for statistics.
- Selection
- TypePlaceholder
- ValidationSeverity
- Severity of a structural-validation issue.
Mixins
- Mergable
- PlaceholderRule
- This is the base ruler for all the placeholders
- ProjectRule
-
A structural rule that validates an opened project (its binder
Folderroot) before it is imported or exported.
Extensions
- CastNullableObject on Object?
- CastObject on Object
- EasyFolderType on FolderType
- FormatScopeExtension on FormatScope
- LayoutNewLinesExtension on String
-
ListExtension
on List<
T> -
MapExtension
on Map<
K, V> - NonNullableString on String?
- OrAltObjects on String?
- ProjectDeltaContentExtension on Document
-
Convenience extension that lets a compilation
Documentreplace its placeholder tokens (<$projecttitle>,<$n>,<$page>, dates, …) using the placeholder rules configured for the project. -
ShiftLevelsMapExtension
on Map<
String, String> - ShortStringExtension on String
- SpecialSourcesSearchExtension on ProjectManager
- StringStadistics on String
- UppercaseCaseStringExtension on String
Constants
- kCurrentSchemaVersion → const int
-
Version of the
.novschema this Dart layer reads and writes.
Functions
-
adjustSession(
Session session, {String? nodeId, required CountAdjustment adjustment}) → Session -
Returns a copy of
sessionwith an incrementaladjustmentapplied. -
adjustSessionTotal(
SessionTotal total, CountAdjustment adjustment) → SessionTotal -
Returns
totalwith theadjustmentapplied and its distance-to-target recomputed (never negative, progress clamped to 0.0–1.0). -
buildSessionSummary(
{required Map< String, SessionFileCounters> originals, required Map<String, SessionNodeMeasures> current, required int target, required int targetCharacters, String typeTarget = ''}) → SessionSummary - Builds the closing data of a writing session.
-
countEditorDocument(
Document document) → TextCount -
Counts the whole editor
Document(all blocks, recursively). -
countText(
String text) → TextCount -
Counts
textthe same way the editor's counter does. -
diffSessions(
Session from, Session to) → SessionDiff -
Compares two sessions (
fromearlier,tolater) and returns the delta. -
isUppercase(
String type) → bool -
sessionDateKey(
DateTime day) → String -
Session (history) file naming: one file per UTC day,
yyyy-MM-dd.
Typedefs
-
CustomNodeToContent
= List<
Content< Function(Node)Object?> >
Exceptions / Errors
- InvalidMoveException
- Thrown when a move would create a cycle or is otherwise not allowed.
- InvalidParentException
- Thrown when a node cannot be created / moved to the requested parent.
- NodeNotFoundException
- Thrown when an operation targets a node that does not exist in the tree.
- NodeTypeException
- Thrown when an operation cannot be applied to the resolved node type.
- SchemaTooNewException
-
Raised when a schema file declares a
schema_versionnewer than this layer understands. The file must not be opened for writing until the app is upgraded (a downgrade would corrupt it). - SchemaVersionGapException
- Raised when a schema file is older than current but no migration chain is registered to bring it up to date.