Skip to content

Commit 1c14e25

Browse files
authored
Merge pull request #281 from s22s/docs/build-and-ci-improvements
Docs build and ci improvements
2 parents f6163a1 + 8024ffc commit 1c14e25

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ workflows:
191191
branches:
192192
only:
193193
- /feature\/.*docs.*/
194+
- /docs\/.*/
194195

195196
nightly:
196197
triggers:

docs/README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ The build constructs in `<src-root>/docs` are (due to legacy reasons) the top-le
2525
}
2626
```
2727

28+
## Building the docs
29+
30+
To build the static site locally:
31+
32+
sbt makeSite
33+
34+
The site will be at `<src-root>/docs/target/site/index.html`.
35+
36+
37+
To start an interactive server running the docs:
38+
39+
sbt previewSite
40+
41+
The sbt server log a message with an address to view the site.
42+
2843
## Content Development Process
2944

3045
Start with one of the existing files in `<src-root>/pyrasterframes/src/main/python/docs` as a template. [`local-algebra.pymd`](../pyrasterframes/src/main/python/docs/local-algebra.pymd) is a good example. If the content will have code blocks you want evaluated an results injected into the output, use the file extension `.pymd`. If the content doesn't use evaluatable code blocks, use `.md`.
@@ -44,9 +59,9 @@ To set up an environment whereby you can easily test/evaluate your code blocks d
4459
[info] Set current project to RasterFrames (in build file:<src-root>/)
4560
sbt:RasterFrames>
4661
```
47-
2. The first time you check out the code, or whenever RasterFrames code is updated, you need to build the project artifacts so they are available for Pweave.
62+
2. The first time you check out the code, or whenever RasterFrames code is updated, you need to build the project artifacts so they are available for Pweave. Some docs also refer to test resources, so the easiest way to do it is to run the unit tests.
4863
```
49-
sbt:RasterFrames> pyrasterframes/package
64+
sbt:RasterFrames> pyrasterframes/test
5065
[info] Compiling 4 Scala sources to <src-root>/core/target/scala-2.11/classes ...
5166
... lots of noise ...
5267
[info] PyRasterFrames assembly written to '<src-root>/pyrasterframes/target/python/deps/jars/pyrasterframes-assembly-0.8.0-SNAPSHOT.jar'
@@ -66,7 +81,7 @@ To set up an environment whereby you can easily test/evaluate your code blocks d
6681
sbt:RasterFrames> pyrasterframes/doc
6782
```
6883
There's a command alias for this last step: `pyDocs`.
69-
4. To evaluate a single `.pymd` file, you pass the `-s` option and the filename relative to the `python` directory:
84+
4. To evaluate a single `.pymd` file, you pass the `-s` option and the filename relative to the `pyraterframes/src/main/python` directory. You can also specify the output [format](http://mpastell.com/pweave/formats.html) with the `-f` argument.
7085
```
7186
sbt:RasterFrames> pyrasterframes/pySetup pweave -s docs/getting-started.pymd
7287
[info] Synchronizing 44 files to '<src-root>/pyrasterframes/target/python'
@@ -82,7 +97,7 @@ To set up an environment whereby you can easily test/evaluate your code blocks d
8297
Weaved docs/getting-started.pymd to docs/getting-started.md
8398
```
8499
5. The _output_ Markdown files are written to `<src-root>/pyrasterframes/target/python/docs`. _Note_: don't edit any files in the `pyrasterframes/target` directory... they will get overwritten each time `sbt` runs a command.
85-
6. During content development it's sometimes helpful to see the output rendered as basic HTML. To do this, add the `-d html` option to the pweave command:
100+
6. During content development it's sometimes helpful to see the output rendered as basic HTML. To do this, add the `-f html` option to the pweave command:
86101
```
87102
sbt:RasterFrames> pyrasterframes/pySetup pweave -f html -s docs/getting-started.pymd
88103
[info] Synchronizing 54 files to '<src-roog>/pyrasterframes/target/python'
@@ -103,8 +118,11 @@ To set up an environment whereby you can easily test/evaluate your code blocks d
103118
104119
## Notebooks
105120
106-
The `rf-notebooks` sub-project creates a Docker image with Jupyter Notebooks pre-configured with RasterFrames. Any `.pymd` file under `.../python/docs/` is converted to an evaluated Jupyter Notebook and included as a part of the build (an additional bonus of the Pweave tool).
121+
The `rf-notebooks` sub-project creates a Docker image with Jupyter Notebooks pre-configured with RasterFrames. Any `.pymd` file under `.../python/docs/` is converted to an evaluated Jupyter Notebook and included as a part of the build.
107122
108123
## Submission Process
109124
110-
Submit new and updated documentation as a PR against locationtech/rasterframes. Make sure you've signed the Eclipse Foundation ECA and you ["Signed-off-by:"](https://stackoverflow.com/questions/1962094/what-is-the-sign-off-feature-in-git-for) each commit in the PR. The "Signed-off-by" address needs to be the exact same one as registered with the [Eclipse Foundation](https://wiki.eclipse.org/Development_Resources/Contributing_via_Git).
125+
Submit new and updated documentation as a PR against locationtech/rasterframes. Make sure you've signed the Eclipse Foundation ECA and you ["Signed-off-by:"](https://stackoverflow.com/questions/1962094/what-is-the-sign-off-feature-in-git-for) each commit in the PR. The "Signed-off-by" email address needs to be the exact same one as registered with the [Eclipse Foundation](https://wiki.eclipse.org/Development_Resources/Contributing_via_Git).
126+
127+
If you are using circle CI, the circle configuration is set up to build the docs with `sbt makeSite` for branch names matching `feature/.*docs.*` or `docs/.*`
128+

pyrasterframes/src/main/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def run(self):
8787
import pweave
8888
bad_words = ["Error"]
8989

90-
for file in self.files:
90+
for file in sorted(self.files, reverse=True):
9191
name = path.splitext(path.basename(file))[0]
9292
dest = self.dest_file(file)
9393

0 commit comments

Comments
 (0)