Skip to content

Commit d725cd3

Browse files
Fix merge conflicts
2 parents 9c6ae1c + 67eed49 commit d725cd3

492 files changed

Lines changed: 395 additions & 382 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
version: 2
22
jobs:
3-
build-odkx:
3+
build:
44
working_directory: ~/work
55
docker:
6-
- image: circleci/python:3.9
6+
- image: cimg/python:3.11
77
steps:
88
- checkout
99
- run:
10-
name: Install checkout requirements
10+
name: Install checkout requirements (large-file-support)
1111
command: |
1212
sudo apt-get update
1313
sudo apt-get install git-lfs
14-
git lfs install
1514
- run:
1615
name: Checkout binaries
1716
command: git lfs pull
@@ -20,35 +19,35 @@ jobs:
2019
command: |
2120
sudo apt-get install pngquant
2221
sudo apt-get install python3-enchant
23-
sudo pip install -r requirements.txt
22+
pip3 install --user -r requirements.txt
23+
pip3 install --user -r style-test-requirements.txt
2424
- run:
25-
name: Style Guide Check
25+
name: Generate html output
26+
command: make dirhtml
27+
- run:
28+
name: Check spelling
2629
command: |
27-
paths=$(git diff origin/master... --name-only)
28-
echo $paths
29-
sudo python style-test.py $paths -r odkx-src
30-
sudo python style-test.py $paths -r shared-src
30+
make spelling
31+
python3 util/check-spelling-output.py build/spelling
3132
- run:
32-
name: Build ODK-X Documentation
33-
command: make odkx-deploy
33+
name: Compress images
34+
command: pngquant build/dirhtml/_images/*.png --force --ext .png --verbose
3435
- run:
35-
name: Check spelling of ODK-X Documentation
36-
command: make odkx-spell-check
36+
name: Style check of changed files
37+
command: |
38+
paths=$(git diff origin/main --name-only)
39+
python3 style-test.py $paths -r src
3740
- run:
3841
name: Build LaTex of ODK-X Documentation
39-
command: make odkx-latex
40-
- run:
41-
name: Compress images
42-
command: pngquant odkx-build/_images/*.png --force --ext .png --verbose
42+
command: make latex
4343
- store_artifacts:
44-
path: odkx-build
45-
destination: odkx-build
44+
path: build
4645
- persist_to_workspace:
4746
root: ~/work
4847
paths:
49-
- odkx-build/*
48+
- build/*
5049
- s3_website.yml
51-
build-pdf-odkx:
50+
build-pdf:
5251
working_directory: ~/work
5352
docker:
5453
- image: schickling/latex
@@ -58,20 +57,19 @@ jobs:
5857
- run:
5958
name: Build PDF
6059
command: |
61-
cd odkx-build/latex
60+
cd build/latex
6261
xelatex ODK-X.tex
6362
xelatex ODK-X.tex
64-
mkdir -p ../_downloads
65-
mv ODK-X.pdf ../_downloads/ODK-X-Documentation.pdf
63+
mkdir -p ../dirhtml/_downloads
64+
mv ODK-X.pdf ../dirhtml/_downloads/ODK-X-Documentation.pdf
6665
- store_artifacts:
67-
path: odkx-build/_downloads/ODK-X-Documentation.pdf
66+
path: build/dirhtml/_downloads/ODK-X-Documentation.pdf
6867
destination: ODK-X-Documentation.pdf
6968
- persist_to_workspace:
7069
root: ~/work
7170
paths:
72-
- odkx-build/*
73-
74-
deploy-odkx:
71+
- build/dirhtml/*
72+
deploy:
7573
working_directory: ~/work
7674
docker:
7775
- image: cimg/ruby:3.2
@@ -81,9 +79,11 @@ jobs:
8179
- run:
8280
name: Install deploy requirements
8381
command: |
82+
if [[ "$CIRCLE_PROJECT_USERNAME" == "odk-x" ]]; then \
8483
sudo apt-get update
8584
sudo apt-get install -y pngquant openjdk-11-jre-headless
8685
gem install s3_website_revived && s3_website install
86+
fi
8787
- run:
8888
name: Push to S3
8989
command: |
@@ -93,16 +93,16 @@ workflows:
9393
version: 2
9494
build_deploy:
9595
jobs:
96-
- build-odkx
97-
- build-pdf-odkx:
96+
- build
97+
- build-pdf:
9898
requires:
99-
- build-odkx
100-
- deploy-odkx:
99+
- build
100+
- deploy:
101101
context: AWS
102102
requires:
103-
- build-odkx
104-
- build-pdf-odkx
103+
- build
104+
- build-pdf
105105
filters:
106106
branches:
107107
only:
108-
- master
108+
- main

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9.16-buster
1+
FROM python:3.12.1
22

33
WORKDIR /mnt
44

@@ -13,6 +13,6 @@ RUN apt-get update -y && \
1313
python -m pip install --upgrade pip && \
1414
pip install --no-cache-dir -r requirements.txt
1515

16-
ENTRYPOINT ["make"]
16+
ENTRYPOINT ["make", "dockerserve"]
1717

1818
EXPOSE 8080

Makefile

Lines changed: 18 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,28 @@
11
# Minimal makefile for Sphinx documentation
22
#
33

4-
# You can set these variables from the command line.
5-
PYTHON = python3
6-
SPHINXOPTS =
7-
SPHINXBUILD = sphinx-build
8-
ODKX_SRCDIR = odkx-src
9-
COMPILE_X_SRCDIR = tmpx-src
10-
ODKX_BUILDDIR = odkx-build
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCE_DIR = src
9+
BUILD_DIR = build
1110

11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCE_DIR)" "$(BUILD_DIR)" $(SPHINXOPTS) $(O)
1214

1315
.PHONY: help Makefile
1416

15-
odkx-autobuild:
16-
sphinx-autobuild --port 8080 --host 0.0.0.0 odkx-src odkx-build
17+
dockerserve:
18+
sphinx-autobuild --host 0.0.0.0 --port 8080 -b dirhtml "$(SOURCE_DIR)" "$(BUILD_DIR)/html"
1719

18-
odkx-clean:
19-
rm -rf $(COMPILE_X_SRCDIR)
20-
rm -rf $(ODKX_BUILDDIR)
20+
serve:
21+
sphinx-autobuild -b dirhtml "$(SOURCE_DIR)" "$(BUILD_DIR)/html"
2122

22-
odkx-clean-files:
23-
rm -rf $(COMPILE_X_SRCDIR)
24-
rm -rf $(ODKX_BUILDDIR)/*
23+
autobuild : serve
2524

26-
clean: odkx-clean
27-
28-
odkx-copy: odkx-clean-files
29-
mkdir $(COMPILE_X_SRCDIR)
30-
cp -rf $(ODKX_SRCDIR)/* $(COMPILE_X_SRCDIR)
31-
32-
odkx: odkx-copy
33-
@$(SPHINXBUILD) -b dirhtml "$(COMPILE_X_SRCDIR)" "$(ODKX_BUILDDIR)" $(SPHINXOPTS)
34-
35-
odkx-deploy: odkx-copy
36-
@$(SPHINXBUILD) -W -b dirhtml "$(COMPILE_X_SRCDIR)" "$(ODKX_BUILDDIR)" $(SPHINXOPTS)
37-
38-
build-all: odkx
39-
40-
odkx-build: odkx
41-
42-
odkx-latex: odkx
43-
@$(SPHINXBUILD) -b latex "$(COMPILE_X_SRCDIR)" "$(ODKX_BUILDDIR)"/latex $(SPHINXOPTS)
44-
$(PYTHON) util/resize.py "$(ODKX_BUILDDIR)"
45-
46-
odkx-pdf: odkx-latex
47-
cd "$(ODKX_BUILDDIR)"/latex && \
48-
xelatex ODK-X.tex && \
49-
xelatex ODK-X.tex && \
50-
mkdir -p ../_downloads && \
51-
mv ODK-X.pdf ../_downloads/ODK-X-Documentation.pdf
52-
53-
odkx-style-check: odkx
54-
$(PYTHON) style-test.py -r $(COMPILE_X_SRCDIR)
55-
56-
odkx-spell-check: odkx
57-
sphinx-build -b spelling $(COMPILE_X_SRCDIR) $(ODKX_BUILDDIR)/spelling
58-
$(PYTHON) util/check-spelling-output.py $(ODKX_BUILDDIR)
59-
60-
odkx-check: odkx-style-check odkx-spell-check
61-
62-
check-all: odkx-check
63-
64-
test:
65-
pytest
25+
# Catch-all target: route all unknown targets to Sphinx using the new
26+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
27+
%: Makefile
28+
@$(SPHINXBUILD) -M $@ "$(SOURCE_DIR)" "$(BUILD_DIR)" $(SPHINXOPTS) $(O)

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ODK-X Docs
22

3-
![Platform](https://img.shields.io/badge/platform-Sphinx-blue.svg) [![License](https://img.shields.io/badge/license-CC%20BY%204.0-blue.svg)](https://creativecommons.org/licenses/by/4.0/) [![Build status](https://circleci.com/gh/odk-x/docs.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/odk-x/docs/) [![Netlify Status](https://api.netlify.com/api/v1/badges/d3788b3e-1abc-431d-a9a3-e5c71b20e053/deploy-status)](https://app.netlify.com/sites/blissful-bohr-7f32fb/deploys)
3+
![Platform](https://img.shields.io/badge/platform-Sphinx-blue.svg) [![License](https://img.shields.io/badge/license-CC%20BY%204.0-blue.svg)](https://creativecommons.org/licenses/by/4.0/) [![Build status](https://circleci.com/gh/odk-x/docs.svg?style=svg)](https://circleci.com/gh/odk-x/docs/)
44

55
This repo is the source for ODK-X documentation.
66

@@ -53,19 +53,21 @@ Clone the docs repo into a directory you want the ODK-X docs files to be located
5353
1. Visit this link https://github.com/odk-x/docs on your browser to locate the docs repo
5454
2. Find and click the "fork" button to create a personal fork of the project on Github
5555
3. Navigate to the directory you want the files to be located using the "cd" (Change Directory) command on a command-line interface on your local machine:
56+
5657
```
5758
cd <DIRECTORY>
5859
```
59-
4. Get a copy of the ODK-X docs repository on your local machine by cloning the forked repo to your local machine from your github account using the clone command below. Replace "LINK-TO-YOUR-FORKED-REPO" below with the actual link to your forked repo:
60-
60+
61+
4. Get a copy of the ODK-X docs repository on your local machine by cloning the forked repo to your local machine from your github account using the clone command below. Replace "LINK-TO-YOUR-FORKED-REPO" below with the actual link to your forked repo: You need to click on the green "Code" button to get the "LINK-TO-YOUR-FORKED-REPO"
62+
6163
```
6264
git clone <LINK-TO-YOUR-FORKED-REPO>
6365
```
6466

65-
6667
It can take a long time (>10 minutes) to clone the repo due to the large number of images in the docs. If you get an error such as `Smudge error` or `GitHub's rate limit reached`, run `git checkout -f HEAD` until you get the message `Checking out files: 100% done`.
6768

6869
After the git clone finishes, use the below command to change the directory to the ODK-X docs directory
70+
6971
```
7072
cd docs
7173
```
@@ -91,14 +93,25 @@ Take note of the full-stop `.` at the end of the build command. The `.` specifie
9193
### Building and serving the docs locally
9294

9395
Build and serve the docs locally with:
94-
* Windows: `.\run-task.bat odkx-autobuild`
95-
* Linux/macOS: `./run-task.sh odkx-autobuild`
96+
* Windows: `.\run-task.ps1`
97+
* Linux/macOS: `./run-task.sh`
9698

9799
Once your terminal shows a "Serving on http://0.0.0.0:8080" message, you can then view the docs in your browser at http://localhost:8080.
98100

99-
Changes you make in the source files will automatically be built and shown in your browser.
101+
Changes you make in the source files (located in the `./src` folder) will automatically be re-built and shown in your browser.
102+
103+
* Windows: The docker container with the docs website will occupy the terminal window and output log messages when changes are detected and rebuilds are made. Open a new terminal window/tab to be able to stop the container using the command below.
104+
* Linux/macOs: Open a new terminal to interact with the container or press `Ctrl-Z` on your keyboard to suspend the job. The job will still be running in the background and changes will automatically be rebuilt and served.
105+
106+
107+
To stop the container, type the following command
108+
109+
```
110+
docker stop odkx-docs
111+
```
112+
113+
100114

101-
Press `Ctrl-C` on your keyboard to stop the build server. It could take a while to effectively stop, and you can always close the terminal window.
102115

103116
If you get a `The name "odkx-docs" is already in use by container` error message, run the following command:
104117

@@ -219,21 +232,25 @@ It can take a long time (>10 minutes) to clone the repo due to the large number
219232

220233
Once your environment is set up, build and serve the docs locally with:
221234

235+
```bash
236+
$ make serve
237+
```
238+
222239
```bash
223240
$ make odkx
224-
$ cd odkx-build
241+
$ cd build
225242
$ python -m http.server 8000
226243
```
227244

228-
You can then view the docs in your browser at [http://localhost:8000/odkx-build/](http://localhost:8000/odkx-build/).
245+
You can then view the docs in your browser at [http://localhost:8000/build/](http://localhost:8000/build/).
229246

230247
You can also use `make` to run just a portion of the build process. See available [build tasks](#tasks) below.
231248

232249
## <a name="tasks"></a>Build tasks
233250

234-
| | Build & Serve | Build | Copy | LaTeX | Style Check | Spell Check | Check All |
235-
| ----------- | :------------: | :--------: | :-------: | :--------: | :--------------: | :--------------: | :--------: |
236-
| **Options** | odkx-autobuild | odkx-build | odkx-copy | odkx-latex | odkx-style-check | odkx-spell-check | odkx-check |
251+
| | Build & Serve | Build | Copy | LaTeX | PDF | Style Check | Spell Check | Check All |
252+
| ----------- | :------------: | :--------: | :-------: | :--------: | :--------: | :--------------: | :--------------: | :--------: |
253+
| **Options** | serve | build | copy | latex | pdf | style-check | spell-check | check-all |
237254

238255

239256
## How to contribute?

_sources/odk-logo-wide.xcf

Lines changed: 0 additions & 3 deletions
This file was deleted.

make.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ if "%SPHINXBUILD%" == "" (
66
set SPHINXBUILD=python -msphinx
77
)
88

9-
set ODKX_SRCDIR=odkx-src
10-
set COMPILE_X_SRCDIR=tmpx-src
11-
set ODKX_BUILDDIR=odkx-build
9+
set ODKX_SRCDIR=src
10+
set COMPILE_X_SRCDIR=tmp_src
11+
set ODKX_BUILDDIR=build
1212

1313
if "%1" == "clean" goto cleancmd
1414
if "%1" == "copy" goto copy

odkx-src/img/getting-started-2/example-form-folder.JPG

Lines changed: 0 additions & 3 deletions
This file was deleted.

odkx-src/img/getting-started-2/getting-started-building-chrome.JPG

Lines changed: 0 additions & 3 deletions
This file was deleted.

odkx-src/img/getting-started-2/getting-started-building-dir.JPG

Lines changed: 0 additions & 3 deletions
This file was deleted.

odkx-src/img/getting-started-2/new-question-example-form.JPG

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)