Skip to content

Commit

Permalink
Added Grazie styles
Browse files Browse the repository at this point in the history
  • Loading branch information
afoeder committed May 8, 2024
1 parent 16cc30c commit 4f32db3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
26 changes: 26 additions & 0 deletions .grazie.en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# A subset of "vale" linter syntax is supported:
# "existence", "substitution", "sequence", "capitalization", "occurrence", "conditional" rule types.
# See https://vale.sh/docs/topics/styles/#extension-points for more details.

extends: substitution
message: "Use a narrow no-break space between the value and SI unit"
level: warning
swap:
'(?<=\d)\s?(?=k?g|m?l|%|°F|°C)': '&#x202F;'
---
extends: substitution
message: "Use the respective prime symbol %s."
swap:
(?<=\d)': ''
(?<=\d)": ''
---
extends: substitution
message: "Use the unicode counterpart '%s' instead of '%s' for this vulgar fraction"
level: warning
swap:
'1/2': '½'
'1/8': ''
'1/4': '¼'
'2/3': ''
'3/4': '¾'
'1/10': ''
25 changes: 10 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@

## Style guide

Style is checked using [Grazie (Pro)](https://plugins.jetbrains.com/plugin/16136-grazie-pro/) along with
[custom style guides](https://plugins.jetbrains.com/plugin/16136-grazie-pro/docs/project-style-guides.html#custom)
that are defined in [`.grazie.en.yaml`](.grazie.en.yaml).

### Units and measurements

In accordance to the SI-standard a value and unit should be separated by a narrow no-break space (NNBSP), in HTML/MD this would be done with `&#x202F;`. This only applies to SI units like 120&#x202F;g and 10&#x202F;%. Cups or Tablespoons would have simple NBSP. Since a line-break is unlikely, a standard white space is also acceptable then.
In accordance to the SI standard a value and unit should be separated by a narrow no-break space (`NNBSP`),
in HTML/MD this would be done with `&#x202F;`.
This only applies to SI units like 120&#x202F;g and 10&#x202F;%.
Cups or Tablespoons would have simple `NBSP`.
Since a line-break is unlikely, a standard white space is also acceptable then.

Minutes/seconds or inches etc. should be represented with the actual Prime[^prime], i.e. ′ or ″ respectively: 45′ and 30″.

Fraction numbers must be represented by their unicode "vulgar fraction" counterparts[^vulgfract], e.g. ⅛, ¼, ½, ⅔, ¾, ⅒
Fraction numbers must be represented by their unicode vulgar fraction counterparts[^vulgfract], e.g., ⅛, ¼, ½, ⅔, ¾, ⅒

[^prime]: https://en.wikipedia.org/wiki/Prime_(symbol)
[^vulgfract]: https://en.wikipedia.org/wiki/Number_Forms#List_of_characters

## Semantic

I'm still not sure about how to denote semantics. What I'm currently trying out is to denote "ingredients" in lists by making them a task list, similar to a shopping list:

* [ ] 100&#x202F;g Bread,
* [ ] 1 egg
* [ ] ½ cup buttermelk
* pinch of salt
* ground pepper
* [ ] 2 tbsp powdered gelatene

Items that are expected to be in a standard pantry like salt, oil, butter, are not part of this list. I am totally unsure of where to draw the line, though. Let's try.
8 changes: 4 additions & 4 deletions Writerside/topics/recipes/cilantro-lime-rice.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ tags: mexican

* White onion
* Garlic, smashed & chopped
* Lime (cested!)
* Lime (zested)
* Rice (Basmati or brown)
* ground coriander
* cilantro, chopped
* scallions, sliced (garnish)

## Directions

Like you'd do with a risotto,
Like you would do with a risotto:

1. saute onion and garlic in oil
2. add rice, saute 2′ish, stir
1. sauté onion and garlic in oil
2. add rice, sauté 2′ish, stir
3. add ground coriander and lime cest (save some for garnish)
4. Add water (1½ to 2 times the rice)
5. Let cook until all water evaporated
Expand Down

0 comments on commit 4f32db3

Please sign in to comment.