DOCUMENTATION: Update math notations in corporation docs #2452
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.
We used remark-math to render math notations in the in-game markdown docs viewer. Under the hood, remark-math uses micromark-extension-math. When writing Tex with these plugins, we need to use their syntax. There are two "modes": inline (also called "text") and block (also called "flow").
This is an example:
Notice how the "block" mode requires a newline after the opening
$$and the closing$$. If$$(the "fence") is on the same line as the notation, the notation is always considered "inline". However, this is their rule, not a universal rule. In fact, there are no universal rules when it comes to math notation in markdown. Let's render this example in GitHub UI and VSCode's markdown preview mode:GitHub UI:
VSCode:
As you can see in the screenshots,
$$x+y$$can be inline or block, depending on the renderer.In our corp docs, we usually
$$foo$$(no newlines), so the math notations are rendered differently on GitHub UI and the in-game viewer:GitHub:
In-game viewer (current):
This PR changes most of
$$foo$$(no newlines) to the ones with newlines. After the changes:Note that there are still some unchanged notations. They are notations used in a multi-level list. For example:
In these cases, we have a problem with GitHub UI and prettier.
On GitHub, the example above is rendered in the inline mode, if we want it to render in the block mode, we need to write it like this:
Or
However, prettier will reformat it like this (notice how
- bar 3is moved):I tried to find a workaround, but I did not find any good ones, so I decided to accept it as a small drawback.