Skip to content

Commit 1e1a858

Browse files
authored
Improve markdown formatting (#2967)
1 parent 171c08f commit 1e1a858

File tree

5 files changed

+71
-66
lines changed

5 files changed

+71
-66
lines changed

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ This project has adopted the [OCaml Code of Conduct](https://github.com/ocaml/co
44

55
# Enforcement
66

7-
This project follows the OCaml Code of Conduct [enforcement policy](https://github.com/ocaml/code-of-conduct/blob/main/CODE_OF_CONDUCT.md#enforcement).
7+
This project follows the OCaml Code of Conduct [enforcement policy](https://github.com/ocaml/code-of-conduct/blob/main/CODE_OF_CONDUCT.md#enforcement).

CONTRIBUTING.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ The OCaml Cookbook is a place where OCaml developers share how to solve common
124124
tasks in OCaml using packages from the OCaml ecosystem.
125125

126126
Here are the steps to contribute a recipe for an existing task:
127-
* Find the task in the [data/cookbook/tasks.yml](data/cookbook/tasks.yml) file.
128-
* Go to the task folder inside [data/cookbook/](data/cookbook/) that has the
127+
- Find the task in the [data/cookbook/tasks.yml](data/cookbook/tasks.yml) file.
128+
- Go to the task folder inside [data/cookbook/](data/cookbook/) that has the
129129
same name as the task's `slug`.
130-
* Create a `.ml` file containing the recipe and a YAML header with metadata about
130+
- Create a `.ml` file containing the recipe and a YAML header with metadata about
131131
the recipe.
132132

133133
If the recipe does not fit into any existing task, you also need to create a
@@ -138,7 +138,7 @@ located under a relevant `category:` field.
138138
Finally, it is also possible to create and organise groups of tasks by creating
139139
new categories. Categories are recursive and may have subcategories, which are
140140
full categories too. A task listed in
141-
[data/cookbook/tasks.yml](data/cookbook/tasks.yml) may have no recipes yet. On the
141+
[data/cookbook/tasks.yml](data/cookbook/tasks.yml) may have no recipes yet. On the
142142
other hand, it is not allowed to have a task folder in
143143
[data/cookbook/](data/cookbook/) that does not correspond to a task from the
144144
[data/cookbook/tasks.yml](data/cookbook/tasks.yml) file because it triggers a
@@ -167,7 +167,7 @@ When contributing new recipes to the OCaml Cookbook, please adhere to the follow
167167
- If using a package, does it implicitly recommend the package for production?
168168
- Avoid duplicating existing recipes unless demonstrating package differences.
169169

170-
Following these guidelines will help us maintain a high-quality and consistent OCaml Cookbook.
170+
Following these guidelines will help us maintain a high-quality and consistent OCaml Cookbook.
171171

172172
### <a name="content-recurring-event"></a>Add A Recurring Event
173173

@@ -192,10 +192,9 @@ The Changelog covers developments across:
192192
- [OCaml Infrastructure](https://infra.ocaml.org/)
193193
- [OCaml.org itself](https://ocaml.org/)
194194

195-
196195
#### Purpose and Audience
197196

198-
The primary audience for the Changelog is OCaml users. Content should focus on changes, updates, and news that directly impact users of OCaml and its ecosystem.
197+
The primary audience for the Changelog is OCaml users. Content should focus on changes, updates, and news that directly impact users of OCaml and its ecosystem.
199198

200199
Good candidates for Changelog posts include:
201200

@@ -221,7 +220,6 @@ To contribute a new post to the Changelog:
221220
4. Write the post content, focusing on how the news or change affects OCaml users.
222221
5. Submit a pull request with your new file.
223222

224-
225223
## Git and GitHub Workflow
226224

227225
The preferred workflow for contributing to a repository is to fork the main repository on GitHub, clone, and develop on a new branch.

DOCUMENTATION_WRITING.md

+45-46
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# How to Write Documentation
22

3-
This document explains how to write documentation such as tutorials, guides, or recommendations to be hosted in OCaml.org. It's also meant to be used as a style guide to ensure consistency in things like grammar, formatting, capitalisation, and spelling across all OCaml.org documentation.
3+
This document explains how to write documentation such as tutorials, guides, or recommendations to be hosted in OCaml.org. It's also meant to be used as a style guide to ensure consistency in things like grammar, formatting, capitalisation, and spelling across all OCaml.org documentation.
44

5-
Apply the [*Spiral Learning*](https://en.wikipedia.org/wiki/Spiral_approach) approach in tutorials. This teaching method first creates a solid foundation of a topic. By starting with an overview, it gives the reader the context and general information. Subsequent sections and tutorials review the important foundational information and expands, going into more detail and giving examples.
5+
Apply the [*Spiral Learning*](https://en.wikipedia.org/wiki/Spiral_approach) approach in tutorials. This teaching method first creates a solid foundation of a topic. By starting with an overview, it gives the reader the context and general information. Subsequent sections and tutorials review the important foundational information and expands, going into more detail and giving examples.
66

77
## Materials
88

@@ -16,26 +16,28 @@ Apply the [*Spiral Learning*](https://en.wikipedia.org/wiki/Spiral_approach) app
1616

1717
## Audience
1818

19-
Anytime one contributes to the OCaml.org documentation, it's important to keep the target audience in mind. For example, if writing a tutorial for programmers new to OCaml, you want to ensure the examples are simple and straighforward so as not to overwhelm them with too much detail while starting their learning journey. For more advanced users, adjust the tone and examples accordingly.
19+
Anytime one contributes to the OCaml.org documentation, it's important to keep the target audience in mind. For example, if writing a tutorial for programmers new to OCaml, you want to ensure the examples are simple and straighforward so as not to overwhelm them with too much detail while starting their learning journey. For more advanced users, adjust the tone and examples accordingly.
2020

2121
**Our audience:**
22-
* Self-directed learners without a tutor
23-
* Already know some programming basics (one other programming language)
24-
* Likely a majority of consumers of libraries, hopefully some authors or people who turn into it
25-
* English level B2 ideally
22+
- Self-directed learners without a tutor
23+
- Already know some programming basics (one other programming language)
24+
- Likely a majority of consumers of libraries, hopefully some authors or people who turn into it
25+
- English level B2 ideally
2626

2727
**Not our audience:**
28-
* University students
29-
* New to programming. We do not teach programming basics.
28+
- University students
29+
- New to programming. We do not teach programming basics.
3030

3131
## Goals
32+
3233
Especially since the release of OCaml 5.0 with Multicore support, perhaps our biggest goal is to increase the adoption of OCaml. In order to reach this goal, it's essential to have current, consistent, and comprehensive documentation.
3334

3435
1. Enable people to use OCaml for real projects / at the job / side projects
3536
1. Get people who want to build and contribute to the ecosystem up to speed and building something good quickly
3637
1. **Oddly Specific**: Enable people to do Advent of Code in OCaml.
3738

38-
## Our Key Values / Constraints:
39+
## Our Key Values / Constraints
40+
3941
- **Goals and Prerequisites**. Each tutorial begins with its objectives, so that people know what they will learn about.```
4042
- **Avoid Overwhelming Choices**. Tutorials should guide learners on a straightforward path, avoiding multiple options. This makes the learning process smoother. Detailed choices can be included in additional references and guides.
4143
- **Highlight Important Computer Science Terms**. Use italics for well-known terms, providing a visual hint that these are important concepts. Linking to Wikipedia for further explanation is an option.
@@ -47,32 +49,31 @@ Especially since the release of OCaml 5.0 with Multicore support, perhaps our bi
4749
## Common Phrases
4850

4951
- "Binding a value to a name" = declaring a variable
50-
- `'a` is a type parameter called "alpha." It is not a _type variable_ (because the term _variable_ is a forbidden word).
52+
- `'a` is a type parameter called "alpha." It is not a *type variable* (because the term *variable* is a forbidden word).
5153
- Pass a function as a value to another function as a parameter - not a "function value"
5254

53-
5455
## Things to Avoid
5556

56-
1. Don't use the same letter for different things, i.e., when talking about a type parameter `'a`, don't have a name `a` nearby. In fact, since `a` can easily be confused with `'a` (alpha), start with `f` when using letters as parameters.
57+
1. Don't use the same letter for different things, i.e., when talking about a type parameter `'a`, don't have a name `a` nearby. In fact, since `a` can easily be confused with `'a` (alpha), start with `f` when using letters as parameters.
5758
1. Never use the term "variable," instead
5859
a. Names and values (binding = a value is bound to a name)
5960
b. Type parameter
6061
1. Use “parameter” and “argument” appropriately. Parameters occur in function declarations. Arguments are values that functions are applied to.
6162
1. Don't use math, computer science, or programming language theory terminology without reason and explanation.
6263

64+
## Writing, Grammar, and Spelling
6365

64-
## Writing, Grammar, and Spelling
65-
66-
Please don't worry about this too much, as a technical writer will review any new documentation or changes to catch these types of things. It's included here for reference, if interested.
66+
Please don't worry about this too much, as a technical writer will review any new documentation or changes to catch these types of things. It's included here for reference, if interested.
6767

6868
### Tone & POV
69-
We're aiming for a relatively casual tone in these tutorials and other documentation. This means that it should read like you're speaking directly to the reader rather than an academic tone. To this end, it is acceptable to use second person (you), sparingly.
7069

71-
It's also okay to use first person plural (we, us), sparingly, but don't use the first person singular (I, me), as there isn't an author byline for the reader to know who "I" is. Using "we" can be helpful to write active sentences (more below).
70+
We're aiming for a relatively casual tone in these tutorials and other documentation. This means that it should read like you're speaking directly to the reader rather than an academic tone. To this end, it is acceptable to use second person (you), sparingly.
7271

72+
It's also okay to use first person plural (we, us), sparingly, but don't use the first person singular (I, me), as there isn't an author byline for the reader to know who "I" is. Using "we" can be helpful to write active sentences (more below).
7373

7474
### Active Voice & Unnecessary Words
75-
Active sentences employ a clear subject that performs an action with a robust verb (e.g., Mary baked the cake.), as opposed to weak verbs such as *occur* and *happen.* Passive sentences typically incorporate '***to be'*** verbs (is, are, were, was, etc.), where the subject undergoes the action (e.g., he cake was baked by Mary). Although it's not possible to avoid all **to be** verbs, try to minimise them when possible.
75+
76+
Active sentences employ a clear subject that performs an action with a robust verb (e.g., Mary baked the cake.), as opposed to weak verbs such as *occur* and *happen.* Passive sentences typically incorporate '***to be'*** verbs (is, are, were, was, etc.), where the subject undergoes the action (e.g., he cake was baked by Mary). Although it's not possible to avoid all **to be** verbs, try to minimise them when possible.
7677

7778
The sentences below highlight issues and provide suggestions for improvement:
7879

@@ -84,37 +85,35 @@ The sentences below highlight issues and provide suggestions for improvement:
8485

8586
It's best to eliminate unnecessary prepositional phrases, especially when using with the possessive. Avoid phrases like "the car of Susan." Instead, write "Susan's car." When prepositional phrases (e.g., those starting with by, for, in, of, on, etc.) are strung together, it makes for clumsy and awkward sentences. For example: "She went *on* a road trip *across* the mountains *to* take pictures." This sentence has three prepositional phrases back to back. You can improve it by removing at least one prepositional phrase, like this: "She took pictures on her roadtrip across the mountains."
8687

87-
Following these guidelines makes for more enjoyable reading experience.
88+
Following these guidelines makes for more enjoyable reading experience.
8889

8990
### Spelling & Grammar
9091

9192
- [Grammar Help at Grammarly](https://www.grammarly.com/blog/category/handbook/)
9293
- **Punctuation Preferences:**
93-
- Oxford (serial) comma [We bought bread, milk, and peanut butter], so there is a final comma before the conjunction.
94-
- Single space after a `.` period (full stop).
95-
- Always use `'` for singular names/nouns ending in `s` and for plural nouns ending in `s` (e.g., Thomas’ and Companies’). Although the grammatically correct way to say and spell singular nouns ending in `s` is “Thomas’s”, it does look weird. It’s the consensus to treat every `s` as if it were a plural possessive, so instead write "Thomas'." Whenever possible, rephrase the sentence to avoid it completely.
96-
- Place punctuation inside of quotation marks: OCaml is an "industrial-strength functional programming language with an emphasis on expressiveness and safety." (not "...safety".)
97-
- Use **en dashes ``** surrounded by spaces for 'asides' (as an alternative, you can use parentheses). Example: OCaml Multicore is – as my grandmother would say – an excellent upgrade.
98-
- [Cambridge Dictionary: Punctuation](https://dictionary.cambridge.org/grammar/british-grammar/punctuation)
99-
- [Differences in British & American](https://www.unr.edu/writing-speaking-center/student-resources/writing-speaking-resources/british-american-english), please use the British spelling. See below.
100-
- [Another ^^](https://www.thepunctuationguide.com/british-versus-american-style.html)
94+
- Oxford (serial) comma [We bought bread, milk, and peanut butter], so there is a final comma before the conjunction.
95+
- Single space after a `.` period (full stop).
96+
- Always use `'` for singular names/nouns ending in `s` and for plural nouns ending in `s` (e.g., Thomas’ and Companies’). Although the grammatically correct way to say and spell singular nouns ending in `s` is “Thomas’s”, it does look weird. It’s the consensus to treat every `s` as if it were a plural possessive, so instead write "Thomas'." Whenever possible, rephrase the sentence to avoid it completely.
97+
- Place punctuation inside of quotation marks: OCaml is an "industrial-strength functional programming language with an emphasis on expressiveness and safety." (not "...safety".)
98+
- Use **en dashes ``** surrounded by spaces for 'asides' (as an alternative, you can use parentheses). Example: OCaml Multicore is – as my grandmother would say – an excellent upgrade.
99+
- [Cambridge Dictionary: Punctuation](https://dictionary.cambridge.org/grammar/british-grammar/punctuation)
100+
- [Differences in British & American](https://www.unr.edu/writing-speaking-center/student-resources/writing-speaking-resources/british-american-english), please use the British spelling. See below.
101+
- [Another ^^](https://www.thepunctuationguide.com/british-versus-american-style.html)
101102
- **Spelling**
102-
- [British spelling](http://www.tysto.com/uk-us-spelling-list.html)
103-
- ise rather than -ize (organise vs organize)
104-
- our, not or (flavour vs flavor)
105-
- yse, not yze (analyse vs analyze)
106-
- Double L : travelling vs traveling
107-
- ae/oe vs e (manoeuvre vs maneuver)
108-
- ence, not -ense (licence vs license)
109-
- ogue, not og (catalogue vs catalog)
110-
- learnt, not learned
111-
- focussed / focusses (instead of the single s: focused / focuses)
112-
- vs, not vs. as in American English. Same with Dr, Mr, Ms, Mrs instead of Dr., Mr., Ms., Mrs.
113-
- Although programme is traditionally the UK spelling, **program** is more common.
114-
115-
- **Capitalisation**
116-
- Capitalise every word (except “little words” like of, and, or, etc.) in titles, aka “[Title Case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case).” Strangely, it is correct to capitalise “with” in a title.
117-
- Use Title Case in headings / subheadings. Try to keep them under 7 words.
118-
- Capitalise the first letter of bullet points, aka “[Sentence Case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/sentence-case).” However, if it’s not a complete sentence in the bullet point, don’t use a period (full stop) unless it’s followed by other sentences.
119-
103+
- [British spelling](http://www.tysto.com/uk-us-spelling-list.html)
104+
- ise rather than -ize (organise vs organize)
105+
- our, not or (flavour vs flavor)
106+
- yse, not yze (analyse vs analyze)
107+
- Double L : travelling vs traveling
108+
- ae/oe vs e (manoeuvre vs maneuver)
109+
- ence, not -ense (licence vs license)
110+
- ogue, not og (catalogue vs catalog)
111+
- learnt, not learned
112+
- focussed / focusses (instead of the single s: focused / focuses)
113+
- vs, not vs. as in American English. Same with Dr, Mr, Ms, Mrs instead of Dr., Mr., Ms., Mrs.
114+
- Although programme is traditionally the UK spelling, **program** is more common.
120115

116+
- **Capitalisation**
117+
- Capitalise every word (except “little words” like of, and, or, etc.) in titles, aka “[Title Case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case).” Strangely, it is correct to capitalise “with” in a title.
118+
- Use Title Case in headings / subheadings. Try to keep them under 7 words.
119+
- Capitalise the first letter of bullet points, aka “[Sentence Case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/sentence-case).” However, if it’s not a complete sentence in the bullet point, don’t use a period (full stop) unless it’s followed by other sentences.

0 commit comments

Comments
 (0)