Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make HTML stringification/indentation a separate phase #7

Open
thoward opened this issue Dec 13, 2017 · 0 comments
Open

Make HTML stringification/indentation a separate phase #7

thoward opened this issue Dec 13, 2017 · 0 comments

Comments

@thoward
Copy link
Owner

thoward commented Dec 13, 2017

Currently indents are calculated as we go, and the entire output is returned as a single string.

It makes sense to separate this into a couple distinct phases:

  • Convert parsed RST AST into a HTML Tag tree
  • Apply CSS to HTML Tag tree (or any other modifications)
  • Convert HTML Tag tree to a single string of output, with configurable indents amount

Expose access to renderer at all phases. Allow consumers of library to, for example, get a iterable tree of output tags, instead of a string.

Each node should include a copy of the parser's AST node it was generated from, as a reference.

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

No branches or pull requests

1 participant