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

Refactor file inclusions #343

Closed
xcoulon opened this issue May 5, 2019 · 0 comments · Fixed by #344
Closed

Refactor file inclusions #343

xcoulon opened this issue May 5, 2019 · 0 comments · Fixed by #344

Comments

@xcoulon
Copy link
Member

xcoulon commented May 5, 2019

The current logic to process the file inclusions should be rewritten: including the files during the render phase causes troubles all existing elements after the included ones need to be reprocessed (see #332)

Instead, the file inclusions should be executed during a preparse phase, where the raw content is added into the "master" document, which can then be parsed in a single shot.

@xcoulon xcoulon self-assigned this May 5, 2019
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue May 5, 2019
add a new entrypoint in the grammar to "preparse" the document, only
looking for a subset of elements, in particular the `include` directives
and the sections whose level may be offset during the file inclusions.
Once the file have been included (ie, the `include` directives have been
replaced with the actual file content), then the document can be fully parsed.

Fixes bytesparadise#343

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue May 7, 2019
add a new entrypoint in the grammar to "preparse" the document, only
looking for a subset of elements, in particular the `include` directives
and the sections whose level may be offset during the file inclusions.
Once the file have been included (ie, the `include` directives have been
replaced with the actual file content), then the document can be fully parsed.

Fixes bytesparadise#343

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue May 7, 2019
add a new entrypoint in the grammar to "preparse" the document, only
looking for a subset of elements, in particular the `include` directives
and the sections whose level may be offset during the file inclusions.
Once the file have been included (ie, the `include` directives have been
replaced with the actual file content), then the document can be fully parsed.

Fixes bytesparadise#343

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit that referenced this issue May 8, 2019
add a new entrypoint in the grammar to "preparse" the document, only
looking for a subset of elements, in particular the `include` directives
and the sections whose level may be offset during the file inclusions.
Once the file have been included (ie, the `include` directives have been
replaced with the actual file content), then the document can be fully parsed.

Fixes #343

Signed-off-by: Xavier Coulon <[email protected]>
@xcoulon xcoulon added this to the v0.2.0 milestone Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant