Skip to content

feat: add reStructuredText (.rst) support - #66

Open
tryh4rd-26 wants to merge 1 commit into
firecrawl:mainfrom
tryh4rd-26:main
Open

feat: add reStructuredText (.rst) support#66
tryh4rd-26 wants to merge 1 commit into
firecrawl:mainfrom
tryh4rd-26:main

Conversation

@tryh4rd-26

@tryh4rd-26 tryh4rd-26 commented Aug 8, 2026

Copy link
Copy Markdown

Works on Issue #38

Hello!

this PR adds support for parsing restructuredtext (.rst) documents into anydoc's internal document model so they can render cleanly to github-flavored markdown.

  • added Format::Rst to Format enum and mapped .rst extensions

  • added rst parser module in src/formats/rst.rs handling:

    • section headings with adornment levels (=, -, ~, etc.)
    • inline formatting: bold (**), italic (*), code (`code` / :literal:), links, inline roles (:strong:, :emphasis:, :sub:, :sup:, :ref:)
    • bullet, numbered, nested, definition, field lists, and line blocks
    • code blocks (:: and .. code-block:: <lang>)
    • grid tables (with merged cell headers) and .. list-table:: directives
    • directives & admonitions (.. note::, .. warning::, .. important::, .. tip::, .. image::, .. container::, etc.)
    • substitutions, footnotes, and citations
  • This works on issue feat proposal: Restructured Text #38

i tested locally using standard test suite and dedicated rst integration tests:

cargo test --test rst
cargo test

also verified conversion against test rst samples:

cargo run --example convert -- "doc1.rst"
cargo run --example convert -- "doc2.rst"
cargo run --example convert -- "doc3.rst"

you can find the local test sample files used here:
https://drive.proton.me/urls/Z9V4V2T69C#IxEQKKw1K9sI


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@tryh4rd-26

Copy link
Copy Markdown
Author

@tomsideguide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant