Skip to main content

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

  • DerivedBlock class — One derived block: its role and its [start, end) span of the body.
  • block_link_targets function — A derived block's fingerprint for the render filter: its link targets as Pandoc hands
  • derived_blocks function — Classify a body's derived blocks under its source profile.
  • find_chrome_includes function — Site-chrome include lines: a line holding only {{< include PATH >}} whose PATH is one
  • find_hand_toc function — The hand table of contents: the FIRST run of two or more anchor-link list lines at
  • find_series_callouts function — The series callout(s): a top-level ::: {.callout-tip} whose first line is a surveyed
  • find_series_nav_lines function — Hand series-navigation lines: a heading holding only Previous: / Next: and links.
  • include_target function — A chrome include's fingerprint for the render filter: the partial it includes (the
  • mask_blocks function — The body a relation harvest reads: derived blocks contribute no edges (253ac996 (4)).
  • quarto_derived_blocks function — The Quarto archive profile: series callouts, the hand TOC, hand series-nav lines, the

cjm_markdown_decompose_core.extract

  • corpus_index_files function — Every <dir>/index.md or <dir>/index.qmd under the root, one per post directory.
  • note_from_file function — Read a Markdown file and map it to a coarse NoteNode.
  • note_from_parsed function — Build a coarse NoteNode from already-parsed Markdown.
  • note_from_text function — Parse + map in one step from in-memory text (hashes the UTF-8 bytes).
  • note_type_from function — Read the memory category from metadata.type (None when absent).
  • slug_from function — Derive the stable slug: frontmatter name if present, else the path.
  • title_from function — Derive a display title: explicit frontmatter title, else the slug titleized.

cjm_markdown_decompose_core.ingest

  • corpus_graph_elements function — Collect notes into the node + edge wire-dict lists extend_graph expects.

cjm_markdown_decompose_core.parse

  • ParsedMarkdown class — The structural decomposition of one Markdown document.
  • extract_headings function — Extract ATX headings (#..######) as (level, text) pairs.
  • extract_wiki_links function — Extract [[wiki-link]] targets from the body, de-duplicated, order-preserved.
  • fenced_code_spans function — Locate fenced code blocks (``` / ~~~) as character spans of the body.
  • find_headings function — The body's ATX heading matches, skipping every line inside a fenced code block.
  • parse_frontmatter function — Parse frontmatter YAML into a dict (empty dict when absent).
  • parse_markdown function — Parse a Markdown document into frontmatter + body + wiki-links + headings.
  • split_frontmatter function — Split a leading ----delimited YAML frontmatter block from the body.
  • strip_code function — Blank out fenced + inline code spans (replaced with a space, length-agnostic).

cjm_markdown_decompose_core.project

  • first_sentence function — A deterministic terse hook: the description's first sentence, capped.
  • note_index_line function — Render one index line from a note's frontmatter-derived fields.
  • note_text_from_graph_nodes function — Reconstruct a note's file text FROM the graph (frontmatter_raw + ordered raw spans).
  • note_view_from_graph_node function — Reconstruct an index-relevant NoteNode from a queried graph node.
  • render_memory_index function — Render a MEMORY.md index: notes grouped by category, one line each.
  • render_memory_index_from_graph_nodes function — Render the memory index FROM queried graph nodes (the self-hosting path).
  • render_note_text function — Reassemble a note's exact file text from its verbatim parts (lossless mode).
  • render_onboarding_surface function — Render the onboarding surface: orientation + how-to-query + resident PUSH core + landmark map + how-to-pull.

cjm_markdown_decompose_core.relations

  • NoteRelations class — The harvested relationship signals for one note (beyond [[wiki-links]]).
  • detect_profile function — Detect the source-type profile from the frontmatter shape.
  • harvest_aliases function — Harvest aliases (old URLs) -> bare permalinks (alternate identities).
  • harvest_categories function — Harvest categories -> normalized Topic keys (the thematic-clustering facet).
  • harvest_relations function — Harvest a note's relationships using its (detected or given) source profile.
  • harvest_site_links function — Harvest every in-body link to a site PAGE -> its VERBATIM target (ruling d31e9ba7).
  • is_page_target function — A link to a page, not to a file: an image, video or download beside a post is never a
  • is_site_link function — A link into the site: relative or rooted, or an absolute URL on the site's own host.
  • normalize_permalink function — Reduce a post link to its bare permalink — the path AFTER posts/.
  • quarto_site_url function — The site URL of the Quarto project a file belongs to (ruling 260119bf).
  • slugify function — Normalize a category/tag to a stable key (lowercased, separators collapsed).

cjm_markdown_decompose_core.sections

  • decompose_sections function — Decompose a body into ordered SectionNodes (heading-delimited).
  • heading_anchor function — 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

Metadata

Release files for cjm-markdown-decompose-core 0.0.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cjm-markdown-decompose-core 0.0.15
File Size Uploaded
cjm_markdown_decompose_core-0.0.15.tar.gz 45.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cjm-markdown-decompose-core 0.0.15
File Interpreter ABI Platform
cjm_markdown_decompose_core-0.0.15-py3-none-any.whl Python 3 none any Details

Total release size: 80.9 kB

Release files / cjm_markdown_decompose_core-0.0.15.tar.gz

Download URL cjm_markdown_decompose_core-0.0.15.tar.gz
Size 45.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1a3035cbc831ce922c09f6e677f0bfd1c89d6c40bbbc6e6d76f30c2de43aee0f
BLAKE2b-256 checksum
How to use checksums
54bd559e201806a3b040caeb049cff7e974fdcb3473f814031dce45d4a6d6301
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.15-py3-none-any.whl

Download URL cjm_markdown_decompose_core-0.0.15-py3-none-any.whl
Size 35.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9c3f7f653022af571186e7abfb5588360d46357e009cc3ed61753b0dc0b92fb
BLAKE2b-256 checksum
How to use checksums
634edd3905c4531d97b259a02c9146d76ea064d69f607312f89d9122bccbd3f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

This release

0.0.15 This release

2 release files

0.0.14

2 release files

0.0.13

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page