- Notifications
You must be signed in to change notification settings - Fork1.1k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Revision of the Context documentation#6008
base:main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I prefer the old version of the last paragraph, but appart from that I like the changes.
docs/reference/language/context.md Outdated
The output of a `#context ...` call is _read-only_ (in the form of `[content]`). | ||
Allowing write access would likely result in invalid code, because the context | ||
might have already changed in the meantime. Therefore, temporary changes of | ||
settings must be done within the context, and they are only active until the | ||
end of the context's scope: | ||
```example | ||
#context { | ||
// the context allows you to retrieve the current text.size | ||
set text(size: text.size * 200%) | ||
[large text] | ||
} | ||
original size | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think this part could be improved. I'm not sure what you mean by "read-only". What would the user expect to be modifiable that is not?
I like the example, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I hope the new version is an improvement.
A remark to the documentation ofhttps://typst.app/docs/reference/math/equation/#parameters-numbering: the documentation says that the default is |
Haven't taken a proper look at the changes yet, but I'll defend beforehand that we should make sure any changes to the context docs take this issue into account (and potentially close it):#5538 |
#5538 stresses: "The context element always gets information from before the block started." This PR has several places explaining this behavior with various examples, e.g.
Please check if your concerns have been fully resolved. |
None means no numbering, as usual. There is no need for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
A left a few remarks. Reviewing docs is challenging as it's a lot more subjective than code. I kept it mostly to high-level conceptual remarks and Markdown style things and did not go into minor edits. That can be left for later or maybe I would just push some minor edits at the end once the higher level things are out of the way.
docs/reference/language/context.md Outdated
## Behavior of the context keyword | ||
Style properties frequently change within a document, for example by applying set | ||
rules. To retrieve such poperties in a consistent way, one must first specify | ||
the context where the query is to be executed. This is the purpose of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the term "query" has a rather specific connotation in Typst and should be avoided here imo (also a bunch of times more below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I deliberately usequery
when I refer to the specific typst meaning, and plain text to just use the English term. IMHO, there is no confusion. Anyway, what synonym would not collide with anything in your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think "retrieve" (as you suggested below) is good. The difference between "query" andquery
is a bit too subtle imo.
docs/reference/language/context.md Outdated
Style properties frequently change within a document, for example by applying set | ||
rules. To retrieve such poperties in a consistent way, one must first specify | ||
the context where the query is to be executed. This is the purpose of the | ||
`context` keyword. Once the context has been fixed, the property information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Saying "This is the purpose of the context keyword" is a bit strong since it's not the only purpose of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please enlighten me about other purposes (or give me a pointer).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Context also provides the current location viahere()
.
docs/reference/language/context.md Outdated
rules. To retrieve such poperties in a consistent way, one must first specify | ||
the context where the query is to be executed. This is the purpose of the | ||
`context` keyword. Once the context has been fixed, the property information | ||
is available through a simple field access syntax. For example, `text.lang` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
is available througha simplefield access syntax. For example,`text.lang` | |
is available through field access syntax. For example,`text.lang` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You should be proud of how simple it is (in comparison to the competition :-).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
:D I'm trying to reduce the use of "simple" in my technical writing as things are differently simple/hard for different people and it's typically unnecessary fluff.
docs/reference/language/context.md Outdated
environments it is placed into. In the example below, we create a single context | ||
expression, store it in the `value` variable and use it multiple times. Each use | ||
properly reacts to the current surroundings. | ||
Note that calling `#text.lang` directly would be an error, because the request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
"calling" isn't really the correct term I think, as it's not a function (this also appears various times more below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm running out of words -- "query" is also forbidden :-) How about "retrieving"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Retrieving is good.
docs/reference/language/scripting.md Outdated
@@ -245,6 +259,10 @@ The value in question can be either: | |||
[element function]($function/#element-functions) that were given when the | |||
element was constructed. | |||
**Important:** Many fields of element functions are only accessible in a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
**Important:**Many fields of element functions are only accessible in a | |
Many fields of element functions are only accessible in a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Again: people read documentation selectively. "Important:" is meant to catch their attention. That these fields are not accessible outside of acontext
was another big surprise to me -- remember that I even made a feature request because I coudn't deduce this from the documentation. I would rather add the explanation to more places to hammer it into every readers brain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It stuck out to me because in my opinion it's not clearly more important than the other information in this section.
Regardless of that, I think this section could be expanded to clarify when exactly fields are present on content. Essentially
- fields for required arguments are always accessible
- fields for optional arguments that were provided in the element's constructor are accessible on a constructed element
- fields for optional arguments that weren't mentioned in the constructor are only available when the element is "materialized", this is the case when it's the shown element in a show rule or when the element is returned from a query
- If an element is not materialized, it's fields are not available, also not within a
context
expression
Meanwhile, fields onelement functions arenever available without an established context.
When I first read the documentation, I had no idea about what none means "as usual", so I would have appreciated an explanation (instead, I figured it out by trial-and-error).
I was not clear enough: "default numbering" is supposed to mean "do not change the numbering scheme". Not having |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I like the improvements, and I mostly agree with Laurenz's comments.
I still dislike the word "immutable", though. But I'm not sure what to replace it with, other than changing the phrasing. "Constant", like used line 263, is great.
docs/reference/language/context.md Outdated
#context text.lang | ||
``` | ||
The output of a `#context ...` call is static in the form of opaque |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What does "static" mean here?
docs/reference/language/context.md Outdated
In fact, context-dependent property fields are immutable constants even | ||
within the context itself: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In fact, context-dependent property fields are immutable constants even | |
within the context itself: | |
In fact, context-dependent property fields always refer to their value at the place where the context is displayed. This means changing a property within a context expression is not observable within the same context expression: |
I think something like this would be more correct. Properties are not really immutable: you can still change them, it's just not observable within the same context expression. Maybe my second sentence is redundant with your next paragraph though.
Maybe the following example could even have a nested context expression, but that might be too much.
docs/reference/language/context.md Outdated
] | ||
``` | ||
Both calls have the same output 'en', because `text.lang` is assigned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I would suggest`"en"`
, because the output is technically code here.
docs/reference/language/context.md Outdated
(the closing `]`). It does not "see" the `#set text(lang: "fr")` before | ||
call 2. Compare this to the previous example: there we got two different |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This sentence feels weird to me. What's "it"?
The next sentence is great though, it makes it really clear that multiple small context blocks can behave very differently compared to a single big one.
docs/reference/language/context.md Outdated
results because we created two different contexts. | ||
However, immutability only applies to the property fields themselves. | ||
Content creation instructions within a context _do_ see the effect of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Both "content creation instructions" and "content expressions" feel obscure to me
docs/reference/language/context.md Outdated
All of the above applies to `show` rules analogously, for example: | ||
```example | ||
#let template(body) = { | ||
set text(size: 25pt) | ||
body | ||
} | ||
#set text(size: 50pt) | ||
#context [ | ||
call 1: #text.size \ | ||
#show: template | ||
call 2: #text.size \ | ||
call 3: #context text.size | ||
] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Depending on the target audience, this example might be a bit hard to follow (first, we define a function that won't be used for now, then, opencontext
, then, do some stuff, then,show: template
, then you need to look at whattemplate
does, then...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I copied this example from the original documentation. I think readers will easily figure out its meaning after the previous explanations. It will be good if it takes a moment of extra thinking, because this will make the rules stick in the brain.
docs/reference/language/context.md Outdated
] | ||
``` | ||
## Controlling content creation within a context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The value oftext.fill.darken(20%)
is not content, but the value ofcontext text.fill.darken(20%)
is.
docs/reference/language/context.md Outdated
Both reads have the same output `"en"`, because `text.lang` is assigned | ||
upon entry in the context and remains constant until the end of its scope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Both reads have the same output`"en"`, because`text.lang` isassigned | |
upon entry inthe context and remains constant until the end of its scope | |
Both reads have the same output`"en"`, because`text.lang` isdetermined by the outside | |
value, wherethe context block is placed, and remains constant until the end of its scope |
I would say it's never really assigned per se. But maybe I'm just nitpicking too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
While your explanation may be technically more precise, I think it is harder to understand for newcomers. I don't see why "assigned upon entry into the context" is wrong and would rather like to keep it. May "entry into the context block", but I'm not sure of this is better.
From my point if view, the PR is good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In general, I like the idea of explaining these concepts in a more elementary way, potentially making this doc page more accessible to newcomers.
Here are some comments I had after an initial read at the current state.
I'll also note that@MDLC01's comments were generally spot on, thanks for considering them.
docs/reference/language/context.md Outdated
`context` keyword refers to "right here": | ||
```example | ||
#set text(lang: "de") | ||
// read the language setting "here" | ||
#context text.lang | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Personally, I'd consider getting rid of this example, since it is the first one in the page and we should avoid accidentally encouraging the common mistake of trying to use the value returned incontext
directly, e.g. in2 * context text.size
or"en" == context text.lang
.
It could be improved by adding some logic within the context block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In fact, we could consider mentioning this issue very early on below, when saying that context returns content, if possible. (Needs further discussion.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actually, this is alreadybriefly mentioned at the top, but either way people generally skim the docs for examples they may paste elsewhere (for good reason), so I'd argue this is still a concern, and an explicit (counter-)example would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This example is the "Hello world" of contexts. Everyone knows that "Hello world" is not very useful, but it gets across a few very basic things (such as how the context keywords looks like, that properties are accessed by field syntax, and that they can be displayed). Of course, a different example (instead oflang
) might be more instructive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
BTW, the example is not completely pointless -- it is useful as a quick-and-dirty way of inspecting what the current value of some property is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
A remark about the error message when a field is accessed outside of a context:
#text.lang// => "Can only be used when context is known."
This message is a mystery for beginners -- when you haven't heard about thecontext
concept (and associated keyword) and read "context is known" with its generic, everyday-language meaning, you have no idea what to do (and this unfortunately applies to many other error messages as well). Worse, when I first opened the context documentation, I got the feeling that this is meant for advanced users and wouldn't be needed right now. In reality, contexts are absolutely fundamental, and an improved documentation should get this across.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This example is the "Hello world" of contexts. Everyone knows that "Hello world" is not very useful, but it gets across a few very basic things (such as how the context keywords looks like, that properties are accessed by field syntax, and that they can be displayed)
Yeah of course, but as someone who is often active in the typst support channels, i find the problem I mentioned to be rather common across beginners. See alsohttps://forum.typst.app/t/why-is-the-value-i-receive-from-context-always-content/164/
It is possible to keep the example in some way, but maybe it just shouldn't be thefirst.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It's true that it's a very common problem with beginners, but I'm not sure that this specific example is the problem. No matter what you put there, people will think that's the way it works. So I think we can keep that. But I agree that we should have more explanation specific to that problem somewhere relatively early in the docs. Doesn't necessarily have to be part of this PR though.
docs/reference/language/context.md Outdated
As you see, the result of a `#context ...` expression can | ||
be inserted into the document as `content`. Context blocks can | ||
contain arbitrary code beyond the field access. However, | ||
and this is often surprisingly for newcomers, context-dependent | ||
property fields remain _constant_ throughout the context's scope. | ||
This has two important consequences: First, direct property | ||
assignments like `text.lang = "de"` are _not_ allowed – | ||
use `set` or `show` rules for this purpose. Second, changes to a | ||
property value within a context (e.g. by a `set` rule) are not | ||
observable by field access within that same context: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This mention to property assignment (at least here) is confusing, since that was never suggested to be possible in the first place, and doesn't seem like something that needs to be mentioned anyway as the error should be straightforward. Set rules, OTOH, don't produce errors, so they are definitely tricky and should be the main focus of this paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This mention to property assignment (at least here) is confusing, since that was never suggested to be possible in the first place
The problem with your argument is that anyone with only the least programming experience assumes by default that properties can be assigned -- it is just how it works in most languages. That typst never suggested the possibility is irrelevant, the brain automatically relates new stuff to what it already knows.
In fact, a major reason why I struggled with the typst documentation (and take the time to propose improvements) is that one has to unlearn various things that other programming languages take for granted. You absolutely must mention and explain when typst deviates from the mainstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, I agree this should be mentioned, but my main point is that this isn't related tocontext
itself and feels out of place. This is rather related toset
rules themselves - that's how you set properties on elements, not through assignment.
In other words, sinceset
rules from outside are what define the value oftext.lang
in the first place, one could naturally expect that aset
rule insidecontext { ... }
would also change it within. That is not the case.
As a compromise, the suggestion of not being able to assign totext.lang
could be moved to a note after the phrase or paragraph, e.g. "set rules cannot changetext.lang
within the context (nor can you assign to them, as only set rules can influence the default values of element properties)."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In other words, since set rules from outside are what define the value of text.lang in the first place, one could naturally expect that a set rule inside context { ... } would also change it within. That is not the case.
Isn't this exactly what my proposed documentation says?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Isn't this exactly what my proposed documentation says?
I'm effectively proposing for that to be theonly thing it says, and mention the assignment thing elsewhere, or as a sidenote.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I agree that thetext.lang = "de"
is too front-and-center here. In particular, it also sounds like the fact that assignments are not allowed is related to the constants-ness and set rules can somehow ignore the constantness --- which they don't. I think it would be good to decouple the talk about constantness from the fact that you should use set rules and not assignment.
] | ||
``` | ||
All of the above applies to `show` rules analogously. To demonstrate this, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe a bit more elementary:
All of the above applies to`show` rules analogously. To demonstrate this, | |
All of the above applies to`show` rules analogously, as they can be used to apply set rules defined elsewhere. To demonstrate this, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I do not find this formulation helpful. Why restrict the statement to set rules applied in show rules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Otherwise they don't affect context at all. That's the only way they could potentially change a property (and, indeed, they affect nested contexts). But a show rule transforming element A into B wouldn't have any impact whatsoever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is mostly due to how theshow
syntax is a bit overloaded. Only "everything show rules" - equivalent to passing the rest of a scope to a function - can also apply show rules on the current scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I like@PgBiel's proposed addition.
docs/reference/language/context.md Outdated
The advantage of this technique is that the user does not have to know the | ||
original spacing in order to double it. To double the spacing of all | ||
equations, you can put the same calculations in a show rule. Note that | ||
it is not necessary to add the `context` keyword on the right-hand side | ||
of a `show` rule, because show rules establish a context automatically: | ||
```example | ||
Normal spacing: | ||
$ x \ x $ | ||
#show math.equation.where(block: true): it => { | ||
// access current par.leading in a context, | ||
// established automatically by the show rule | ||
set par(leading: par.leading * 200%) | ||
it | ||
} | ||
Doubled spacing: | ||
$ z \ z $ | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This has the unfortunate pitfall of not being overridable by a later set rule, since an earlier show rule executes last... it's also whyshow: set
rules are usually recommended instead.
Of course, that's not a problem if you never try to override it, but wanted to highlight this for discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You mean the example should be written like this?
#showmath.equation.where(block:true):setpar(leading:par.leading*200%)
This is a typical example of a problem I noticed with the current documentation: After reading it, one tends to overcomplicate solutions (and I mean by alot).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
BTW, the precedence of the rules would deserve its own documentation section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You mean the example should be written like this?
#showmath.equation.where(block:true):setpar(leading:par.leading*200%)
Unfortunately, this doesn't work becausepar.leading * 200%
is evaluated when the show rule is first processed (without context), not when the equation is visited.
@@ -7,6 +7,16 @@ Typst embeds a powerful scripting language. You can automate your documents and | |||
create more sophisticated styles with code. Below is an overview over the | |||
scripting concepts. | |||
## Identifiers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Not sure if this change belongs in this PR, but I'll let@laurmaedje have the final word on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Not sure if it is worth moving this to a PR of its own. In any case, this is another place where it is necessary to unlearn experience from other programming languages, and therefore important to mention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think it would be good to move this into its own PR.
Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
Co-authored-by: Bastien Voirin <bastien.voirin.pro@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I left a bunch more comments. It may seem a lot (and perhaps nit-picky) but I think we're on a good path and nearing consensus on how this should look!
function. | ||
## Behavior of the context keyword | ||
Style properties frequently change within a document, for example by applying set | ||
rules. To retrieve such properties in a consistent way, one must first specify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
not sure whether "consistent" is quite on point. Maybe "well-defined"?
rules. To retrieve such properties in a consistent way, one must first specify | ||
the precise context where the property should be retrieved. This can be achieved | ||
with the `context` keyword. Once the context has been fixed, the property | ||
information is available through standard field access syntax. For example, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think it's in principle important to mentionwhat we are accessing fields on. But the correct thing would be "element functions" and these are just a concept that's cursed to explain. All this will become easier to explain once element functions become types.
original spacing in order to double it. To double the spacing of all | ||
equations, you can put the same calculations in a show rule. Note that | ||
it is not necessary to add the `context` keyword on the right-hand side | ||
of a `show` rule, because show rules establish a context automatically: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The fact that show rules establish context automatically is maybe a bit too buried. It's quite important I think.
Normal spacing: | ||
$ x \ x $ | ||
#show math.equation.where(block: true): it => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The rendered version is fairly long and noisy now because both examples don't fit side-by-side and they show the exact same output. Maybe we can somehow shorten this? Maybe the second version could be dropped in favor of a new section that explains that show rules establish context and then have a different example there?

This is a pull request to discuss documentation improvements. I edited most of the
context
documentation to give an idea what I would find helpful. Please use the inline comment function for discussion.