cjm-markdown-decompose-core
A Markdown decomposition core for context graphs: parses Markdown content (frontmatter, structure, and [[wiki-links]]) into provenance-carrying graph nodes and edges. First source = the ecosystem's own memory/decision files; generalizes to any Markdown corpus.
Modules
cjm_markdown_decompose_core.__init__cjm_markdown_decompose_core.blocks— Embedded DERIVED blocks: spans of a body that are not the document's own content.cjm_markdown_decompose_core.extract— Map parsed Markdown onto dev-graph-schema nodes (coarse tier).cjm_markdown_decompose_core.ingest— Flatten decomposed notes into graph elements for idempotent extension.cjm_markdown_decompose_core.parse— Schema-free Markdown parsing (stdlib + PyYAML).cjm_markdown_decompose_core.project— Projections from the decomposed content back out to files.cjm_markdown_decompose_core.relations— Per-source-type relationship harvesting from parsed Markdown.cjm_markdown_decompose_core.sections— Decompose a Markdown body into ordered Section nodes (the navigable unit).
API
cjm_markdown_decompose_core.blocks
DerivedBlockclass — One derived block: its role and its[start, end)span of the body.FencedBlockclass — One content div whose headings open no Section (ruling d5442ba8 on finding 67a54d21):block_link_targetsfunction — A derived block's fingerprint for the render filter: its link targets as Pandoc handsderived_blocksfunction — Classify a body's derived blocks under its source profile.fenced_block_partsfunction — A fenced block's typed parts (ruling d5442ba8 (1)/(2)), derived from the text at read,fenced_blocksfunction — Classify a body's fenced blocks under its source profile.find_chrome_includesfunction — Site-chrome include lines: a line holding only{{< include PATH >}}whose PATH is onefind_hand_tocfunction — The hand table of contents: the FIRST run of two or more anchor-link list lines atfind_series_calloutsfunction — The series callout(s): a top-level::: {.callout-tip}whose first line is a surveyedfind_series_nav_linesfunction — Hand series-navigation lines: a heading holding onlyPrevious:/Next:and links.include_targetfunction — A chrome include's fingerprint for the render filter: the partial it includes (themask_blocksfunction — The body a relation harvest reads: derived blocks contribute no edges (253ac996 (4)).quarto_derived_blocksfunction — The Quarto archive profile: series callouts, the hand TOC, hand series-nav lines, thequarto_fenced_blocksfunction — The Quarto profile's fenced blocks: the tabset and callout divs whose headings open no
cjm_markdown_decompose_core.extract
corpus_index_filesfunction — Every<dir>/index.mdor<dir>/index.qmdunder the root, one per post directory.note_from_filefunction — Read a Markdown file and map it to a coarseNoteNode.note_from_parsedfunction — Build a coarseNoteNodefrom already-parsed Markdown.note_from_textfunction — Parse + map in one step from in-memory text (hashes the UTF-8 bytes).note_type_fromfunction — Read the memory category frommetadata.type(None when absent).slug_fromfunction — Derive the stable slug: frontmatternameif present, else the path.title_fromfunction — Derive a display title: explicit frontmattertitle, else the slug titleized.
cjm_markdown_decompose_core.ingest
corpus_graph_elementsfunction — Collect notes into the node + edge wire-dict listsextend_graphexpects.
cjm_markdown_decompose_core.parse
ParsedMarkdownclass — The structural decomposition of one Markdown document.absorbs_next_linefunction — Whetherlineleaves a block open that takes the next line as its own, so an ATX lineextract_headingsfunction — Extract ATX headings (#..######) as (level, text) pairs.extract_wiki_linksfunction — Extract[[wiki-link]]targets from the body, de-duplicated, order-preserved.fenced_code_spansfunction — Locate fenced code blocks (``` / ~~~) as character spans of the body.find_headingsfunction — The body's ATX heading matches, skipping every line inside a fenced code block.parse_frontmatterfunction — Parse frontmatter YAML into a dict (empty dict when absent).parse_markdownfunction — Parse a Markdown document into frontmatter + body + wiki-links + headings.split_frontmatterfunction — Split a leading----delimited YAML frontmatter block from the body.strip_codefunction — Blank out fenced + inline code spans (replaced with a space, length-agnostic).
cjm_markdown_decompose_core.project
compose_note_textfunction — Compose a note's text from its Sections' own state walked by the outline relations.element_statefunction — An element's own STATE as a graph-sourced note journals it (design amendment 56b24fd5first_sentencefunction — A deterministic terse hook: the description's first sentence, capped.note_index_linefunction — Render one index line from a note's frontmatter-derived fields.note_text_from_graph_nodesfunction — Reconstruct a note's file text FROM the graph (frontmatter_raw + ordered raw spans).note_view_from_graph_nodefunction — Reconstruct an index-relevantNoteNodefrom a queried graph node.render_memory_indexfunction — Render aMEMORY.mdindex: notes grouped by category, one line each.render_memory_index_from_graph_nodesfunction — Render the memory index FROM queried graph nodes (the self-hosting path).render_note_textfunction — Reassemble a note's exact file text from its verbatim parts (lossless mode).render_onboarding_surfacefunction — Render the onboarding surface: orientation + how-to-query + resident PUSH core + landmark map + how-to-pull.section_outlinefunction — The outline relations of decomposed Sections, keyed by Section id -- the same
cjm_markdown_decompose_core.relations
NoteRelationsclass — The harvested relationship signals for one note (beyond[[wiki-links]]).detect_profilefunction — Detect the source-type profile from the frontmatter shape.harvest_aliasesfunction — Harvestaliases(old URLs) -> bare permalinks (alternate identities).harvest_categoriesfunction — Harvestcategories-> normalized Topic keys (the thematic-clustering facet).harvest_relationsfunction — Harvest a note's relationships using its (detected or given) source profile.harvest_site_linksfunction — Harvest every in-body link to a site PAGE -> its VERBATIM target (ruling d31e9ba7).is_page_targetfunction — A link to a page, not to a file: an image, video or download beside a post is never ais_site_linkfunction — A link into the site: relative or rooted, or an absolute URL on the site's own host.normalize_permalinkfunction — Reduce a post link to its bare permalink — the path AFTERposts/.quarto_site_urlfunction — The site URL of the Quarto project a file belongs to (ruling 260119bf).slugifyfunction — Normalize a category/tag to a stable key (lowercased, separators collapsed).
cjm_markdown_decompose_core.sections
decompose_sectionsfunction — Decompose a body into orderedSectionNodes (heading-delimited).heading_anchorfunction — Slugify a heading to its anchor — the Pandoc/Quarto auto-identifier shape.
Dependencies
Depends on: cjm-context-graph-layer, cjm-context-graph-primitives, cjm-dev-graph-schema, pyyaml
Used by: cjm-context-graph-projection, cjm-notebook-decompose-core, cjm-substrate
Metadata
Release files for cjm-markdown-decompose-core 0.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cjm_markdown_decompose_core-0.0.17.tar.gz | 54.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cjm_markdown_decompose_core-0.0.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 96.1 kB
Release files / cjm_markdown_decompose_core-0.0.17.tar.gz
| Download URL | cjm_markdown_decompose_core-0.0.17.tar.gz |
|---|---|
| Size | 54.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0032b46bb32197d6f6f15a114c9b7da326c54fd4cb2de78d39712527ec1dbdd7
|
|
BLAKE2b-256 checksum How to use checksums |
6307fb8fcb796eb493a3ab6d9986381800d1036b76e1be354050d8a5d7ab383a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / cjm_markdown_decompose_core-0.0.17-py3-none-any.whl
| Download URL | cjm_markdown_decompose_core-0.0.17-py3-none-any.whl |
|---|---|
| Size | 41.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1625d940d3b6ae364a4a34c09986cb839e32ca4f42406bdfa97c7d651a7314c7
|
|
BLAKE2b-256 checksum How to use checksums |
7bf31dc6aa65f145b554a4348bef1653721279b3916664a8c3b2d731addc5f49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|