Developing the Javascript for Runestone Components¶
The following is what you need to do to work on the javascript for a component testing it against a local build of a book written in PreTeXt.
Make a branch in your clone of
https://github.com/RunestoneInteractive/rs
Work on the javascript for the component in
bases/rsptx/interactives/runestone/...
Run
poetry install --with=dev
in the root folder of your clone ofrs
Start up a
poetry shell
in the root folder of your clone ofrs
From
bases/rsptx/interactives
runnpm run build
→ results inrunestone/dist
From
bases/rsptx/interactives
runpython ./scripts/dist2xml.py test
→ creates webpack_static_imports.xml and sets up for the files to be in_static/test
in the resulting local build of your PreTeXt book.Set:
<stringparam key="debug.rs.services.file" value="file:////your/home/rs/bases/interactives/runestone/dist/webpack_static_imports.xml" />
in theproject.pxt
file of the book.Run
pretext build
in the root folder of the bookmkdir -p build/html/_static/test
Copy the contents of
.../rs/bases/rsptx/interactives/runestone/dist
tobuild/html/_static/test
Run
pretext view
If you are still working with old RST based books, you can simply use the runestone build
command which automatically copies the files to the correct location.