Skip to content
Discussion options

You must be logged in to vote

Got this to a state where I think it works for my use case! 🥳

Code: https://jimjam-slam.github.io/quarto-experiments/inject-variable/
Rendered: https://jimjam-slam.github.io/quarto-experiments/inject-variable/

✅ Was able to define a variable as a constant, then repeatedly redefine it as a new constant (eg. here, using Promises.delay to set it to a new random constant every second)
❌ Didn't work out how to set a variable to a generator function (as I would if I was writing directly in OJS), but given I need to give a callback to a JS framework and have that callback update the variable, I don't think this approach makes too much sense anyway.

Here's essentially what I did in an {=html} block:

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@jimjam-slam
Comment options

@jimjam-slam
Comment options

@cscheid
Comment options

@jimjam-slam
Comment options

Comment options

You must be logged in to vote
2 replies
@cscheid
Comment options

@jimjam-slam
Comment options

Answer selected by jimjam-slam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
ojs-engine Issues with the ojs engine html Issues with HTML and related web technology (html/css/scss/js)
3 participants