# rupakkumar-76319/fmjl architecture

> Architecture diagram of the GitHub repository rupakkumar-76319/fmjl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rupakkumar-76319/fmjl
- Repository: https://github.com/rupakkumar-76319/fmjl

## Overview

FMJL is a document-format and conversion toolkit for authoring Markdown and machine-oriented JSON Lines documents, with stable element IDs, hashes, page positions, and access metadata. Its main workflow is: a user converts or imports a document, checks and edits the resulting FMJL/Markdown forms, then exports it or creates RAG-ready chunks. The Python package implements conversion, validation, import, export, and retrieval features; the VS Code extension provides an editor-based conversion and checking path. Relationships for user-facing capabilities are based on README statements; source excerpts also show the extension’s converter and validator dependencies.

Main entry points: [`fmjl/__init__.py`](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py) (FMJL commands), [`examples/rag_demo.py`](https://github.com/rupakkumar-76319/fmjl/blob/main/examples/rag_demo.py) (RAG application), [`fmjl-vscode/src/extension.js`](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl-vscode/src/extension.js) (VS Code editor), [`fmjl-vscode/src/validator.js`](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl-vscode/src/validator.js) (Extension validator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_python["Python document toolkit"]
  node_cli["FMJL commands<br/>[__init__.py]"]
  node_mdconvert["Markdown converter<br/>[__init__.py]"]
  node_storage["FMJL document I/O<br/>[__init__.py]"]
  node_fill["Metadata fill<br/>[__init__.py]"]
  node_checker["Rule checker<br/>[__init__.py]"]
  node_viewer["Markdown view<br/>[__init__.py]"]
  node_upgrader["Version upgrade<br/>[__init__.py]"]
end

subgraph group_ingest["Document import"]
  node_pdfimport["PDF importer<br/>[pdf.py]"]
  node_docximport["Word importer<br/>[docx.py]"]
  node_export["Format export<br/>[export.py]"]
end

subgraph group_retrieval["RAG retrieval"]
  node_chunks["Chunk builder<br/>[__init__.py]"]
  node_changed["Changed chunks<br/>[__init__.py]"]
  node_rag["RAG application<br/>[rag_demo.py]"]
end

subgraph group_vscode["VS Code authoring"]
  node_vscode["VS Code editor<br/>[extension.js]"]
  node_jsconverter["Extension converter<br/>[converter.js]"]
  node_jsvalidator["Extension validator<br/>[validator.js]"]
end

node_user(("Document author"))

node_user -->|"runs commands"| node_cli
node_cli -->|"converts Markdown"| node_mdconvert
node_cli -->|"reads and writes"| node_storage
node_cli -->|"fills metadata"| node_fill
node_cli -->|"checks rules"| node_checker
node_cli -->|"renders view"| node_viewer
node_cli -->|"upgrades format"| node_upgrader
node_cli -->|"imports PDF"| node_pdfimport
node_cli -->|"imports Word"| node_docximport
node_cli -->|"exports formats"| node_export
node_cli -->|"builds chunks"| node_chunks
node_chunks -->|"loads rows"| node_storage
node_changed -->|"compares chunks"| node_chunks
node_rag -->|"loads documents"| node_storage
node_rag -->|"builds chunks"| node_chunks
node_rag -->|"finds changes"| node_changed
node_user -->|"edits documents"| node_vscode
node_vscode -->|"converts forms"| node_jsconverter
node_vscode -->|"validates documents"| node_jsvalidator
node_jsvalidator -->|"uses canonicalizer"| node_jsconverter

click node_cli "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_mdconvert "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_storage "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_fill "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_checker "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_viewer "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_upgrader "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_pdfimport "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/pdf.py"
click node_docximport "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/docx.py"
click node_export "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/export.py"
click node_chunks "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_changed "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py"
click node_rag "https://github.com/rupakkumar-76319/fmjl/blob/main/examples/rag_demo.py"
click node_vscode "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl-vscode/src/extension.js"
click node_jsconverter "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl-vscode/src/converter.js"
click node_jsvalidator "https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl-vscode/src/validator.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_mdconvert,node_storage,node_fill,node_checker,node_viewer,node_upgrader toneBlue
class node_pdfimport,node_docximport,node_export toneAmber
class node_chunks,node_changed,node_rag toneMint
class node_vscode,node_jsconverter,node_jsvalidator toneRose
class node_user toneIndigo
```

## Components

### Python document toolkit

- [FMJL commands](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`
- [Markdown converter](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`
- [FMJL document I/O](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`
- [Metadata fill](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`
- [Rule checker](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`
- [Markdown view](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`
- [Version upgrade](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`

### Document import

- [PDF importer](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/pdf.py): `fmjl/pdf.py`
- [Word importer](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/docx.py): `fmjl/docx.py`
- [Format export](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/export.py): `fmjl/export.py`

### RAG retrieval

- [Chunk builder](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`
- [Changed chunks](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl/__init__.py): `fmjl/__init__.py`
- [RAG application](https://github.com/rupakkumar-76319/fmjl/blob/main/examples/rag_demo.py): `examples/rag_demo.py`

### VS Code authoring

- [VS Code editor](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl-vscode/src/extension.js): `fmjl-vscode/src/extension.js`
- [Extension converter](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl-vscode/src/converter.js): `fmjl-vscode/src/converter.js`
- [Extension validator](https://github.com/rupakkumar-76319/fmjl/blob/main/fmjl-vscode/src/validator.js): `fmjl-vscode/src/validator.js`

### Other components

- **Document author**

## Connections

- Document author → FMJL commands: runs commands (evidence: `README.md`)
- FMJL commands → Markdown converter: converts Markdown (evidence: `README.md`)
- FMJL commands → FMJL document I/O: reads and writes (evidence: `README.md`)
- FMJL commands → Metadata fill: fills metadata (evidence: `README.md`)
- FMJL commands → Rule checker: checks rules (evidence: `README.md`)
- FMJL commands → Markdown view: renders view (evidence: `README.md`)
- FMJL commands → Version upgrade: upgrades format (evidence: `README.md`)
- FMJL commands → PDF importer: imports PDF (evidence: `README.md`)
- FMJL commands → Word importer: imports Word (evidence: `README.md`)
- FMJL commands → Format export: exports formats (evidence: `README.md`)
- FMJL commands → Chunk builder: builds chunks (evidence: `README.md`)
- Chunk builder → FMJL document I/O: loads rows (evidence: `README.md`)
- Changed chunks → Chunk builder: compares chunks (evidence: `README.md`)
- RAG application → FMJL document I/O: loads documents (evidence: `README.md`)
- RAG application → Chunk builder: builds chunks (evidence: `README.md`)
- RAG application → Changed chunks: finds changes (evidence: `README.md`)
- Document author → VS Code editor: edits documents (evidence: `README.md`)
- VS Code editor → Extension converter: converts forms (evidence: `fmjl-vscode/src/extension.js`)
- VS Code editor → Extension validator: validates documents (evidence: `fmjl-vscode/src/extension.js`)
- Extension validator → Extension converter: uses canonicalizer (evidence: `fmjl-vscode/src/validator.js`)
