Issues with offline compilation

14 views
Skip to first unread message

Jason Siefken

unread,
May 25, 2026, 5:55:57 PM (6 days ago) May 25
to prete...@googlegroups.com
I am calling the ptx.html() from pretext/pretext/lib/pretext.py, but I am getting errors because the runestone server cannot be queried. (I am running pretext inside of WASM, so network access is strictly forbidden).

Is there an argument that can be passed to prevent any querying of external servers (or at least turn them to warnings instead of errors?)

Sean Fitzpatrick

unread,
May 26, 2026, 9:48:47 AM (5 days ago) May 26
to PreTeXt development
I vaguely recall that some of the people in Kenya needed this feature a year or two ago, but I don't remember the solution. I'll see what I can find in the archives... 

On Mon, May 25, 2026, 3:55 p.m. Jason Siefken <sief...@gmail.com> wrote:
I am calling the ptx.html() from pretext/pretext/lib/pretext.py, but I am getting errors because the runestone server cannot be queried. (I am running pretext inside of WASM, so network access is strictly forbidden).

Is there an argument that can be passed to prevent any querying of external servers (or at least turn them to warnings instead of errors?)

--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/de5ef8b4-a9a3-42d5-bd41-9ab272366489%40gmail.com.

Sean Fitzpatrick

unread,
May 26, 2026, 9:52:40 AM (5 days ago) May 26
to PreTeXt development
According to what Oscar posted in this support thread, building offline has been possible since CLI 2.14.0 (released February 2025):


Maybe there's been a regression?

Rob Beezer

unread,
May 26, 2026, 10:52:27 AM (5 days ago) May 26
to prete...@googlegroups.com
Dear Jason,

I understand you are using the Python routines as a library, so maybe the CLI
won't help. Might have a work-around. But I don't know what you are up to. I
never know what you are up to. But the results are usually spectacular. (I
still need to report about jing replacements.)

If you have a _static folder already in your target outout directory, I think
we consider no-internet non-fatal and just go with what you have. You could
place _static with internet, then try a fresh build without internet? Maybe
_static can just be present, but empty?

Working from memory, but can chack the code if it seems like trading on some
fallback will help. And maybe the fallback could just be triggered by some
parameter, so library use like you desire could be supported.

What are you up to?

Rob

On 5/26/26 06:52, Sean Fitzpatrick wrote:
> According to what Oscar posted in this support thread, building offline has been
> possible since CLI 2.14.0 (released February 2025):
>
> https://groups.google.com/g/pretext-support/c/tfACSiq21L0/m/zJkSVwU3AgAJ
> <https://groups.google.com/g/pretext-support/c/tfACSiq21L0/m/zJkSVwU3AgAJ>
>
> Maybe there's been a regression?
>
> On Tue, May 26, 2026, 7:48 a.m. Sean Fitzpatrick <dsfitz...@gmail.com
> <mailto:dsfitz...@gmail.com>> wrote:
>
> I vaguely recall that some of the people in Kenya needed this feature a year
> or two ago, but I don't remember the solution. I'll see what I can find in
> the archives...
>
> On Mon, May 25, 2026, 3:55 p.m. Jason Siefken <sief...@gmail.com
> <mailto:sief...@gmail.com>> wrote:
>
> __
> I am calling the ptx.html() from pretext/pretext/lib/pretext.py, but I
> am getting errors because the runestone server cannot be queried. (I am
> running pretext inside of WASM, so network access is strictly forbidden).
>
> Is there an argument that can be passed to prevent any querying of
> external servers (or at least turn them to warnings instead of errors?)
>
> --
> You received this message because you are subscribed to the Google
> Groups "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> dev/de5ef8b4-a9a3-42d5-bd41-9ab272366489%40gmail.com <https://
> groups.google.com/d/msgid/pretext-dev/de5ef8b4-a9a3-42d5-
> bd41-9ab272366489%40gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com <mailto:pretext-
> dev+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CAH%2BNcPaE2%2BLyM%3DEteD8mfb_my-XNZfXc302qfHMtKqvbTG5mCA%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CAH%2BNcPaE2%2BLyM%3DEteD8mfb_my-
> XNZfXc302qfHMtKqvbTG5mCA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Oscar Levin

unread,
May 26, 2026, 10:59:05 AM (5 days ago) May 26
to prete...@googlegroups.com
I'm a little hazy on the details too, but yes, the core.html function from the main pretext library accepts an `ext_rs_methods` function that if present, can override the downloading of the external runestone assets.  The CLI packages the most recent version of these when it is released and they will be used if there is no internet connection.  This is done in the CLI's utils.rs_methods function.

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDA0MS5iZWV6ZXI.1779807145%40pnsh.

Jason Siefken

unread,
May 26, 2026, 1:37:23 PM (5 days ago) May 26
to prete...@googlegroups.com
I was able to successfully substitute the ext_rs_methods function with:

def runestone_services_stub(*args, **kwargs):
    """A stub for the runestone_services module, which is not compatible with the WASM build."""
    log.debug("runestone_services_stub called with args: {}, kwargs: {}".format(args, kwargs))
    return b"""<?xml version="1.0" encoding="UTF-8"?>
<all>
    <js type="list">
    </js>
    <css type="list">
    </css>
    <cdn-url type="str">https://runestone.academy/cdn/runestone/</cdn-url>
    <version type="str">8.1.1</version>
</all>
"""

I wonder if ext_rs_methods could have some different defaults? I am not sure the consequences of a non-runestone build no having any runestone info, but it seems like the default should be something like `ext_rs_methods="auto"` could do the current behavior, and `ext_rs_methods=None` could ignore runestone entirely?

I am currently working on getting DoenetML to print form. Currently there is a DoenetML -> PreTeXt conversion (you can investigate here: https://docs.doenet.org/demos/doenetml-to-pretext/index.html ). The plan is to have PreTeXt run in the browser, wrapping a doenet activity in a <worksheet>, and then using the PreTeXt print stylesheet to provide a printable version. (If that doesn't work, I will need to figure out how to run LaTeX in the browser...).
Reply all
Reply to author
Forward
0 new messages