Skip to content

Commit 98fa31a

Browse files
committed
local (ruby) dev instructions
1 parent c7359d8 commit 98fa31a

4 files changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,23 @@ The [docs](./build.yml#L124) job:
4444

4545
- creates a `miniconda` environment from [requirements-test.yml](../../scripts/requirements-test.yml) and [docs_environment.yml](../../docs/docs_environment.yml)
4646
- `cmake` builds & installs CIL into the `miniconda` environment
47-
- builds the HTML documentation with `sphinx`
47+
+ builds the HTML documentation with `sphinx`
48+
- installs ruby dependencies from [`Gemfile`](../../docs/Gemfile)
49+
+ builds the HTML landing page with `jekyll`
4850
- uploads a `DocumentationHTML` artifact (which can be downloaded to view locally for debugging)
49-
- pushes the HTML documentation to the `gh-pages` branch
50-
+ only if pushing to `master` or tagging (skipped if pushing to a branch or a PR)
51+
+ pushes the HTML documentation to the `gh-pages` branch
52+
* only if pushing to `master` or tagging (skipped if pushing to a branch or a PR)
5153

5254
> [!TIP]
5355
> The `docs` job builds the documentation and uploads it as an artifact called `DocumentationHTML`.
5456
> It can be found by going to the "Actions" tab, and selecting the appropriate run of `.github/workflows/build.yml`, or by clicking on the tick on the action in the "All checks have passed/failed" section of a PR. When viewing the "Summary" for the run of the action, there is an "Artifact" section at the bottom of the page.
55-
> Clicking on `DocumentationHTML` allows you to download a zip folder containing the built HTML files. This allows you to preview the documentation site before it is published.
57+
> Click on `DocumentationHTML` to download a zip archive of the built HTML files.
58+
> It must be extracted into a `CIL` subfolder to properly render locally:
59+
>
60+
> ```sh
61+
> mkdir CIL
62+
> unzip -d CIL DocumentationHTML.zip
63+
> python -m http.server
64+
> ```
65+
>
66+
> Then open a browser and navigate to <http://localhost:8000/CIL/> to view the documentation.

docs/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ DEPENDENCIES
127127
jekyll-remote-theme
128128

129129
BUNDLED WITH
130-
2.5.6
130+
2.5.9

docs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ help:
1919
serve:
2020
@python -m http.server -d "$(BUILDDIR)"
2121
web-deps:
22+
@gem install bundler
2223
@bundle install
2324
web:
2425
@$(JEKYLLBUILD) -s "$(JEKYLLSRCDIR)" $(JEKYLLOPTS)

docs/source/developer_guide.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ Rendered
8888
Building documentation locally
8989
------------------------------
9090

91-
The easiest way to test changes to documentation is to build the docs locally. To do this, you will need a working ``cil`` installation.
91+
The easiest way to test documentation changes is to open a pull request and `download the rendered documentation from the CI <https://github.com/TomographicImaging/CIL/blob/master/.github/workflows/README.md>`_.
92+
93+
Alternatively, to build the docs locally, you will need a working ``cil`` installation.
9294
For development of the documentation embedded within the source code itself (e.g. docstrings), you should build ``cil`` from source.
9395

9496
The following steps can be used to create an environment that is suitable for building ``cil`` and its documentation, and to start
@@ -98,8 +100,10 @@ a HTTP server to view the documentation.
98100
#. Update conda with ``conda update -n base -c defaults conda``
99101
#. Follow the instructions `here <https://github.com/TomographicImaging/CIL/tree/master#building-cil-from-source-code>`_ to create a conda environment and build ``cil`` from source
100102
#. Go to ``docs`` folder
101-
#. Install packages from ``docs/docs_environment.yml``
102-
#. Build the documentation with ``make dirhtml``
103+
#. Install packages from ``docs_environment.yml``
104+
#. [Install Ruby version 3.2](https://www.ruby-lang.org/en/documentation/installation/#installers)
105+
#. Install the web dependencies with ``make web-deps``
106+
#. Build the documentation with ``make dirhtml web``
103107
#. Start an HTTP server with ``make serve`` to access the docs via `localhost:8000 <http://localhost:8000>`_.
104108

105109
Example:
@@ -114,7 +118,8 @@ Example:
114118
cd docs
115119
conda update -n base -c defaults conda
116120
conda env update -f docs_environment.yml # with the name field set to ENVIRONMENT_NAME
117-
make dirhtml serve
121+
make web-deps # install dependencies (requires ruby 3.2)
122+
make dirhtml web serve
118123

119124
Notebooks gallery
120125
-----------------

0 commit comments

Comments
 (0)