CLI 2.0 project.ptx and Runestone

76 views
Skip to first unread message

Sean Fitzpatrick

unread,
Nov 7, 2023, 11:25:19 AM11/7/23
to PreTeXt support
If I follow the example provided in 
for using the "2.0" configuration of my manifest, I should be using @output="output/web", etc. for standard output options, and @output="published/my-book" for the Runestone target.

But the CLI is already assuming that every output format goes into the output folder.

So with things configured like in the above example, my 'web' output gets put into output/output/web and Runestone goes into output/published/my-book

I think this is new behaviour as I did not notice this the first time I ran with a 2.0 version of the CLI. (But maybe "I did not notice" is the operative phrase.)

Should I be putting something like @output="./" as an attribute on the <project> tag to strip the redundant output in the path? Or is there another way to get the Runestone output in the right place?

Sean Fitzpatrick

unread,
Nov 7, 2023, 11:26:04 AM11/7/23
to PreTeXt support
Also, I typed the wrong thing: @output should be @output-dir.

Oscar Levin

unread,
Nov 7, 2023, 11:52:18 AM11/7/23
to PreTeXt support
Yes, if you supply an @output-dir on a target, that will be relative to the project's @output-dir, which is "output" if not specified.  So for runestone, you will definitely want project/@output-dir="."

I'll update the documentation soon.  Thanks for the catch.

Sean Fitzpatrick

unread,
Nov 7, 2023, 4:57:30 PM11/7/23
to PreTeXt support
Turns out this might be moot: Runestone's "rsmanage build --ptx" command fails if you are using the 2.0 syntax, since it can't find the published/my-book directory.
Brad says "all bets are off" if using a 2.0 project manifest. So I need to revert to 1.0 syntax for Runestone.

Sean Fitzpatrick

unread,
Nov 8, 2023, 12:36:12 PM11/8/23
to PreTeXt support
The current situation is not ideal: the Asymptote server hasn't been returning calls for awhile, so the server method is not an option.
But I can't do local Asymptote processing using a project manifest with 1.0 syntax.

On the other hand, Runestone cannot read the 'published' folder from a manifest that uses 2.0 syntax.

So if I want to build APEX Calculus on Runestone, I need to keep parallel project.ptx files: project_1-0.ptx and project_2-0.ptx.
Then I do:

cd ~/Runestone/books/APEX
cp project_2-0.ptx project.ptx
pretext build runestone -g
cp project_1-0.ptx project.ptx
cd ~/rs
rsmanage build --ptx APEX

Oscar Levin

unread,
Nov 8, 2023, 4:40:51 PM11/8/23
to pretext...@googlegroups.com
I do not understand why we cannot use a v2 manifest with runestone.  The work that Bryan did on that project was very much geared toward runestone.  In fact, there are systems set up specifically for runestone builds.  

Is the runestone build process inspecting the project.ptx file to find the name of the output directory?  I thought the directions for publishing on runestone requiring an author to put the output in `published` were because that's where runestone was expecting them.  

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/6a334e33-3618-4609-b327-4086edbc80a2n%40googlegroups.com.

Sean Fitzpatrick

unread,
Nov 8, 2023, 4:56:07 PM11/8/23
to pretext...@googlegroups.com
Yes. But as far as I can tell, the rsmanage build program knows how to infer the directory location from the 1.0 syntax, but not 2.0.

I think a change on the Runestone end can fix this.

But the difficulty is perhaps related in part to the CLI trying to enforce "output" as the output directory for all targets.

Steven Clontz

unread,
Nov 9, 2023, 2:10:24 PM11/9/23
to PreTeXt support

The output directory can be configured to whatever you want. Either at the project level or the target level.

Steven Clontz

unread,
Nov 9, 2023, 2:42:12 PM11/9/23
to PreTeXt support
See Table 5.2.5

Sean Fitzpatrick

unread,
Nov 10, 2023, 9:39:36 AM11/10/23
to pretext...@googlegroups.com
Right. But as noted earlier in the thread, unless you put @output-dir="." as an attribute of the project tag, all directory paths will be relative to ./output/

I guess you could enter the Runestone path as @output-dir="../published/mybook"

to ensure that it's in the right place.

Either way, as it stands, the rsmanage utility in Runestone doesn't know how to read the directory from the 2.0 syntax yet. I suppose that will be fixed in the future.

Chrissy Safranski

unread,
Nov 10, 2023, 9:59:14 AM11/10/23
to PreTeXt support
I built one (small) project with CLI 2.0 syntax, and it correctly put the Runestone output into published/ and not into output/.

I am nervous chiming in here because I really don't understand everything I did or didn't do - I was just blindly following the templates, (I still haven't even watched the video yet), but this was the relevant part of my project.ptx file:

<project ptx-version="2">
  <targets>
    <target name="web" format="html"/>
    <target name="rs" format="html" platform="runestone" />
    <target name="print" format="pdf"/>
    <target name="print-latex" format="latex"/>
  </targets>

By doing that, I didn't end up needing a separate publication file or anything.  I chalked the success up to the magic of CLI 2.0.

Chrissy

Sean Fitzpatrick

unread,
Nov 10, 2023, 10:12:21 AM11/10/23
to pretext...@googlegroups.com
Interesting. So if you don't specify any directories at all, it goes to the right place.

But my experience running my own Runestone server so far suggests that:

1. The 'rsmanage build --ptx mybook' command will look for a folder like Runestone/books/mybook 

2. In that folder it looks for a project.ptx file with a target called runestone
(If you have more than one target with @platform="runestone" it ignores anything not called runestone

3. In that target it checks to see if the output directory is published/mybook, and that the document-id is also mybook

If any of that fails, rsmanage exits with an error.

Right now if I try to use 2.0 syntax in my project file, I get an error because it can't read the published directory.

The response from Brad on discord was that "all bets are off" if I try to use the 2.0 syntax, so I think the rsmanage program hasn't caught up to it yet.

Oscar Levin

unread,
Nov 10, 2023, 5:41:15 PM11/10/23
to PreTeXt support
Brad and I talked at drop-in today and he confirmed that there is some validation of the manifest that runestone does, and that this is not updated to allow v2.  So for now at least, do not use a v2 manifest to build for runestone.

However, I just released a patch to pretext (2.3.2) that has a Sean flavored easter-egg: if you add <asy-method>local</asy-method> to a target, it will use the local method for asymptote.

Note that in version 2 manifests, you would do the same with the attribute @asy-method="local" on either the whole project or individual targets.

Oscar. 

Sean Fitzpatrick

unread,
Nov 10, 2023, 8:04:23 PM11/10/23
to pretext...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages