Project architecture

View Source

See Contributing for setup and testing for checks.

Source layout

LocationOwns
lib/*.exPublic APIs, application setup, diagnostics, file reading and limits
lib/pdf/PDF reading, encoding, object remapping and operation-specific writers
lib/html_to_pdf/HTML/CSS parsing, composition, fonts, images, layout, pagination and painting
lib/validators/Input, option, document, resource and semantic validation
priv/fonts/, priv/licenses/Bundled fonts/data and licenses
test/API, feature and integration tests; see test organization
scripts/Checks, benchmarks and generators; see scripts
dev/manual_web/Separate development application
docs/, docs/contributing/User guides and public contributor guidance

Paths follow the module after NativeElixirPdfUtilities:

ModuleFile
NativeElixirPdfUtilities.Mergelib/merge.ex
NativeElixirPdfUtilities.HtmlToPdf.Layoutlib/html_to_pdf/layout.ex

Execution paths

flowchart LR
  API[Public PDF operation] --> V[Owning validator]
  V --> Reader[Pdf.Reader]
  Reader --> Operation[Prepared operation]
  Operation --> Writer[PDF writer]
  HTML[HtmlToPdf.render] --> Parser[HtmlParser and composition]
  Parser --> Style[Style and selected fonts/resources]
  Style --> Layout[Layout]
  Layout --> Pages[Pagination]
  Pages --> PDF[PdfWriter]
OwnerRule
ValidatorsOwn validation rules; downstream code uses validated results without duplicating checks
Pdf.ReaderShared object model for PDF operations
ResourceContextPreserve resource permissions through composition, child viewports, images, fonts and caches; tests use public preparation
DiagnosticsShared recoverable failure maps
LimitsAll configurable resource ceilings

Extract components when they have a clear responsibility and contract.

Tests and fixtures

Test typeChecks
APICaller-visible behavior
FeatureIts parser, style, layout, writer or validator
IntegrationInteractions between features
Browser parityChromium comparisons using the shared helper and authored fixtures

See shared paths and fixtures for locations and resource-base rules.

Maintained files and local artifacts

ContentLocation or naming
Source, tests, fixtures, tags and artifactsFeature/scenario names, such as atomic_table_hidden_overflow.html; no batch numbers or audit labels
Generated library dataOwning module; generator and provenance under scripts/data/
Reference fixturesFeature directories under fixtures/; generators under scripts/fixtures/
Generated examplesdocs/assets/
Plans, investigations and experimentsIgnored tmp/, preferably tmp/development/
Validation logs and runtime cachesIgnored .quality/; see matrix isolation