-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
PR #751 implements imported variables, by deferring the rendering of Nunjucks variable to a later stage, so that the contents of the imported variables can be correctly populated before rendering takes place. However, this also means that we cannot do the following: <import src="{{ file }}#var" /> {{ var }} Nunjucks rendering requires all variables to be resolved in one go. Since Nunjucks rendering is delayed in #751, the src attribute would not resolve correctly, so the logic for importing variables would fail and var would not have the correct content. However, if we do Nunjucks rendering at an earlier stage to resolve the src attribute, we will have to resolve the var variable immediately as well, as we have no way of selectively resolving certain variables at different stages. This is because we do not have an algorithm to determine which variables should be resolved and which shouldn't be resolved (this said algorithm must also take into consider edge cases, such as using Nunjucks' "set" instruction). Therefore, the design of import variable needs to be reconsidered in order to overcome this techincal obstacle. Right now, the failure to resolve the src attribute properly, due to the deferred Nunjuck rendering, is breaking website generation (for example, MarkBind's "userGuide/formattingContents.html" is broken). There doesn't seem to be a quick fix to overcome the technical obstacle described above. The new design might take additional time, and authors also have no quick ways to solve this issue. Let's revert the import variable PR (#751) to prevent generated websites from breaking, and wait for a new implementation of import variables to surface instead. This reverts commit 4412153.
- Loading branch information
Showing
6 changed files
with
29 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.