notation_site library
A site of notation files held in memory (pages/.txt, components/.txt,
site.json): read and expanded by the rules of the command-line
expand <site folder>, with no file system.
Classes
- NotationSiteExpander
-
Expands a site's files with what the site and a design system give them
(see the library's comment), as the tool's
NotationExpanderdoes. - NotationSiteFiles
- A site's files as the expander reads them.
- OverlayScoping
- What scopeOverlays did and what it could not do.
Constants
- notationAppStatePath → const String
-
The path of an app's state file as a project keeps it (at its root,
beside
pages/andcomponents/): the state every page and component shares, asstatelines (readNotationAppState). - notationBuiltKey → const String
-
The key of a manifest that says what
expandwrote in it:{"all": true}for a manifest written whole (the site has none of its own), or{"variables": [names]}for the variables written from app.txt into the site's own manifest. What it names is not the site's source. - notationSiteDefaults → const NotationSiteSettings
-
The settings
expand <site folder>has with no flag: pages 1440 wide. - notationSiteManifestPath → const String
- The path of a site's manifest as a project keeps it (at its root).
Functions
-
isOverlayEvent(
String? event) → bool -
Whether
eventis one scopeOverlays gave a component. -
notationBuiltManifest(
{required Json? source, required List< String> pages, required Map<String, Json> appVariables}) → Json? -
The manifest
expandwrites for a site whose shared state is in app.txt, which a render reads its variables from:source(the site's own manifest; null: none, and the manifest listspages, the page ids in order) withappVariables(app.txt's, as NotationSiteFiles.appVariables) among its variables, marked as written (notationBuiltKey). Null when there is nothing to write: a manifest of the site's own and no state in app.txt. -
notationCallsIn(
String text, Set< String> types) → Set<String> -
The names of
typesthattextcalls: a line written with one as its word (Card#c "…",Card.compact), ortype=Card. -
notationComponentType(
String text) → String? -
The type a component's notation text declares (
component Name "…", its first line that is not blank or a comment); null when it is not one. -
notationIsDefinitions(
String text) → bool -
Whether
textis definitions: its first line that is not blank or a//comment starts withdefineorprimitive. -
notationPageOrder(
Iterable< String> names) → List<String> -
The page ids
namesin the order a site with no listed pages shows them:homefirst, then the others by name. -
notationSitePath(
String path) → String -
pathwith/between its parts and none before the first. -
notationSiteVariables(
Object? manifestVariables, NotationAppState? app, {void say(int line, String message)?}) → Map< String, Json> -
The variables a site's pages read: the manifest's (
manifestVariables, itsvariablesas written) and app.txt's (app, null: no such file), as NotationOptions.projectVariables takes them. A name both declare is app.txt's, and said insayat its line of app.txt. -
notationSourceManifest(
Json manifest) → Json? -
manifest(a site.json as read) as the site's source: without whatexpandwrote in it (notationBuiltKey). Null when all of it was (the site has no manifest of its own). -
notationUndeclaredNames(
Json document, {required String text, Set< String> known = const {}, Iterable<String> ? others, List<String> ? drawing}) → List<String> -
The names
document(a page or a component as expanded) reads, sets or binds in its expressions thatknowndoes not hold and the document does not declare with a line of its own (textis its notation: a name with astateline there is declared): what the app's state file still has to declare for the page to show it. In the order first read. -
pageScopedId(
String id, String page) → String -
The id page
page's overlayidis given when it is made the page's own:nav--board. -
scopeOverlays(
List< ScopedPage> pages, List<ScopedComponent> components, {Map<String, ({Json document, String path})> otherComponents = const {}}) → OverlayScoping -
Makes the overlays of
pagesthat two or more pages write with one id and draw differently each page's own, and what names them follow (see the head of this file).componentsare the site's notation components (changed too);otherComponentsthe types of the site's components that are not (JSON ones): anopenof a per-page overlay in one of those is said.pagesandcomponentshold documents changed in place. -
unscopeOverlays(
Json document) → Json -
documentas its notation wrote it, before scopeOverlays: a page's overlays made its own named as written again (and what names them), a component's events for them its actions again, and the calls' reactions to those events gone.documentitself when it has none of them. -
writtenOverlayId(
String id, String page, Json? canvas) → String? -
The id as written of canvas
idof a page whose canvas ispagewhen it is one made the page's own (pageScopedId) and its nodecanvaskeeps the written id as its name; else null.
Typedefs
-
ExpandedNotationSite
= ({Map<
String, NotationResult> componentResults, List<ScopedComponent> components, List<ScopedPage> pages, List<NotationResult> results, OverlayScoping scoping}) - A site expanded whole (NotationSiteExpander.expandAll).
- NotationComponentSource = ({String path, String text, String type})
-
A component written in the notation: its type (the name on its
componentline), its file and its text. - NotationSiteProblem = ({int? line, String message, String path})
- Something of a site's file that is not read, or must be said: the file, its line when it has one, and what to write.
- NotationSiteSettings = ({bool named, bool nearestColors, bool open, bool reflow, NotationVocabulary vocabulary, double width})
- How NotationSiteExpander expands each file: the tool's flags.
- ScopedComponent = ({Json document, String path, String type})
- One notation component of a site: its type, its source file and its document (changed in place).
- ScopedPage = ({Json document, String name, String path})
- One page of a site: its name (its canvas id), its source file and its document (changed in place).