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.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.extract

  • 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_cross_post_links function — Harvest /posts/... markdown links -> (permalink, section anchor) pairs.
  • harvest_relations function — Harvest a note's relationships using its (detected or given) source profile.
  • harvest_series_links function — Harvest /series/... markdown links -> series keys (the membership signal).
  • normalize_permalink function — Reduce a post link to its bare permalink — the path AFTER posts/.
  • 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cjm_markdown_decompose_core-0.0.12.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cjm_markdown_decompose_core-0.0.12-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file cjm_markdown_decompose_core-0.0.12.tar.gz.

File metadata

File hashes

Hashes for cjm_markdown_decompose_core-0.0.12.tar.gz
Algorithm Hash digest
SHA256 0fdf6fd12f601c50c7f693bada43d9728e110b0ad2bc2915324472c8000ae58d
MD5 986ef58bd37e337c84a3b9d818279658
BLAKE2b-256 27bedc9df9375eebb7c64ef19b14dc6e1b8e9bd73392c13c1ee8ee38252ad41c

See more details on using hashes here.

File details

Details for the file cjm_markdown_decompose_core-0.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_markdown_decompose_core-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 38c29fc312f19cd6c307854a0c4f7f378467cfd99afb30dbbb2e72f59f351d8c
MD5 ccf118d37f6c320a360d0b1ed0596423
BLAKE2b-256 2103612c46ef18f8b0be665986278bf2979d9b32d24e1a3c2d3af535f1fe2604

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 files

0.0.11

2 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