Implementations
Markdown (basic)
- class xettel.impl.markdown.ZettelMD.ZettelMD(parent: Zettelkasten, filename: str)
Example class for markdown-formatted zettels.
Such a Zettel may have a Jekyll-style YAML frontmatter, as compatible with pandoc.
Links are assumed to be of the format ‘[#$UID]’ where $UID is either a 12-char long numering string or a 8-char long alphanumeric string.
Files are expected to end in ‘.md’.
- static export(zettel: xettel.base.ZAbstract.ZettelAbstract, force: bool = False) None
Export the Zettel to HTML
- get_indexing_function(key: str) Callable[[xapian.Document, xapian.TermGenerator, Any], None]
Returns the function needed to index data from the attributes given a lowered and whitespace-stripped (as in str.strip()) key.
Functions returned by this method must have the following signature:
(xapian.Document, xapian.TermGenerator, value) -> None
.- Parameters
key (str) – the key to the indexing function
- Returns
The indexing function corresponding to the key.
- static issue_export_cmd(source: str, dest: str, env: dict[str, str], zinfo: dict[str, str]) None
Execute the command to export Zettels.
The abstract method defined here does nothing.
- parse_links(links=[]) None
Parses links in the file, according to the format specified above.
- Keyword Arguments
links (Collection[int]) – unused argument, here so that typechecking passes.
- classmethod set_queryparser_prefixes(queryparser: xapian.QueryParser) None
Sets the prefixes for searching the metadata defined by this class into the queryparser.
The method defined here does nothing.
- Parameters
queryparser (xapian.QueryParser) – the queryparser to feed information to.
Xapian
ZettelX
- class xettel.impl.xapian.ZettelX.ZettelX(parent: ZettelkastenX, doc: xapian.Document, id: int)
- Parameters
parent (ZettelkastenX) – the parent Zettelkasten to this Zettel
doc (xapian.Document) – the Xapian document from which Xettel will reconstruct the Zettel
id (int) – Xapian id of the document.
ZettelkastenX
- class xettel.impl.xapian.ZettelkastenX.ZettelkastenX(folder: str)
Rebuilds a Zettelkasten from a xapian database.
- Parameters
folder (str) – path to the folder where Zettel files are stored.
- classmethod from_db(db: xapian.Database, folder: str) xettel.impl.xapian.ZettelkastenX.ZettelkastenX
Constructs a Zettelkasten from the whole database.
- Parameters
db (xapian.Database) – the Xapian database from which xettel will retreive the Zettels.
folder (str) – path to the folder where Zettel files are stored.
- Returns
A completely reconstructed Zettelkasten
- classmethod from_mset(mset: xapian.MSet, folder: str) xettel.impl.xapian.ZettelkastenX.ZettelkastenX
Constructs a partial Zettelkasten with MSet matches.
- Parameters
mset (xapian.MSet) – a MSET from which xettel will reconstruct a Zettelkasten.
folder (str) – path to the folder where Zettel files are stored.
- Returns
A partially reconstructed Zettelkasten