Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grid #30

Merged
merged 26 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1ed50d4
doc: Shorten documentation
famoser Dec 27, 2023
a66b046
maint: Update dependencies
famoser Dec 27, 2023
65d1575
refactor: Algin naming
famoser Dec 27, 2023
ab9068e
refactor: Declare abstract
famoser Dec 27, 2023
cf35294
refactor: Clean up smells
famoser Dec 27, 2023
f8fffc3
refactor: Extract paragraph allocator
famoser Dec 27, 2023
c1484fb
feat: Measure content block
famoser Dec 27, 2023
039db6f
refactor: Extract flow allocator
famoser Dec 27, 2023
116fd70
refactor: Define grid and table components
famoser Dec 27, 2023
2c5a427
feat: Allocate min-width columns
famoser Dec 27, 2023
016d122
refactor: Simplify exposed layout
famoser Dec 27, 2023
3b5005d
refactor: Force allocate to always allocate
famoser Dec 28, 2023
6934e08
fix: Fix allocation edge cases
famoser Dec 28, 2023
b9d792b
fix: Fix paragraph allocation
famoser Dec 28, 2023
ab4c62b
test: Extend test
famoser Dec 29, 2023
6d1f6cd
fix: Ensure text color is applied
famoser Dec 29, 2023
f9e4b1c
refactor: Refactor linear document test
famoser Dec 29, 2023
033645a
feat: Allocate grid minimal size
famoser Dec 29, 2023
3e7aa24
feat: Add auto columns
famoser Dec 30, 2023
266a513
feat: Support units
famoser Dec 30, 2023
abe91b0
test: Improve test assertions
famoser Dec 30, 2023
7a17f50
refactor: Improve code sharing
famoser Jan 1, 2024
e2b0d20
feat: Fully support grid
famoser Jan 1, 2024
cca1b16
fix: Do not expose measurement
famoser Jan 1, 2024
6983930
test: Check auto-sizing works
famoser Jan 1, 2024
9c1c35e
feat: Add row style
famoser Jan 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,17 @@
Like any compiler, its divided primarily into Frontend, Intermediate Representation (IR) and Backend.

Targets of the compiler:

1. Correctness
- high unit test coverage (`codecov`)
- develop by following adobe standard (PDF 1.7)
- tests with multiple viewers (Adobe Acrobat, Firefox, Edge, Evince)
- tests on muliple OS (Linux, Windows)
- cross-reference output with other generators (ITextSharp, TCPDF)
2. Maintainability
- low cyclomatic complexity (`scrutinizer`)
- no code smells (`scrutinizer`)
- classic compiler patterns (frontend, intermediate representation (IR) & backend)
- clearly defined purpose per namespace (see below for an overview)
3. Small resulting file size
- elements only included in file if referenced somewhere (ensured by Backend)
- only new element created if not possible to append to another one (ensured by IR)
4. Speed of compilation
- only provide single way to accomplish something
- no html/css parsing
- high-quality output (PDF standard 2.0 compliance, no repetition, small filesize)
- maintainable library code (sane compiler patterns, static analysis)
- maintainable user code (no HTML/CSS, single way to accomplish something)

## Frontend

The frontend currently has the following rough architecture:

- *Content* for the actual placed content; such as rectangles, image placements or text.
- *Layout* for defining the layout of the content; such as blocks, flows, grids or tables.
- *Resource* for resouces necessary to print the content, such as images or fonts.
- *Resource* for resources necessary to print the content, such as images or fonts.
- *LayoutEngine* which resolves the layout definition to something printable.

The *LayoutEngine* itself is composed out of the following steps:
Expand All @@ -40,7 +25,7 @@ The *LayoutEngine* itself is composed out of the following steps:
- *Print* prints the calculated allocation. As this is a separate step, users can decide whether to abort printing
depending on the result of the allocation.

The frontend may become the backend of more abstract document generation library, and this frontend may then unify
The frontend may become the backend of more abstract document generation library, and its frontend may then unify
a way e.g. generate both HTML and PDF documents using the same code. Experiments towards this are done in
the `document-generator` folder.

Expand Down
Loading