doctrine / doctrine/rst-parser

Add transformers/node visitors

Open
#145 0 comments 0 reactions 0 assignees View on GitHub
Improvement
Dominant language
PHP
Stars
63
Forks
26
PR merge metrics
No merged PRs in 30d

Description

It would be great if there is a supported way to traverse the generated `DocumentNode` and modify the node structure.

The [`docutils.transforms`](https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/transforms/) namespace includes quite some usage of such node visitor, some directly applicable to this library:

* Using `PendingNodes` to better handle the `.. class::` directive (see discussion in https://github.com/doctrine/rst-parser/pull/141#discussion_r598263469 )
* Allow auto-numbering sections ([ref](https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/transforms/parts.py#l18))
* Generating table of contents from a document node ([ref](https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/transforms/parts.py#l70))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.