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

JSON variables: elaborate on scoping #1202

Closed
damithc opened this issue Apr 16, 2020 · 4 comments · Fixed by #1208
Closed

JSON variables: elaborate on scoping #1202

damithc opened this issue Apr 16, 2020 · 4 comments · Fixed by #1208

Comments

@damithc
Copy link
Contributor

damithc commented Apr 16, 2020

The following statement appears in the user guide.

Variables defined in JSON file will be scoped according to where it is being referenced.

Suggestion: explain this further, possibly with examples.

@damithc
Copy link
Contributor Author

damithc commented Apr 18, 2020

@crphang any more info about this scoping?

@crphang
Copy link
Contributor

crphang commented Apr 18, 2020

To make it more concrete to an author, it could be reworded as:

Variables defined in JSON file will be accessible as page or global variable according to where it was defined.

@damithc
Copy link
Contributor Author

damithc commented Apr 18, 2020

Probably we need to give examples of various use cases. I'm not clear about it myself. Can we put those json files in any folder insider the site? Do they have to be all included in the variables.md can they be be included into any page?

@crphang
Copy link
Contributor

crphang commented Apr 18, 2020

Yes, examples will help to explain better. To quickly answer some doubts:

  1. They could be added in any page in any directory as long as it is referenced appropriately.
  2. If the json variables are referenced as part of variables.md, then it would be global. Otherwise if they are defined and referenced from any other page, it would be a page variable.

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.

2 participants