Do something like
./ltol.py filetype_plus full_path_to_original_directory full_path_to_new_directoryTypically the new_directory is temporary, and after running ltol.py you
do whatever you wish with the new files. If you are working on a Git branch,
this should be safe.
The supported filetype_plus are: tex, mbx, mbx_pp, mbx_fix,
mbx_strict_tex, mbx_strict_html, html, and more.
You may wish to comment out the print statements.
For prettyprinting PreTeXt documents,
assuming the files to be converted are in the src directory:
-
Get on a branch, of course.
-
Copy the PTX files into
src_origfor posible reuse later (this step not strictly necessary if you are a Git guru). -
Make two new directories:
src1andsrc2. -
If the file extension is
ptx, do./ltol.py ptx_pp path_to_src path_to_src1
(If the file extension is
xmlormbx, replaceptx_ppbyxml_ppormbx_pp, and similarly in the next command.)
-
If you also want to add permids, do
./ltol.py ptx_permid path_to_src1 path_to_src2
Both of those may print out a possibly annoying number of useless messages.
-
Check if the files in
src1orsrc2are okay, depending on whether you wanted to add permids. If they are, copy intosrc.
The reason I save the src_orig files is that when I need to
make a change after doing step 5), I want to start over with
the original files. I find it easier to use the files I saved in
src_orig instead of switching branches or doing some other Git thing.
To convert all the files in a directory and its subdirectories then append 'R' (for "recursive") to the command, as in
./ltol.py ptx_permid path_to_src1 path_to_src2 RWith the 'R' option the target directory should not already exist.