Skip to content

Commit 496bcd1

Browse files
committed
fix up docker image
1 parent cae8ea7 commit 496bcd1

File tree

6 files changed

+37
-8
lines changed

6 files changed

+37
-8
lines changed

docs/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Add LICENSE /app/
3333

3434
# Build the Docs
3535
# --------------
36-
ADD run_docs.py ./
3736
ADD docs/__init__.py ./docs/
3837
ADD docs/app.py ./docs/
3938
ADD docs/examples.py ./docs/

docs/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# IDOM's Documentation
2+
3+
We provide two main ways to run the docs. Both use `nox` which has a `noxfile.py` at the
4+
root of the repository. Running the docs with `nox -s docs` will start up an iteractive
5+
session which will rebuild the docs any time a file is modified. Using `nox -s
6+
docs_in_docker` on the other hand, will build a docker image and run the docs from
7+
there. The latter command mimics how the docs will behave in production. As such, if any
8+
changes to the core of the documentation are made (i.e. to non-`*.rst` files), then you
9+
should run a manual test of the documentation using the `docs_in_docker` session.
10+
11+
If you with to build and run the docs by hand you need to perform two commands, each
12+
being run from the root of the repository:
13+
14+
- `sphinx-build -b html docs/source docs/build`
15+
- `python scripts/run_docs.py`
16+
17+
The first command constructs the static HTML and any Javascript. The latter actually
18+
runs the web server that serves the content.

docs/source/_static/custom.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ function mountLayoutWithReconnectingWebSocket(
19111911
const updateHookPromise = new LazyPromise();
19121912

19131913
socket.onopen = (event) => {
1914-
console.log(`Connected.`);
1914+
console.info(`IDOM WebSocket connected.`);
19151915

19161916
if (mountState.everMounted) {
19171917
reactDom.unmountComponentAtNode(element);
@@ -1932,7 +1932,7 @@ function mountLayoutWithReconnectingWebSocket(
19321932

19331933
socket.onclose = (event) => {
19341934
if (!maxReconnectTimeout) {
1935-
console.log(`Connection lost.`);
1935+
console.info(`IDOM WebSocket connection lost.`);
19361936
return;
19371937
}
19381938

@@ -1941,7 +1941,7 @@ function mountLayoutWithReconnectingWebSocket(
19411941
mountState
19421942
);
19431943

1944-
console.log(`Connection lost, reconnecting in ${reconnectTimeout} seconds`);
1944+
console.info(`IDOM WebSocket connection lost. Reconnecting in ${reconnectTimeout} seconds...`);
19451945

19461946
setTimeout(function () {
19471947
mountState.reconnectAttempts++;

noxfile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def docs(session: Session) -> None:
8585

8686
@nox.session
8787
def docs_in_docker(session: Session) -> None:
88+
"""Build a docker image for the documentation and run it to mimic production"""
8889
session.run(
8990
"docker",
9091
"build",
@@ -120,7 +121,7 @@ def test(session: Session) -> None:
120121

121122
@nox.session
122123
def test_short(session: Session) -> None:
123-
"""Run the complete test suite"""
124+
"""Run a shortened version of the test suite"""
124125
session.notify("test_suite", posargs=session.posargs)
125126
session.notify("test_docs")
126127

@@ -192,6 +193,7 @@ def test_docs(session: Session) -> None:
192193

193194
@nox.session
194195
def tag(session: Session):
196+
"""Create a new git tag"""
195197
try:
196198
session.run(
197199
"git",
@@ -226,6 +228,7 @@ def tag(session: Session):
226228

227229
@nox.session
228230
def update_version(session: Session) -> None:
231+
"""Update the version of all Python and Javascript packages in this repo"""
229232
if len(session.posargs) > 1:
230233
session.error("To many arguments")
231234

scripts/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Scripts
22

3-
All scripts should be run from the repository root
4-
(typically using [`nox`](https://nox.thea.codes/en/stable/)).
3+
All scripts should be run from the repository root (typically using
4+
[`nox`](https://nox.thea.codes/en/stable/)). Use `nox --list` to see the list of
5+
available scripts.

scripts/run_docs.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
from docs import run
1+
import os
2+
import sys
3+
4+
5+
# all scripts should be run from the repository root so we need to insert cwd to path
6+
# to import docs
7+
sys.path.insert(0, os.getcwd())
28

39

410
if __name__ == "__main__":
11+
from docs import run
12+
513
run()

0 commit comments

Comments
 (0)