-
Notifications
You must be signed in to change notification settings - Fork 141
Allow specifying variables in include #553
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8db28db
Allow specifying variables in include
jamos-tay 5828284
Fix bugs and add test case
jamos-tay 36f5845
Support default variables
jamos-tay 10d0d23
Fix bug with included variables leaking
jamos-tay b8cfde1
Pr fixes
jamos-tay 196bebf
Update documentation
jamos-tay 6351a39
Reverse section on element attributes
jamos-tay c04e678
Extract extractVariables into function
jamos-tay a2415af
Documentation update
jamos-tay b49a6b5
Change to snake case
jamos-tay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Should be blank: {{ included_variable_should_not_leak }} |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Should be blank: {{ included_variable_should_not_leak_inner }} |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Test included variable | ||
| {{ included_variable }} | ||
|
|
||
| # Test included variable with markdown | ||
| {{ included_variable_with_markdown }} | ||
|
|
||
| # Test included variable as attribute | ||
| <p style="{{ included_variable_as_attribute }}">Test</p> | ||
|
|
||
| # Test included variable as html element | ||
| {{ included_variable_as_html_element }} | ||
|
|
||
| # Test included variable overridden by variables.md | ||
| {{ global_variable_overriding_included_variable }} | ||
|
|
||
| # Test included variables in included file | ||
| <include src="testIncludeVariablesIncludedFile.md"> | ||
| <span id="included_variable_inner_overridden">Included variable overridden by outer variable</span> | ||
| <span id="included_variable_should_not_leak_inner">Included variable should not leak into other files</span> | ||
| </include> | ||
|
|
||
| # Inner included variables should not leak into other files | ||
| <include src="testIncludeVariableLeakInner.md" /> | ||
|
|
||
| # Test included variable with global variable | ||
| {{ included_variable_with_global_variable }} | ||
|
|
||
| {% set included_variable = "Inner variable overridden by set" %} | ||
| {% set included_global_variable = "Global variable overridden by set" %} | ||
|
|
||
| # Test included variable overridden by set | ||
| {{ included_variable }} | ||
| {{ included_global_variable }} | ||
|
|
||
| # Test missing variable with default | ||
| {{ missing_variable or "Missing Variable" }} |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| {{ included_variable_in_outer_included_file }} | ||
|
|
||
| {{ included_variable_inner_overridden }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.