Compose a key by joining string parts together using a separator. Example:
compose('/')(['year', 'month'])
Create a scratch note Example:
createScratchNote('year/month', '2021/07')
Or with a link:
createScratchNote('prog/language', 'TypeScript', 'https://en.wikipedia.org/wiki/TypeScript')
Create a scratch note using a composer Example:
const slash = compose('/');
newScratchNote(slash)(['year', 'month'], '2021/07');
Or with a link:
newScratchNote(slash)(['prog', 'language'], 'TypeScript', 'https://en.wikipedia.org/wiki/TypeScript')
Logical AND on two or more matchers Example:
const query = and([withPrefix('year'), withSuffix('day')]);
Logical NOT on a matcher Example:
const query = not(withPrefix('fish'));
Logical OR on two or more matchers Example:
const query = or([withPrefix('fish'), withPrefix('bird')]);
Matcher for an id that matches exactly at least one of several text fragments Example:
const query = withAnyExactly(['year/month', 'year/week']);
Matcher for an id that starts with at least one of several prefixes Example:
const query = withAnyPrefix(['year/month', 'year/week']);
Matcher for an id that ends with at least one of several suffixes Example:
const query = withAnySuffix(['/available', '/cheap']);
Matcher for an id that includes at least one of several text fragments Example:
const query = withAnyText(['_blue', '_red']);
Matcher for an id that matches exactly a given text Example:
const query = withExactly('year/month/day');
Matcher for an id that starts with a prefix Example:
const query = withPrefix('year/month');
Matcher for an id that ends with a suffix Example:
const query = withSuffix('/day');
Matcher for an id that includes a given text Example:
const query = withText('_name');
Filter a scratch book based on a composable matcher Example:
const query = and([withPrefix('year'), withSuffix('day')]);
const specificScratchBook = filterScratchBook(query)(mainScratchBook)
Merge several scratch books into one. The notes will be sorted by id and unique. Example:
const globalScratchBook = mergeScratchBooks([fishScratchBook, birdScratchBook])
Search the notes of by their id and remove duplicate notes. Two notes are a duplicate if all their fields (id, text, url) are the same. Example:
const orderedScratchBook = sortScratchBook(messyScratchBook)
Generated using TypeDoc
Scratch Book is an annotation library written in Typescript that makes it easy to write documentation in a decentralized fashion