One place to build RawManpage with SHA256. ``mandoc_path`` identifies the mandoc binary used for the extraction and is resolved into ``generator_version``.
(
mandoc_path: str,
source_text: str,
generator: str,
gz_path: str,
)
| 42 | |
| 43 | |
| 44 | def build_raw_manpage( |
| 45 | mandoc_path: str, |
| 46 | source_text: str, |
| 47 | generator: str, |
| 48 | gz_path: str, |
| 49 | ) -> models.RawManpage: |
| 50 | """One place to build RawManpage with SHA256. |
| 51 | |
| 52 | ``mandoc_path`` identifies the mandoc binary used for the extraction |
| 53 | and is resolved into ``generator_version``. |
| 54 | """ |
| 55 | return models.RawManpage( |
| 56 | source_text=source_text, |
| 57 | generated_at=datetime.datetime.now(datetime.timezone.utc), |
| 58 | generator=generator, |
| 59 | generator_version=resolve_mandoc_version(mandoc_path), |
| 60 | source_gz_sha256=gz_sha256(gz_path), |
| 61 | ) |
| 62 | |
| 63 | |
| 64 | def gz_sha256(gz_path: str) -> str: |
no test coverage detected