Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions extradocx/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[project]
name = "extradocx"
version = "0.1.0"
description = "Experimental DOCX → GFM Markdown AST converter"
requires-python = ">=3.11"
dependencies = []

[project.scripts]
extradocx = "extradocx.cli:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/extradocx"]

[tool.uv]
dev-dependencies = [
"pytest>=8.0",
"ruff>=0.4",
]

[tool.ruff]
line-length = 100

[tool.ruff.lint]
select = ["E", "F", "I"]
24 changes: 24 additions & 0 deletions extradocx/src/extradocx/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
extradocx — experimental DOCX → GFM Markdown AST converter.

Proof-of-concept for bidirectional DOCX ↔ Markdown transformation via an
intermediate AST that:
- Represents GFM markdown structure (headings, lists, tables, …)
- Preserves text at run granularity (bold, italic, … per TextRun node)
- Points every node back to the source DOCX XML via XPath

Usage::

from extradocx import DocxParser, to_json, to_markdown

parser = DocxParser("report.docx")
doc = parser.parse()

json_str = to_json(doc) # full-fidelity JSON with XPath pointers
md_str = to_markdown(doc) # GFM markdown
"""

from extradocx.parser import DocxParser
from extradocx.serializers import to_json, to_markdown

__all__ = ["DocxParser", "to_json", "to_markdown"]
Loading
Loading