-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add optional external runestone methods for the CLI to hook into #2348
base: master
Are you sure you want to change the base?
Conversation
Just force-pushed a fix so that dynamic_substitutions uses the same hook, and for the pretext script to use the correct signatures. |
You read my mind. I meant to comment yesterday, but it got away from me. OK, no more time today to investigate, but in the interest of moving this along. I think Brad uses some |
There are two places that the external functions are used.
So I don't think there is any way that a debug switch could be affected by this. In particular, in the presence of a network connection and Runestone being up, the result should be identical to any build. |
This now includes the fix for |
Just added a commit that changes the timeout for the requests. Instead of 10 seconds for both connecting and reading the contents, this now timeouts after 1 second for the initial connection, but still allows 10 seconds to complete the task. That way, if there is no response, we know sooner. |
Heads up; I'm going to refactor this PR to make it easier for the external method to give back the correct info. |
All done. Now a single commit with the complete changes described in the comments above. |
This slightly refactors the runestone services logic, creating a new function that does the downloading of the services xml file, and adding hooks to the
html
anddynamic_substitutions
functions. PreTeXt expects this function to either beNone
or to have keyword arguments, including aformat
that can be either "xml" or "tgz" to distinguish whether it should just do the services query (xml) or get the entire tgz file.Behavior of the pretext script should be unchanged when
ext_rs_methods
isNone
.Happy to rename variables if you have a better suggestion.