|
1 |
| -# Documentation and Tutorials for Turing.jl |
| 1 | +# Turing.jl Documentation and Tutorials |
2 | 2 |
|
3 |
| -This repository hosts the code for the main Turing.jl documentation `https://turinglang.org/docs/`. |
4 |
| -It contains the Turing.jl documentation and tutorials. |
| 3 | +**https://turinglang.org/docs/** |
5 | 4 |
|
6 |
| -- The `main` branch contains the Quarto source. |
7 |
| -- The `gh-pages` branch contains the `html` version of these documents compiled from the `main` branch. |
| 5 | +## Contributing |
8 | 6 |
|
9 |
| -## Local development |
| 7 | +The easiest way to contribute to the documentation is to simply open a pull request. |
| 8 | +A preview version of the documentation is built for PRs, so you can see how your changes look without having to build the entire site locally. |
| 9 | +(Note that if you are editing a tutorial that takes a long time to run, this feedback may take a while.) |
| 10 | + |
| 11 | +The `main` branch contains the Quarto source code. |
| 12 | +The HTML documentation is automatically built using GitHub Actions, and deployed to the `gh-pages` branch, so you do not have to build and commit the HTML files yourself. |
10 | 13 |
|
11 |
| -To get started with the docs website locally, you'll need to have [Quarto](https://quarto.org/docs/download/) installed. |
12 |
| -Make sure you have at least version 1.6.31 of Quarto installed, as this version contains a fix for [a bug where random number generation in different cells was not deterministic](https://github.com/TuringLang/docs/issues/533). |
| 14 | +## Local development |
13 | 15 |
|
14 |
| -Once you have Quarto installed, you can follow these steps: |
| 16 | +If you wish to render the docs website locally, you'll need to have [Quarto](https://quarto.org/docs/download/) installed (at least version 1.6.31) on your computer. |
| 17 | +Then: |
15 | 18 |
|
16 | 19 | 1. Clone this repository:
|
17 | 20 |
|
18 |
| - ```bash |
19 |
| - git clone https://github.com/TuringLang/docs |
20 |
| - ``` |
| 21 | + ```bash |
| 22 | + git clone https://github.com/TuringLang/docs |
| 23 | + ``` |
21 | 24 |
|
22 | 25 | 2. Navigate into the cloned directory:
|
23 | 26 |
|
24 |
| - ```bash |
25 |
| - cd docs |
26 |
| - ``` |
| 27 | + ```bash |
| 28 | + cd docs |
| 29 | + ``` |
27 | 30 |
|
28 | 31 | 3. Instantiate the project environment:
|
29 | 32 |
|
30 |
| - ```bash |
31 |
| - julia --project=. -e 'using Pkg; Pkg.instantiate()' |
32 |
| - ``` |
| 33 | + ```bash |
| 34 | + julia --project=. -e 'using Pkg; Pkg.instantiate()' |
| 35 | + ``` |
33 | 36 |
|
34 | 37 | 4. Preview the website using Quarto.
|
35 | 38 |
|
36 |
| - > [!WARNING] |
37 |
| - > This will take a _very_ long time, as it will build every tutorial from scratch. See below for ways to speed this up. |
| 39 | + > [!WARNING] |
| 40 | + > |
| 41 | + > This will take a _very_ long time, as it will build every tutorial from scratch. See [below](#faster-rendering) for ways to speed this up. |
38 | 42 |
|
39 |
| - ```bash |
40 |
| - quarto preview |
41 |
| - ``` |
| 43 | + ```bash |
| 44 | + quarto preview |
| 45 | + ``` |
42 | 46 |
|
43 |
| - This will launch a local server at http://localhost:4200/, which you can view in your web browser by navigating to the link shown in your terminal. |
44 |
| - Note: Avoid clicking links in the navbar while previewing locally because they will eventually lead to https links online! |
| 47 | + This will launch a local server at http://localhost:4200/, which you can view in your web browser by navigating to the link shown in your terminal. |
45 | 48 |
|
46 | 49 | 5. Render the website locally:
|
47 | 50 |
|
48 |
| - ```bash |
49 |
| - quarto render |
50 |
| - ``` |
| 51 | + ```bash |
| 52 | + quarto render |
| 53 | + ``` |
51 | 54 |
|
52 |
| - This will build the entire documentation and place the output in the `_site` folder. |
53 |
| - You can then view the rendered website by launching a HTTP server from that directory, e.g. using Python: |
| 55 | + This will build the entire documentation and place the output in the `_site` folder. |
| 56 | + You can then view the rendered website by launching a HTTP server from that directory, e.g. using Python: |
54 | 57 |
|
55 |
| - ```bash |
56 |
| - cd _site |
57 |
| - python -m http.server 8000 |
58 |
| - ``` |
| 58 | + ```bash |
| 59 | + cd _site |
| 60 | + python -m http.server 8000 |
| 61 | + ``` |
59 | 62 |
|
60 |
| - Then, navigate to http://localhost:8000/ in your web browser. |
| 63 | + Then, navigate to http://localhost:8000/ in your web browser. |
61 | 64 |
|
62 | 65 | ## Faster rendering
|
63 | 66 |
|
|
0 commit comments