quarto-dev / quarto-dev/quarto-cli

How to use Observable code and "this" in Quarto ojs cell?

Open
#10,035 0 comments 2 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Jun 17, 2024.

bug ojs-engine
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

(I think this is a bug in our OJS implementation.)

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/10032

Originally posted by Juuso1 June 16, 2024

Description

I try to copy this code (https://observablehq.com/@fil/whats-this) to Quarto document, but I can´t see nothing. Only Replay button an this one "Object {value: NaN}" ? What should I do?

viewof replay = html`<button>replay`
{
  replay;
  mutable that = this;
  if (this) yield { value: this.value + 1 };
  else yield { value: 0 };
}
mutable that = undefined

Br, Juuso

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.