critical: 2 validation errors for PublicationSubset (can no longer build html using current CLI)

80 views
Skip to first unread message

Bruce Yoshiwara

unread,
Oct 5, 2023, 7:47:39 PM10/5/23
to PreTeXt support
I had been able to create web, print, and print-latex versions of Kathy’s MFG (Modeling, Functions, and Graphs) using the CLI pre-version 2.0.

Evidently the CLI now requires a directory structure we have not been using. Specifically, we did not have any directory named “source”, but in the publication file included the lines
    <source>
        <directories external="../ext" generated="../gen"/>
    </source>
The ptx source files have been in a directory named "ptx".

I edited the project.ptx file that had been created with a pretext init --refresh so that project.ptx included the line
    <target name="web" format="html" source="../ptx/mfg.xml"/>
I tried a pretext build and got the error that the file source/../ptx/mfg.xml does not exist. So I tried renaming the directory from "ptx" to "source and got a new error

PreTeXt project found in `/home/byoshiwara/mfg`.
Since no target was supplied, we will use "web".

critical: 2 validation errors for PublicationSubset
critical: external
critical:   Field required [type=missing, input_value={}, input_type=dict]
critical:     For further information visit https://errors.pydantic.dev/2.4/v/missing
critical: generated
critical:   Field required [type=missing, input_value={}, input_type=dict]
critical:     For further information visit https://errors.pydantic.dev/2.4/v/missing
------------------------
Failed to build.  Exiting...

----------------------------------------------------
While running pretext, the following errors occurred:

critical: 2 validation errors for PublicationSubset
critical: external
critical:   Field required [type=missing, input_value={}, input_type=dict]
critical:     For further information visit https://errors.pydantic.dev/2.4/v/missing
critical: generated
critical:   Field required [type=missing, input_value={}, input_type=dict]
critical:     For further information visit https://errors.pydantic.dev/2.4/v/missing 

Steven Clontz

unread,
Oct 6, 2023, 8:47:03 AM10/6/23
to PreTeXt support
The CLI does not require a `source` directory, though that's the default.

If you can share a GitHub repo and/or your directory structure and the output of pretext support, I can help troubleshoot.

Steven Clontz

unread,
Oct 6, 2023, 8:48:29 AM10/6/23
to PreTeXt support
Assuming you're talking about https://github.com/byoshiwara/mfg I'll make a pull request with a 2.0-compatible project.ptx

Steven Clontz

unread,
Oct 6, 2023, 8:59:44 AM10/6/23
to PreTeXt support
Building now to confirm, but I believe this is what you want in project.ptx

<?xml version="1.0" encoding="utf-8"?>
<!--
    This file, the project manifest, provides the overall configuration for
    your PreTeXt project. To edit the content of your document, open
    `source/main.ptx`. See
-->
<project ptx-version="2" source="ptx">
  <targets>
    <target name="web" format="html" source="mfg.xml"/>
    <target name="print" format="pdf" source="mfg.xml"/>
    <target name="print-latex" format="latex" source="mfg.xml"/>
  </targets>
</project>


Steven Clontz

unread,
Oct 6, 2023, 9:16:35 AM10/6/23
to PreTeXt support
PR here: https://github.com/byoshiwara/mfg/pull/69/files (marked as draft until I can confirm a valid build)
Reply all
Reply to author
Forward
0 new messages