You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/sphinx-guides/source/contributor/documentation.md
+38-37Lines changed: 38 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,76 +50,77 @@ If you would like to read more about the Dataverse's use of GitHub, please see t
50
50
51
51
## Building the Guides with Sphinx
52
52
53
-
While the "quick fix" technique shown above should work fine for minor changes, especially for larger changes, we recommend installing Sphinx on your computer or using a Sphinx Docker container to build the guides locally so you can get an accurate preview of your changes.
53
+
While the "quick fix" technique shown above should work fine for minor changes, in many cases, you're going to want to preview changes locally before committing them.
54
54
55
-
In case you decide to use a Sphinx Docker container to build the guides, you can skip the next two installation sections, but you will need to have Docker installed.
55
+
Before we worry about pushing changes to the code, let's make sure we can build the guides.
56
56
57
-
### Installing Sphinx
57
+
Go to <https://github.com/IQSS/dataverse> and click "Code" and then follow the instructions to clone the code locally.
58
58
59
-
First, make a fork of <https://github.com/IQSS/dataverse>and clone your fork locally. Then change to the ``doc/sphinx-guides`` directory.
59
+
### Makefile and Docker
60
60
61
-
``cd doc/sphinx-guides``
61
+
From a terminal, switch to the "dataverse" directory you just cloned.
62
62
63
-
Create a Python virtual environment, activate it, then install dependencies:
64
-
65
-
``python3 -m venv venv``
63
+
`cd dataverse`
66
64
67
-
``source venv/bin/activate``
65
+
Then try building the HTML version of the guides.
68
66
69
-
``pip install -r requirements.txt``
67
+
`make docs-html`
70
68
71
-
### Installing GraphViz
69
+
If all goes well, you should be able open `doc/sphinx-guides/build/html/index.html` to see the guides you just built.
72
70
73
-
In some parts of the documentation, graphs are rendered as images using the Sphinx GraphViz extension.
71
+
Here is the complete list of commands.
74
72
75
-
Building the guides requires the ``dot`` executable from GraphViz.
73
+
-`make docs-html`
74
+
-`make docs-pdf`
75
+
-`make docs-epub`
76
+
-`make docs-all`
76
77
77
-
This requires having [GraphViz](https://graphviz.org) installed and either having ``dot`` on the path or
78
-
[adding options to the `make` call](https://groups.google.com/forum/#!topic/sphinx-users/yXgNey_0M3I).
78
+
### Docker
79
79
80
-
On a Mac we recommend installing GraphViz through [Homebrew](<https://brew.sh>). Once you have Homebrew installed and configured to work with your shell, you can type `brew install graphviz`.
80
+
Also from the "dataverse" directory (the root of the git repo), you can try this command:
81
81
82
-
### Editing and Building the Guides
82
+
`docker run -it --rm -v $(pwd):/docs sphinxdoc/sphinx:7.2.6 bash -c "cd doc/sphinx-guides && pip3 install -r requirements.txt && make html"`
83
83
84
-
To edit the existing documentation:
84
+
### Sphinx Installed Locally
85
85
86
-
- Create a branch (see {ref}`how-to-make-a-pull-request`).
87
-
- In ``doc/sphinx-guides/source`` you will find the .rst files that correspond to https://guides.dataverse.org.
88
-
- Using your preferred text editor, open and edit the necessary files, or create new ones.
86
+
First, run `python --version` or `python3 --version` to determine the version of Python you have. If you don't have Python 3.10 or higher, you must upgrade.
89
87
90
-
Once you are done, you can preview the changes by building the guides locally. As explained, you can build the guides with Sphinx locally installed, or with a Docker container.
88
+
Next, change to the `doc/sphinx-guides` directory.
91
89
92
-
#### Building the Guides with Sphinx Installed Locally
90
+
`cd doc/sphinx-guides`
93
91
94
-
Open a terminal, change directories to `doc/sphinx-guides`, activate (or reactivate) your Python virtual environment, and build the guides.
92
+
Create a Python virtual environment, activate it, then install dependencies:
95
93
96
-
`cd doc/sphinx-guides`
94
+
`python3 -m venv venv`
97
95
98
96
`source venv/bin/activate`
99
97
100
-
`make clean`
98
+
`pip install -r requirements.txt`
101
99
102
-
`make html`
100
+
Next, install [GraphViz](https://graphviz.org) because building the guides requires having the `dot` executable from GraphViz either on the path or passed [as an argument](https://groups.google.com/g/sphinx-users/c/yXgNey_0M3I/m/3T2NipFlBgAJ).
103
101
104
-
#### Building the Guides with a Sphinx Docker Container and a Makefile
102
+
On a Mac we recommend installing GraphViz through [Homebrew](<https://brew.sh>). Once you have Homebrew installed and configured to work with your shell, you can type `brew install graphviz`.
105
103
106
-
We have added a Makefile to simplify the process of building the guides using a Docker container, you can use the following commands from the repository root:
104
+
Finally, you can try building the guides with the following command.
107
105
108
-
-`make docs-html`
109
-
-`make docs-pdf`
110
-
-`make docs-epub`
111
-
-`make docs-all`
106
+
`make html`
112
107
113
-
#### Building the Guides with a Sphinx Docker Container and CLI
108
+
If all goes well, you should be able open `doc/sphinx-guides/build/html/index.html` to see the guides you just built.
114
109
115
-
If you want to build the guides using a Docker container, execute the following command in the repository root:
110
+
## Editing, Building, and Previewing the Guides
116
111
117
-
`docker run -it --rm -v $(pwd):/docs sphinxdoc/sphinx:7.2.6 bash -c "cd doc/sphinx-guides && pip3 install -r requirements.txt && make html"`
112
+
To edit the existing documentation:
113
+
114
+
- Create a branch (see {ref}`how-to-make-a-pull-request`).
115
+
- In `doc/sphinx-guides/source` you will find the .rst or .md files that correspond to https://guides.dataverse.org.
116
+
- Using your preferred text editor, open and edit the necessary files, or create new ones.
118
117
119
-
#### Previewing the Guides
118
+
Once you are done, you can preview the changes by building the guides using one of the options above.
120
119
121
120
After Sphinx is done processing the files you should notice that the `html` folder in `doc/sphinx-guides/build` directory has been updated. You can click on the files in the `html` folder to preview the changes.
122
121
122
+
## Making a Pull Request
123
+
123
124
Now you can make a commit with the changes to your own fork in GitHub and submit a pull request. See {ref}`how-to-make-a-pull-request`.
0 commit comments