-
-
Notifications
You must be signed in to change notification settings - Fork 11
Add contributing guidelines #112
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
bcd5486
8cb3299
baf9042
4f204e9
677e67f
b6fc5d6
67550cf
ceafd2e
4262c65
10d2545
1d6e351
49d8d1b
d23d15d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Conventions | ||
When adding new modules, symbols or variants, please try to be consistent with | ||
the following list of conventions. These aren't always hard rules, especially | ||
because of how messy Unicode can be, but you should adhere to them if possible. | ||
|
||
General conventions: | ||
- Modifiers are entirely lowercase. | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Modifiers that correspond to symbols (by having the same name) have six established meanings: | ||
- The symbol is added around the base like an accent or an attachment (smaller than the base), e.g. `eq.quest`. | ||
- The symbol is stacked below the base, e.g. `gt.lt`. | ||
- The symbol is stacked to the right of the base, e.g. `colon.eq`. | ||
- The symbol is overlaid at the center of the base, e.g. `integral.dash`. | ||
- The symbol surrounds the base, e.g. `plus.square`. | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- The symbol is placed inside the base, e.g. `triangle.stroked.dot`. | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Established generic modifiers: | ||
- `.l`/`.r`/`.t`/`.b`: The four main directions (left/right/top/bottom). | ||
- For delimiters, `.l` means opening and `.r` means closing (see [#100](https://github.com/typst/codex/pull/100)). | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- `.tl`/`.tr`/`.bl`/`.br`: The four corners | ||
<!-- TODO: Do we have or want to have conventions about when to choose `.tl` vs. `.t.l`? --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The case of corner delimiters is special because we want to signal opening and closing delimiters, as explained in #100. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough. Should I add a clarification for this or do you think it just goes without saying? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you mean a clarification regarding corner delimiters, I don't think this is necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No I mean basically a reworded version of your first paragraph from before:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit weird to talk about a symbol that doesn't exist, but I think this is a good way to explain things so let's add that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is 10d2545 good? |
||
- `.double`, `.triple`, `.quad`: A symbol that has 2-4 of something. | ||
- `.stroked`/`.filled`: A symbol that has an empty/filled interior. | ||
(They correspond to Unicode's "white"/"black".) | ||
- `.tiny`/`.small`/`.medium`/`.big`: A geometric shape with a certain size. | ||
- `.light`/`.heavy`: A shape with a certain stroke weight. | ||
- `.dotted`: A shape with a dotted line instead of a full stroke. | ||
Established concrete modifiers: | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- `.big`: A big (n-ary) version of an operator. | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- `.alt`: An alternative version that is still more or less the same symbol. | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- `.not`: A symbol with a (typically diagonal) line through it. | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- `.o`: A symbol with a circle around it (see [#62](https://github.com/typst/codex/pull/62)) | ||
- `.sq`: A "squarified" version of a symbol (see [#110](https://github.com/typst/codex/pull/110)) | ||
- `.rev`: A horizontally mirrored version of a symbol (see [#108](https://github.com/typst/codex/issues/108)) | ||
- `.inv`: Either vertically mirrored or a 180° rotated version of a symbol (see [#108](https://github.com/typst/codex/issues/108)) | ||
- `.cw`/`.ccw`: Clockwise/Counterclockwise | ||
Established exceptions: | ||
- When `.eq` is used in the second sense (stacked below), it only adds a single line and not two. | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
For two lines below, `.equiv` is used. | ||
- `.not` (see above) does not correspond to the symbol `not` despite having the same name. | ||
T0mstone marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.