-
Notifications
You must be signed in to change notification settings - Fork 8
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
Why is a duplicate include file an error? #189
Comments
A legitimate reason could be, for example, documenting the language itself. With asciidoctor I might use
Here, I have included the source of another asciidoc file first, and then I have included it as-is to show what it looks like when rendered (but crucially, it was only written once). It would be more appropriate to generate a tree of includes, and at each include, check along the current path from root-to-branch. Given the following documents:
And the following includes, in this order:
The tree generated would be:
|
Interesting case, for sure. SAM would not actually allow this at the syntax level, however. The content of a code block is code, pure and simple, so Would just render
This case would have to be handled using an insert instead
The language designer would have to define a But in this case, double include would not apply since there is only one include and one insert. Still, an interesting case to think about. Thanks |
Currently and included file is checked against a list of included files and an error is raised it a duplicate include is found.
I suspect this was installed to detect and prevent circular includes, were a file includes itself or a file that includes itself. This is an important check, but there could be legitimate reasons to include the same file twice.
Is there sufficient reason to try an make this check more sophisticated so that it allows simple duplicate includes but prevents circular ones?
The text was updated successfully, but these errors were encountered: