How docling-project/docling-ts works
Major components
• Docling Core – This package contains the type definitions and utility functions needed to work with the Docling JSON output. It includes subdirectories for types (e.g., models.ts, typing.ts) plus build and configuration files (like tsconfig.json, tsup.config.ts). This represents the “core libraries” of the project.
• Docling Components – This package offers the web components for displaying the Docling JSON. Its source (in the src directory) is built using Svelte (files ending in .svelte) and includes further subdivisions (e.g., img, item, table) that logically separate the UI components. Build and linting configurations (eslint, prettier, stylelint) further support this module.
• Examples and Documentation – The examples directory (especially the Deno example) demonstrates how to integrate the libraries with a front-end application. Also, the docs directory provides example assets and usage, which can be treated as a “consumer” or demo layer of the overall system.
Establish relationships and interactions
• The Docling Core package is the foundation that defines the data model and utility operations; it is likely to be used by other parts (such as the Docling Components) for validation, parsing, or mapping of the JSON output.
• Docling Components, being the interface elements, depends on the core definitions but also encapsulates the presentation logic. They likely communicate with user interaction events and then use core utilities to ensure proper data transformation.
• The Examples (e.g., the Deno example) show how to integrate both components together into a runnable application. They include UI components, service interactions, and static assets that tie into the Docling Components.
• There may be external dependencies (like Svelte for the UI and Deno as the runtime in one of the examples), so external services and libraries should also be represented if needed.