docs.rs failed to build nahpu_export-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
nahpu_export
nahpu_export is a Rust crate that handles formatting and generating document exports for the NAHPU specimen cataloging app.
It allows NAHPU project data (such as narratives, sites, collecting events, and specimen records) to be seamlessly exported into standard presentation formats. The crate converts serialized JSON records from the database into raw document codes, with native support for escaping structural syntax and parsing rich data into standard typologies.
Features
- Markdown (
.md) Generation: Safely escapes syntax and creates structured markdown documents. - Typst (
.typ) Generation: Generates programmatic document codes for the modern Typst typesetting engine. - PDF Compilation: Natively embeds a virtual
SimpleWorldenvironment to directly compile generated.typfiles into.pdfbyte buffers (integrating custom asset fonts without requiring host-system installation).
Architecture
This crate heavily depends on nahpu_db for mapping database records onto generated struct bindings and leverages typst libraries for heavy lifting on the PDF compilation steps.
models.rs: Serializes and bindsnahpu_dbrecords.document.rs: Core generation engine housingto_markdown,to_typst, andto_pdflogic alongside specialized escaping systems.typst_compiler.rs: Hosts theSimpleWorldimplementation required by Typst to bundle.ttffonts and run the compiler against dynamically generated strings.