Skip to content

Commit 96b3b2f

Browse files
committed
fix documentation
also includes: - fix issue where client did not remove fallback from DOM - add option to symlink module_from_file into web modules dir
1 parent dfba8ce commit 96b3b2f

28 files changed

+2601
-112
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Run Tests
2929
run: |
3030
npm install -g npm@v7.13.0
31-
nox -s test -- --headless
31+
nox -s test --verbose -- --headless
3232
test-python-versions:
3333
runs-on: ${{ matrix.os }}
3434
strategy:
@@ -50,7 +50,7 @@ jobs:
5050
- name: Run Tests
5151
run: |
5252
npm install -g npm@v7.13.0
53-
nox -s test -- --headless --no-cov
53+
nox -s test --verbose -- --headless --no-cov
5454
test-javascript:
5555
runs-on: ubuntu-latest
5656
steps:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ pip-wheel-metadata
3535
# --- IDE ---
3636
.idea
3737
.vscode
38+
39+
# --- JS ---
40+
41+
node_modules

docs/source/_exts/build_custom_js.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import subprocess
2+
from pathlib import Path
3+
4+
from sphinx.application import Sphinx
5+
6+
7+
SOURCE_DIR = Path(__file__).parent.parent
8+
CUSTOM_JS_DIR = SOURCE_DIR / "custom_js"
9+
10+
11+
def setup(app: Sphinx) -> None:
12+
subprocess.run(["npm", "run", "build"], cwd=CUSTOM_JS_DIR, shell=True)

docs/source/_exts/interactive_widget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def run(self):
2626
<div>
2727
<div id="{container_id}" class="interactive widget-container center-content" style="" />
2828
<script async type="module">
29-
import loadWidgetExample from "{_IDOM_STATIC_HOST}/_static/js/load-widget-example.js";
30-
loadWidgetExample("{_IDOM_EXAMPLE_HOST}", "{container_id}", "{view_id}");
29+
import {{ mountWidgetExample }} from "{_IDOM_STATIC_HOST}/_static/custom.js";
30+
mountWidgetExample("{container_id}", "{view_id}", "{_IDOM_EXAMPLE_HOST}");
3131
</script>
3232
</div>
3333
""",

docs/source/_static/custom.js

Lines changed: 1955 additions & 0 deletions
Large diffs are not rendered by default.

docs/source/auto/api-reference.rst

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
API Reference
22
=============
33

4-
.. automodule:: idom.client.manage
5-
:members:
6-
7-
.. automodule:: idom.client.module
8-
:members:
9-
104
.. automodule:: idom.config
115
:members:
126

@@ -28,7 +22,7 @@ API Reference
2822
.. automodule:: idom.core.vdom
2923
:members:
3024

31-
.. automodule:: idom.dialect
25+
.. automodule:: idom.html
3226
:members:
3327

3428
.. automodule:: idom.log
@@ -55,7 +49,7 @@ API Reference
5549
.. automodule:: idom.utils
5650
:members:
5751

58-
.. automodule:: idom.html
52+
.. automodule:: idom.web.module
5953
:members:
6054

6155
.. automodule:: idom.widgets
@@ -64,9 +58,6 @@ API Reference
6458
Misc Modules
6559
------------
6660

67-
.. automodule:: idom.cli
68-
:members:
69-
7061
.. automodule:: idom.core.utils
7162
:members:
7263

@@ -75,3 +66,6 @@ Misc Modules
7566

7667
.. automodule:: idom.server.utils
7768
:members:
69+
70+
.. automodule:: idom.web.utils
71+
:members:

docs/source/auto/developer-apis.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,3 @@ Developer APIs
33

44
.. automodule:: idom._option
55
:members:
6-
7-
Misc Dev Modules
8-
----------------
9-
10-
.. automodule:: idom.client._private
11-
:members:

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"interactive_widget",
6565
"patched_html_translator",
6666
"widget_example",
67+
"build_custom_js",
6768
]
6869

6970
# Add any paths that contain templates here, relative to this directory.

docs/source/custom_js/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Custom Javascript for IDOM's Docs
2+
3+
Build the javascript with
4+
5+
```
6+
npm run build
7+
```
8+
9+
This will drop a javascript bundle into `../_static/custom.js`

0 commit comments

Comments
 (0)