MCPcopy Index your code
hub / github.com/idank/explainshell / build_raw_manpage

Function build_raw_manpage

explainshell/extraction/common.py:44–61  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

42
43
44def 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
64def gz_sha256(gz_path: str) -> str:

Callers 1

_finalizeMethod · 0.90

Calls 2

resolve_mandoc_versionFunction · 0.85
gz_sha256Function · 0.85

Tested by

no test coverage detected