Skip to content

Add support for multiple postprocessing requests #759

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isaac091
Copy link
Collaborator

@isaac091 isaac091 commented Jun 20, 2025

This reworks how translate configs are expected to look. Instead of specifying the postprocessing options inside of each translate request, there will be a separate 'postprocess' section at the top level which is a list of postprocessing requests that will be applied to all translate requests. A draft with no postprocessing applied is always saved. Once this is pushed, I will update the wiki with an example and explanation.

Example:

translate:
  - src_project: NASB
    books: MAT
  - src_project: NIV11R
    books: MAT
postprocess:
  - include_paragraph_markers: True  # only paragraph markers
  - include_paragraph_markers: True  # all markers
    include_style_markers: True
    include_embeds: True

It also changes the behavior of postprocess_draft.py slightly. Now, if none of the postprocessing options are toggled and the --experiment option is used, the script will apply any postprocessing requests in the experiment's translate config. Previously, if no postprocessing options were used, it would create a base draft, but that is no longer necessary because they are created by default, and I can foresee folks expecting to be able to use the translate config to configure this script. I will also update the wiki to reflect these changes.

This PR is ready to be reviewed, but to push right away. I still need to get feedback on what the names of the output files should look like. Currently, the base draft will have the same file name as drafts do now, and any outputs with marker placement options will have a suffix, e.g. 41MAT_pse.SFM, that indicates if paragraph markers, style markers, or embeds were included.

Closes #746


This change is Reviewable

@isaac091 isaac091 requested a review from benjaminking June 20, 2025 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generating multiple drafts of a book with different draft formatting settings in one experiment
1 participant