Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

31_parse_manuscript.sh - Markdown version of the manuscript

Description

Downloads the PDF attachments of the Jira ticket into a scratch directory, converts the manuscript(s) with manuscript_to_markdown.py, commits the result as manuscript_parsed/ through 20_commit_code.sh (no tag), and pushes it with 32_pull_push.sh in rebase mode. The PDFs themselves are not committed here; 30_download_commit_jira_attachments.sh does that.

The pipeline runs alongside the ingest, which pushes to the same branch. manuscript_parsed/ does not overlap anything the ingest touches, so whichever pushes second just pulls the other’s commit first. Before pushing, the script restores generated/ to its committed state, because the log that 20_commit_code.sh writes there would otherwise block the rebase.

After a successful conversion, the script also commits the checksums of the manuscript(s) as generated/manuscript.sha256, the only file this pipeline pushes under generated/. 33_trigger_parse_manuscript.sh uses them to skip this pipeline when the manuscript has not changed. The script itself does not check them, so running the pipeline by hand always converts the manuscript. A failed conversion records nothing, so the next ingest tries again.

If the checksums are missing or differ, the script removes manuscript_parsed/ before converting, so that nothing from an earlier manuscript, such as its figures, remains next to the new result. The earlier result stays on the branch if the conversion fails or if no manuscript is attached.

Usage

. ./tools/resolve_jiraticket.sh
./automations/31_parse_manuscript.sh

Environment Variables

With no manuscript among the attachments, the script reports that and exits 0 without committing.

See the m-parse-manuscript pipeline, which runs it.