diff --git a/pretext/cli.py b/pretext/cli.py index 7d5b1098..14e31b6c 100644 --- a/pretext/cli.py +++ b/pretext/cli.py @@ -624,12 +624,6 @@ def build( default=False, help="Generate all possible asset formats rather than just the defaults for the specified target.", ) -@click.option( - "--non-pymupdf", - is_flag=True, - default=False, - help="Used to revert to non-pymupdf (legacy) method for generating svg and png.", -) @click.pass_context @nice_errors def generate( @@ -639,7 +633,6 @@ def generate( all_formats: bool, only_changed: bool, xmlid: Optional[str], - non_pymupdf: bool, ) -> None: """ Generate specified (or all) assets for the default target (first target in "project.ptx"). Asset "generation" is typically @@ -676,7 +669,6 @@ def generate( all_formats=all_formats, only_changed=only_changed, # Unless requested, generate all assets, so don't check the cache. xmlid=xmlid, - non_pymupdf=non_pymupdf, ) log.info("Finished generating assets.\n") except ValidationError as e: diff --git a/pretext/project/__init__.py b/pretext/project/__init__.py index 55877980..28a6f475 100644 --- a/pretext/project/__init__.py +++ b/pretext/project/__init__.py @@ -687,6 +687,7 @@ def build( extra_xsl=custom_xsl, out_file=out_file, dest_dir=self.output_dir_abspath().as_posix(), + # rs_query_methods=None, ) try: codechat.map_path_to_xml_id( @@ -808,7 +809,6 @@ def generate_assets( all_formats: bool = False, only_changed: bool = True, xmlid: t.Optional[str] = None, - non_pymupdf: bool = False, ) -> None: """ Generates assets for the current target. Options: @@ -816,7 +816,6 @@ def generate_assets( - all_formats: boolean to decide whether the output format of the assets will be just those that the target format uses (default/False) or all possible output formats for that asset (True). - only_changed: boolean. When True (default), function will only generate assets that have changed since last generation. When False, all assets will be built (hash table will be ignored). - xmlid: optional string to specify the root of the subtree of the xml document to generate assets within. - - non_pymupdf: temporary boolean to revert to legacy alternative image generation without pymupdf (and use old external programs). """ # Two "ensure" functions call generate to get just a single asset. Every generation step other than webwork must have webwork generated, so unless we are "ensuring" webwork, we will need to call ensure webwork. Note if this function was called with just webwork, then we would move down and actually build webwork. if requested_asset_types != ["webwork"]: @@ -1008,7 +1007,7 @@ def generate_assets( dest_dir=self.generated_dir_abspath() / "latex-image", outformat=outformat, method=self.latex_engine, - pyMuPDF=not (non_pymupdf), + ext_converter=None, ) successful_assets.append(("latex-image", id)) except Exception as e: @@ -1026,6 +1025,7 @@ def generate_assets( dest_dir=self.generated_dir_abspath() / "asymptote", outformat=outformat, method=self.asy_method, + ext_converter=None, ) successful_assets.append(("asymptote", id)) except Exception as e: @@ -1042,6 +1042,7 @@ def generate_assets( xmlid_root=id, dest_dir=self.generated_dir_abspath() / "sageplot", outformat=outformat, + ext_converter=None, ) successful_assets.append(("sageplot", id)) except Exception as e: diff --git a/pretext/project/xml.py b/pretext/project/xml.py index 2026d0da..7c3ac505 100644 --- a/pretext/project/xml.py +++ b/pretext/project/xml.py @@ -13,13 +13,13 @@ class Executables(pxml.BaseXmlModel, tag="executables"): latex: str = pxml.attr(default="latex") pdflatex: str = pxml.attr(default="pdflatex") xelatex: str = pxml.attr(default="xelatex") - pdfsvg: str = pxml.attr(default="pdf2svg") + pdfsvg: t.Optional[str] = pxml.attr(default="pdf2svg") # If not specified, use a local executable if it exists; if it doesn't exist, choose `None`, which allows the generation logic to use the server instead. asy: t.Optional[str] = pxml.attr(default=shutil.which("asy")) # The same applies to Sage. sage: t.Optional[str] = pxml.attr(default=shutil.which("sage")) mermaid: str = pxml.attr(default="mmdc") - pdfpng: str = pxml.attr(default="convert") + pdfpng: t.Optional[str] = pxml.attr(default="convert") pdfeps: str = pxml.attr(default="pdftops") node: str = pxml.attr(default="node") liblouis: str = pxml.attr(default="file2brl")