Skip to content

Commit 5954786

Browse files
Line editing Contributing.md (#1154)
line editing for contributing
1 parent 60e6256 commit 5954786

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@ Contributing to the HTML is slightly more complex. The main HTML generator is in
1313
Here's a step-by-step guide to get you set up for HTML contribution:
1414

1515
1. **Install requirements:**
16-
* Install a recent version of [HTML tidy](http://www.html-tidy.org/) (used for HTML validity testing). Here's how:
17-
- On MacOS (should be version 5.6.0 by the date of this writing): `brew install tidy-html5`
16+
* Install a recent version of [HTML Tidy](http://www.html-tidy.org/) (used for HTML validity testing). Here's how:
17+
- On MacOS (should be version 5.8 by the date of this writing): `brew install tidy-html5`
1818
- On Debian / Ubuntu: `sudo apt-get install tidy`
19-
* Install a recent version of [jq](https://github.com/stedolan/jq). Here's how:
19+
* Install a recent version of [`jq`](https://github.com/stedolan/jq). Here's how:
2020
- On MacOS: `brew install jq`
2121
- On Debian / Ubuntu: `sudo apt-get install jq`
2222

2323
2. **Set up for development:**
24-
Clone the odoc repository, navigate into the new directory, and install dependencies with these commands:
24+
Clone the `odoc` repository, navigate into the new directory, and install dependencies with these commands:
2525
```
2626
git clone https://github.com/ocaml/odoc.git
2727
cd odoc
28-
opam pin add --no-action odoc .
29-
opam install --with-test --deps-only odoc
28+
opam install --with-test --deps-only ./odoc-parser.opam ./odoc.opam
3029
```
3130

3231
3. **Make and test changes:**
@@ -40,31 +39,31 @@ Here's a step-by-step guide to get you set up for HTML contribution:
4039

4140
## Testing
4241

43-
`odoc` uses a variety of different test types. We are slowly converging on using Dune's [cram tests](https://dune.readthedocs.io/en/stable/tests.html#cram-tests), though we still have many tests that aren't yet converted.
42+
`odoc` uses a variety of different test types. We are slowly converging on using Dune's [Cram tests](https://dune.readthedocs.io/en/stable/tests.html#cram-tests), though we still have many tests that aren't yet converted.
4443

4544
### Cram Tests
4645

47-
The tests extensively use these for the model layer and are found in [test/xref2](https://github.com/ocaml/odoc/blob/master/test/xref2). These consist of a directory called something.t, containing a file run.t. This file has shell-like syntax and usually runs `odoc` on some carefully crafted input files.
46+
The tests extensively use these for the model layer and are found in [test/xref2](https://github.com/ocaml/odoc/blob/master/test/xref2). These consist of a directory called `something.t`, containing a file `run.t`. This file has shell-like syntax and usually runs `odoc` on some carefully crafted input files.
4847

49-
For tests of the model layer, it's often useful to use the binary odoc_print which can dump .odoc and .odocl files as JSON. This output can then be piped through jq to verify that values are as expected.
48+
For tests of the model layer, it's often useful to use the binary `odoc_print` which can dump `.odoc` and `.odocl` files as JSON. This output can then be piped through jq to verify that values are as expected.
5049

5150
We try to make these test files describe the test and what's expected, which helps when the output isn’t what the test expected. This also means that the tests can serve as documentation of how things work. As an example, see the file [test/xref2/multi_file_module_type_of.t/run.t](https://github.com/ocaml/odoc/blob/master/test/xref2/multi_file_module_type_of.t/run.t)
5251

53-
The tests work by executing the shell script snippets and then comparing the actual output with those in the run.t files. If these don't match, the difference is rendered as a diff.
52+
The tests work by executing the shell script snippets and then comparing the actual output with those in the `run.t` files. If these don't match, the difference is rendered as a diff.
5453

5554
If the test is broken, run `dune promote` to replace the expected output with the current output.
5655

5756
### Other Expect-Tests
5857

5958
Many of `odoc`'s older tests are custom Expect-tests, similar to those run in the Cram test above, but that don't use Dune's promote workflow.
6059

61-
When one of these Expect-tests fail, the output is saved, so the developer can choose to replace the now-incorrect expected string. For these custom Expect-tests, the results may look like the example given in the ocamldoc.
60+
When one of these Expect-tests fail, the output is saved, so the developer can choose to replace the now-incorrect expected string. For these custom Expect-tests, the results may look like the example given in the OCamldoc.
6261

6362
We are slowly shifting these custom Expect-tests over to the Dune promote workflow.
6463

6564
### Coverage Analysis
6665

67-
The `odoc` repo is set up for coverage analysis. This is most useful if you're writing new tests, and want to know what they’re actually touching.
66+
The `odoc` repo is set up for coverage analysis. This is most useful if you're writing new tests and want to know what they’re actually touching.
6867

6968
To use it:
7069

@@ -74,42 +73,42 @@ To use it:
7473
```
7574
You can then open `_coverage/index.html` and see the coverage of the code you’d like your new test to reach.
7675

77-
- Write new tests.
78-
- Check coverage again.
76+
- Write new tests
77+
- Check coverage again
7978

8079
### CI Tests
8180

82-
`odoc` is tested by [ocaml-ci](https://ci.ocamllabs.io/) and by GitHub workflows. One of these also does a coverage build, so we have up-to-date coverage stats on [Coveralls](https://coveralls.io/github/ocaml/odoc).
81+
`odoc` is tested by [OCaml-CI](https://ci.ocamllabs.io/) and by GitHub workflows. One of these also does a coverage build, so we have up-to-date coverage stats on [Coveralls](https://coveralls.io/github/ocaml/odoc).
8382

84-
The tests cover Esy and Opam builds on Windows, macOS, and Linux. The Linux tests cover all supported versions of OCaml. We strive to retain compatibility back as far as we can (currently 4.02) which is important for supporting [ocaml.org/docs](https://ocaml.org/docs/).
83+
The tests cover esy and opam builds on Windows, macOS, and Linux. The Linux tests cover all supported versions of OCaml. We strive to retain compatibility back as far as we can (currently 4.02) which is important for supporting [ocaml.org/docs](https://ocaml.org/docs/).
8584

8685
## API Reference
8786

8887
### Loading
8988

90-
The [odoc.loader](https://ocaml.github.io/odoc/odoc_loader/index.html) library is responsible for converting from the OCaml [`Typedtree`](https://ocaml.github.io/odoc/deps/stdlib/Typedtree/index.html) representations to the [internal representation](https://ocaml.github.io/odoc/odoc_model/Odoc_model/Lang/index.html).
89+
The [`odoc.loader`](https://ocaml.github.io/odoc/odoc_loader/index.html) library is responsible for converting from the OCaml [`Typedtree`](https://ocaml.github.io/odoc/deps/stdlib/Typedtree/index.html) representations to the [internal representation](https://ocaml.github.io/odoc/odoc_model/Odoc_model/Lang/index.html).
9190

9291
### Model
9392

94-
The [odoc.model](https://ocaml.github.io/odoc/odoc_model/index.html) library contains definitions of the internal types used to represent OCaml interfaces.
93+
The [`odoc.model`](https://ocaml.github.io/odoc/odoc_model/index.html) library contains definitions of the internal types used to represent OCaml interfaces.
9594

9695
### Resolution and Expansion
9796

98-
Resolution of Paths, Fragments and References, and Expansion of Modules and Module Types are handled by the [odoc.xref2](https://ocaml.github.io/odoc/odoc_xref2/index.html) library.
97+
Resolution of Paths, Fragments and References, and Expansion of Modules and Module Types are handled by the [`odoc.xref2`](https://ocaml.github.io/odoc/odoc_xref2/index.html) library.
9998

10099
### Intermediate Representation and Renderers
101100

102-
The generic documentation intermediate format is defined in the [odoc.document](https://ocaml.github.io/odoc/odoc_document/index.html) library.
101+
The generic documentation intermediate format is defined in the [`odoc.document`](https://ocaml.github.io/odoc/odoc_document/index.html) library.
103102

104-
The three current renderers are implemented within the following libraries: [odoc.html](https://ocaml.github.io/odoc/odoc_html/index.html), [odoc.latex](https://ocaml.github.io/odoc/odoc_latex/index.html), and [odoc.manpage](https://ocaml.github.io/odoc/odoc_manpage/index.html).
103+
The three current renderers are implemented within the following libraries: [`odoc.html`](https://ocaml.github.io/odoc/odoc_html/index.html), [`odoc.latex`](https://ocaml.github.io/odoc/odoc_latex/index.html), and [`odoc.manpage`](https://ocaml.github.io/odoc/odoc_manpage/index.html).
105104

106105
### CLI and Driver
107106

108-
The CLI for odoc and various helper functions for driving the process are contained in the [odoc.odoc](https://ocaml.github.io/odoc/odoc_odoc/index.html) library.
107+
The CLI for `odoc` and various helper functions for driving the process are contained in the [`odoc.odoc`](https://ocaml.github.io/odoc/odoc_odoc/index.html) library.
109108

110109
### Test and Internal Libraries
111110

112-
There are a couple of libraries used internally for testing - [odoc.xref_test](https://ocaml.github.io/odoc/odoc_xref_test/index.html) and [odoc.model_desc](https://ocaml.github.io/odoc/odoc_model_desc/index.html).
111+
There are a couple of libraries used internally for testing - [`odoc.xref_test`](https://ocaml.github.io/odoc/odoc_xref_test/index.html) and [`odoc.model_desc`](https://ocaml.github.io/odoc/odoc_model_desc/index.html).
113112

114113
## Dependency Libraries
115114

0 commit comments

Comments
 (0)