postsvg 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +105 -0
- data/CLAUDE.md +173 -0
- data/Gemfile +2 -3
- data/README.adoc +456 -179
- data/Rakefile +100 -0
- data/TODO.roadmap/00-architecture.md +139 -0
- data/TODO.roadmap/01-autoload-migration.md +39 -0
- data/TODO.roadmap/02-isolate-dormant-code.md +51 -0
- data/TODO.roadmap/03-domain-model.md +66 -0
- data/TODO.roadmap/04-lexer.md +40 -0
- data/TODO.roadmap/05-parser.md +43 -0
- data/TODO.roadmap/06-graphics-state.md +45 -0
- data/TODO.roadmap/07-matrix-and-color.md +37 -0
- data/TODO.roadmap/08-svg-builder.md +51 -0
- data/TODO.roadmap/09-renderer.md +52 -0
- data/TODO.roadmap/10-visitor.md +58 -0
- data/TODO.roadmap/11-operator-coverage.md +103 -0
- data/TODO.roadmap/12-svg-domain.md +62 -0
- data/TODO.roadmap/13-translation-handlers.md +69 -0
- data/TODO.roadmap/14-ps-serializer.md +49 -0
- data/TODO.roadmap/15-cli-and-public-api.md +47 -0
- data/TODO.roadmap/16-specs.md +84 -0
- data/TODO.roadmap/17-docs-sync.md +47 -0
- data/TODO.roadmap/18-performance-and-determinism.md +47 -0
- data/TODO.roadmap/19-error-model.md +45 -0
- data/TODO.roadmap/20-font-and-text.md +46 -0
- data/TODO.roadmap/21-images.md +45 -0
- data/TODO.roadmap/22-forms-and-resources.md +25 -0
- data/TODO.roadmap/23-level2-level3.md +52 -0
- data/TODO.roadmap/24-ci-and-release.md +42 -0
- data/TODO.roadmap/README.md +77 -0
- data/docs/.gitignore +29 -0
- data/docs/CHANGELOG.md +114 -0
- data/docs/COMPLETE_DOCUMENTATION_STATUS.md +376 -0
- data/docs/DEPLOYMENT.md +456 -0
- data/docs/DEPLOYMENT_INSTRUCTIONS.md +229 -0
- data/docs/DOCUMENTATION_PLAN.md +425 -0
- data/docs/FINAL_SUMMARY.md +657 -0
- data/docs/Gemfile +15 -0
- data/docs/README.md +327 -0
- data/docs/_config.yml +99 -0
- data/docs/advanced-topics.adoc +370 -0
- data/docs/api-reference/colors.adoc +705 -0
- data/docs/api-reference/converter.adoc +699 -0
- data/docs/api-reference/execution-context.adoc +1210 -0
- data/docs/api-reference/graphics-state.adoc +1070 -0
- data/docs/api-reference/interpreter.adoc +810 -0
- data/docs/api-reference/matrix.adoc +1179 -0
- data/docs/api-reference/path-builder.adoc +1284 -0
- data/docs/api-reference/postsvg-module.adoc +388 -0
- data/docs/api-reference/svg-generator.adoc +891 -0
- data/docs/api-reference/tokenizer.adoc +925 -0
- data/docs/api-reference.adoc +221 -0
- data/docs/architecture/command-registry.adoc +1191 -0
- data/docs/architecture/conversion-pipeline.adoc +746 -0
- data/docs/architecture/design-decisions.adoc +999 -0
- data/docs/architecture/generator-stage.adoc +1115 -0
- data/docs/architecture/graphics-state-model.adoc +1089 -0
- data/docs/architecture/interpreter-stage.adoc +1125 -0
- data/docs/architecture/parser-stage.adoc +1051 -0
- data/docs/architecture.adoc +354 -0
- data/docs/cli-reference/batch-command.adoc +616 -0
- data/docs/cli-reference/check-command.adoc +677 -0
- data/docs/cli-reference/cli-options.adoc +802 -0
- data/docs/cli-reference/convert-command.adoc +462 -0
- data/docs/cli-reference/version-command.adoc +296 -0
- data/docs/cli-reference.adoc +317 -0
- data/docs/concepts/conversion-pipeline.adoc +903 -0
- data/docs/concepts/coordinate-systems.adoc +836 -0
- data/docs/concepts/graphics-state.adoc +861 -0
- data/docs/concepts/path-operations.adoc +1076 -0
- data/docs/concepts/postscript-language.adoc +859 -0
- data/docs/concepts/svg-generation.adoc +937 -0
- data/docs/concepts.adoc +198 -0
- data/docs/contributing.adoc +443 -0
- data/docs/development.adoc +420 -0
- data/docs/faq.adoc +493 -0
- data/docs/getting-started/basic-usage.adoc +538 -0
- data/docs/getting-started/common-workflows.adoc +577 -0
- data/docs/getting-started/first-conversion.adoc +492 -0
- data/docs/getting-started/installation.adoc +534 -0
- data/docs/getting-started.adoc +94 -0
- data/docs/index.adoc +248 -0
- data/docs/optimization.adoc +196 -0
- data/docs/ps2svg_compatibility.adoc +149 -0
- data/docs/quick-reference.adoc +453 -0
- data/docs/sitemap.adoc +337 -0
- data/docs/troubleshooting.adoc +486 -0
- data/docs/validation.adoc +772 -0
- data/exe/postsvg +1 -0
- data/lib/postsvg/cli.rb +104 -57
- data/lib/postsvg/color.rb +132 -0
- data/lib/postsvg/errors.rb +68 -3
- data/lib/postsvg/format_number.rb +22 -0
- data/lib/postsvg/graphics_context.rb +80 -0
- data/lib/postsvg/graphics_stack.rb +43 -0
- data/lib/postsvg/model/literals/array.rb +41 -0
- data/lib/postsvg/model/literals/dictionary.rb +34 -0
- data/lib/postsvg/model/literals/hex.rb +37 -0
- data/lib/postsvg/model/literals/name.rb +40 -0
- data/lib/postsvg/model/literals/number.rb +36 -0
- data/lib/postsvg/model/literals/procedure.rb +41 -0
- data/lib/postsvg/model/literals/string.rb +30 -0
- data/lib/postsvg/model/literals.rb +19 -0
- data/lib/postsvg/model/operator.rb +58 -0
- data/lib/postsvg/model/operators/arithmetic.rb +264 -0
- data/lib/postsvg/model/operators/boolean.rb +182 -0
- data/lib/postsvg/model/operators/color.rb +74 -0
- data/lib/postsvg/model/operators/container.rb +186 -0
- data/lib/postsvg/model/operators/control_flow.rb +119 -0
- data/lib/postsvg/model/operators/device.rb +21 -0
- data/lib/postsvg/model/operators/dictionary.rb +118 -0
- data/lib/postsvg/model/operators/font.rb +121 -0
- data/lib/postsvg/model/operators/graphics_state.rb +84 -0
- data/lib/postsvg/model/operators/painting.rb +29 -0
- data/lib/postsvg/model/operators/path.rb +169 -0
- data/lib/postsvg/model/operators/stack.rb +72 -0
- data/lib/postsvg/model/operators/transformations.rb +103 -0
- data/lib/postsvg/model/operators.rb +89 -0
- data/lib/postsvg/model/program.rb +68 -0
- data/lib/postsvg/model/token.rb +43 -0
- data/lib/postsvg/model.rb +17 -0
- data/lib/postsvg/options.rb +29 -0
- data/lib/postsvg/renderer.rb +85 -0
- data/lib/postsvg/serializer.rb +325 -0
- data/lib/postsvg/source/ast_builder.rb +308 -0
- data/lib/postsvg/source/lexer.rb +322 -0
- data/lib/postsvg/source/operand_stack.rb +55 -0
- data/lib/postsvg/source.rb +21 -0
- data/lib/postsvg/svg/attribute_parser.rb +45 -0
- data/lib/postsvg/svg/clip_path_registry.rb +44 -0
- data/lib/postsvg/svg/document.rb +22 -0
- data/lib/postsvg/svg/element.rb +84 -0
- data/lib/postsvg/svg/elements/circle.rb +36 -0
- data/lib/postsvg/svg/elements/clip_path.rb +26 -0
- data/lib/postsvg/svg/elements/defs.rb +24 -0
- data/lib/postsvg/svg/elements/ellipse.rb +38 -0
- data/lib/postsvg/svg/elements/group.rb +37 -0
- data/lib/postsvg/svg/elements/image.rb +35 -0
- data/lib/postsvg/svg/elements/line.rb +36 -0
- data/lib/postsvg/svg/elements/path.rb +32 -0
- data/lib/postsvg/svg/elements/polygon.rb +12 -0
- data/lib/postsvg/svg/elements/polyline.rb +32 -0
- data/lib/postsvg/svg/elements/rect.rb +44 -0
- data/lib/postsvg/svg/elements/svg.rb +39 -0
- data/lib/postsvg/svg/elements/text.rb +42 -0
- data/lib/postsvg/svg/elements.rb +31 -0
- data/lib/postsvg/svg/paint.rb +34 -0
- data/lib/postsvg/svg/parser.rb +39 -0
- data/lib/postsvg/svg/path_data/command.rb +27 -0
- data/lib/postsvg/svg/path_data/parser.rb +82 -0
- data/lib/postsvg/svg/path_data.rb +17 -0
- data/lib/postsvg/svg/stroke.rb +31 -0
- data/lib/postsvg/svg/transform_list.rb +59 -0
- data/lib/postsvg/svg.rb +22 -0
- data/lib/postsvg/svg_builder.rb +249 -0
- data/lib/postsvg/translation/arc_converter.rb +86 -0
- data/lib/postsvg/translation/bounding_box.rb +59 -0
- data/lib/postsvg/translation/context.rb +34 -0
- data/lib/postsvg/translation/handler_registry.rb +38 -0
- data/lib/postsvg/translation/handlers/circle_handler.rb +28 -0
- data/lib/postsvg/translation/handlers/clip_path_handler.rb +13 -0
- data/lib/postsvg/translation/handlers/defs_handler.rb +15 -0
- data/lib/postsvg/translation/handlers/ellipse_handler.rb +31 -0
- data/lib/postsvg/translation/handlers/group_handler.rb +21 -0
- data/lib/postsvg/translation/handlers/image_handler.rb +20 -0
- data/lib/postsvg/translation/handlers/line_handler.rb +23 -0
- data/lib/postsvg/translation/handlers/open_handler.rb +18 -0
- data/lib/postsvg/translation/handlers/path_handler.rb +356 -0
- data/lib/postsvg/translation/handlers/polygon_handler.rb +33 -0
- data/lib/postsvg/translation/handlers/polyline_handler.rb +31 -0
- data/lib/postsvg/translation/handlers/rect_handler.rb +27 -0
- data/lib/postsvg/translation/handlers/shared.rb +110 -0
- data/lib/postsvg/translation/handlers/svg_handler.rb +25 -0
- data/lib/postsvg/translation/handlers/text_handler.rb +56 -0
- data/lib/postsvg/translation/handlers.rb +25 -0
- data/lib/postsvg/translation/ps_renderer.rb +105 -0
- data/lib/postsvg/translation/record_emitter.rb +35 -0
- data/lib/postsvg/translation.rb +17 -0
- data/lib/postsvg/version.rb +1 -1
- data/lib/postsvg/visitors/ps_visitor/arithmetic.rb +125 -0
- data/lib/postsvg/visitors/ps_visitor/boolean.rb +105 -0
- data/lib/postsvg/visitors/ps_visitor/color.rb +53 -0
- data/lib/postsvg/visitors/ps_visitor/common.rb +66 -0
- data/lib/postsvg/visitors/ps_visitor/container.rb +164 -0
- data/lib/postsvg/visitors/ps_visitor/control_flow.rb +110 -0
- data/lib/postsvg/visitors/ps_visitor/device.rb +20 -0
- data/lib/postsvg/visitors/ps_visitor/dictionary.rb +89 -0
- data/lib/postsvg/visitors/ps_visitor/font.rb +93 -0
- data/lib/postsvg/visitors/ps_visitor/graphics_state.rb +55 -0
- data/lib/postsvg/visitors/ps_visitor/painting.rb +90 -0
- data/lib/postsvg/visitors/ps_visitor/path.rb +112 -0
- data/lib/postsvg/visitors/ps_visitor/stack.rb +47 -0
- data/lib/postsvg/visitors/ps_visitor/transformations.rb +101 -0
- data/lib/postsvg/visitors/ps_visitor.rb +208 -0
- data/lib/postsvg/visitors.rb +9 -0
- data/lib/postsvg.rb +93 -59
- data/lychee.toml +86 -0
- metadata +216 -11
- data/postsvg.gemspec +0 -38
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# 21 — Images
|
|
2
|
+
|
|
3
|
+
## Status: [ ]
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
`image`, `imagemask`, `colorimage` are common in real EPS files (logos,
|
|
8
|
+
scanned graphics, illustrations). The legacy `Interpreter` emits a
|
|
9
|
+
hardcoded placeholder. The new pipeline must do real work, including
|
|
10
|
+
round-trip with SVG `<image>`.
|
|
11
|
+
|
|
12
|
+
## Scope
|
|
13
|
+
|
|
14
|
+
### P2a — PS → SVG (decode embedded images)
|
|
15
|
+
|
|
16
|
+
- [ ] Parse `image` operator: width, height, bits/component,
|
|
17
|
+
matrix, datasource.
|
|
18
|
+
- [ ] Decode datasource: hex string `<...>`, binary string `(...)`,
|
|
19
|
+
or proc (rare; emit placeholder).
|
|
20
|
+
- [ ] Encode as PNG via `libpng` (same dep `emfsvg` uses) or as inline
|
|
21
|
+
base64 in an SVG `<image href="data:image/png;base64,...">`.
|
|
22
|
+
- [ ] `imagemask`: 1-bit mask rendered as an SVG `<image>` with
|
|
23
|
+
opacity or as a clipped fill.
|
|
24
|
+
- [ ] `colorimage`: multi-channel variant.
|
|
25
|
+
|
|
26
|
+
### P2b — SVG → PS (embed images)
|
|
27
|
+
|
|
28
|
+
- [ ] Resolve `<image href="...">`:
|
|
29
|
+
- `data:` URI → decode base64.
|
|
30
|
+
- file path → read.
|
|
31
|
+
- http(s) → fetch (optional; require explicit opt-in).
|
|
32
|
+
- [ ] Decode PNG/JPEG to raw raster.
|
|
33
|
+
- [ ] Re-encode as PS hex string for `image` operator.
|
|
34
|
+
|
|
35
|
+
### P3 — Advanced
|
|
36
|
+
|
|
37
|
+
- [ ] Subsampling, interpolation, transfer functions.
|
|
38
|
+
- [ ] `setcolorspace` with ICCBased profiles.
|
|
39
|
+
- [ ] Level 3 image dictionaries (`/ImageType 1`, `/ImageType 4`
|
|
40
|
+
masked images).
|
|
41
|
+
|
|
42
|
+
## Reference
|
|
43
|
+
|
|
44
|
+
- PLRM Chapter 7 (Imaging).
|
|
45
|
+
- `../postscript-guide/docs/usage/advanced/images.adoc`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 22 — Forms and Resources
|
|
2
|
+
|
|
3
|
+
## Status: [ ]
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
PS Forms (Level 2) are cached graphics objects — the PS analogue of
|
|
8
|
+
SVG `<defs>` + `<use>`. The SVG→PS direction can naturally emit forms
|
|
9
|
+
for repeated subtrees, but this is P3 work.
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
|
|
13
|
+
- [ ] `Form resource`: define a form body, register it in a resource
|
|
14
|
+
dictionary, invoke via `execform`.
|
|
15
|
+
- [ ] Map SVG `<defs>` + `<use>` to PS Forms.
|
|
16
|
+
- [ ] `BeginData` / `EndData` DSC blocks for embedded binary form
|
|
17
|
+
bodies.
|
|
18
|
+
- [ ] Form caching: if a form is invoked N times in a program, emit
|
|
19
|
+
the body once and `execform` N times. (Optimization; current
|
|
20
|
+
P0 SVG→PS just inlines.)
|
|
21
|
+
|
|
22
|
+
## Reference
|
|
23
|
+
|
|
24
|
+
- PLRM Chapter 8 (Forms and Resources).
|
|
25
|
+
- `../postscript-guide/docs/usage/advanced/forms.adoc`.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# 23 — PS Level 2 / 3 Coverage
|
|
2
|
+
|
|
3
|
+
## Status: [ ]
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
Real-world EPS files from Illustrator, Inkscape, Ghostscript, and
|
|
8
|
+
Adobe tools use Level 2 / 3 features extensively. The 0.2.0 release
|
|
9
|
+
covers only the common Level 1 subset. This file tracks the rest.
|
|
10
|
+
|
|
11
|
+
## Level 2
|
|
12
|
+
|
|
13
|
+
- [ ] **Color spaces**: `setcolorspace`, `setcolor`, `currentcolorspace`.
|
|
14
|
+
- DeviceGray, DeviceRGB, DeviceCMYK, DeviceN.
|
|
15
|
+
- CIEBasedABC, CIEBasedA.
|
|
16
|
+
- [ ] **Patterns**: `makepattern`, `setpattern`. Tiling patterns
|
|
17
|
+
(Type 1) for now; shading patterns under Level 3.
|
|
18
|
+
- [ ] **Halftone**: `setscreen`, `setcolorscreen`, `sethalftone`.
|
|
19
|
+
- [ ] **Images**: `image` with image dictionary (Level 2 form),
|
|
20
|
+
`imagemask` dictionary form.
|
|
21
|
+
- [ ] **Filters**: ASCIIHexDecode, ASCII85Decode, LZWDecode,
|
|
22
|
+
FlateDecode, RunLengthDecode, SubFileDecode, CCITTFaxDecode,
|
|
23
|
+
DCTDecode.
|
|
24
|
+
- [ ] **Binary object format / binary tokens**.
|
|
25
|
+
- [ ] **Composite fonts** (Type 0): FMapType, Encoding, WMode.
|
|
26
|
+
- [ ] **Resource management**: `defineresource`, `findresource`,
|
|
27
|
+
`resourcestatus`, `enumerate`.
|
|
28
|
+
- [ ] **Page device**: `setpagedevice`, `currentpagedevice` (paper
|
|
29
|
+
size, duplex, etc.).
|
|
30
|
+
|
|
31
|
+
## Level 3
|
|
32
|
+
|
|
33
|
+
- [ ] **Shading** (smooth gradients): types 1-7.
|
|
34
|
+
- `shfill` with ShadingType 1 (Function-based)
|
|
35
|
+
- Type 2 (Axial), Type 3 (Radial) — partial support exists; expand.
|
|
36
|
+
- Type 4 (Free-form Gouraud triangle), Type 5 (Lattice-form Gouraud),
|
|
37
|
+
Type 6 (Coons patch mesh), Type 7 (Tensor-product patch mesh).
|
|
38
|
+
- [ ] **Clip paths**: More than one clip path at once; `setclipstrokeparams`.
|
|
39
|
+
- [ ] **Image types**: `/ImageType 4` (masked), `/ImageType 3`
|
|
40
|
+
(interleaved).
|
|
41
|
+
- [ ] **Transparent imaging**: PDF-in-PS extensions, opacity,
|
|
42
|
+
blending modes.
|
|
43
|
+
- [ ] **CIDFont** improvements: vertical metrics, Unicode CMaps.
|
|
44
|
+
- [ ] **Chromaticity** (`setchromaticity`).
|
|
45
|
+
- [ ] **Paged device** additions: tray selection, install/exit
|
|
46
|
+
procedures.
|
|
47
|
+
|
|
48
|
+
## Triage
|
|
49
|
+
|
|
50
|
+
Each unchecked item should become its own roadmap file when prioritized.
|
|
51
|
+
For now they are tracked collectively; promote to a numbered file when
|
|
52
|
+
scheduled.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 24 — CI and Release
|
|
2
|
+
|
|
3
|
+
## Status: [ ]
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
Current CI runs `bundle exec rake` (spec + rubocop) on a generic
|
|
8
|
+
workflow. For a 0.2.0 release that adds a whole new direction we need:
|
|
9
|
+
|
|
10
|
+
- Multi-Ruby matrix.
|
|
11
|
+
- Round-trip regression gate.
|
|
12
|
+
- Compatibility report (which fixtures pass, which fail).
|
|
13
|
+
- Release flow that respects the "no tags, no push to main" rule.
|
|
14
|
+
|
|
15
|
+
## Tasks
|
|
16
|
+
|
|
17
|
+
- [ ] `.github/workflows/test.yml` matrix:
|
|
18
|
+
- Ruby: 3.0, 3.1, 3.2, 3.3, 3.4
|
|
19
|
+
- OS: ubuntu-latest, macos-latest
|
|
20
|
+
- Steps: `bundle install`, `bundle exec rake` (spec + rubocop),
|
|
21
|
+
`bundle exec ruby scripts/run_round_trip.rb`.
|
|
22
|
+
- [ ] `scripts/run_round_trip.rb`: walk `spec/fixtures/round_trip/*.svg`,
|
|
23
|
+
for each: `Postsvg.to_ps(svg); Postsvg.to_svg(ps)`; assert geometric
|
|
24
|
+
equivalence via `canon/rspec_matchers`. Print per-fixture result.
|
|
25
|
+
- [ ] `scripts/compatibility_report.rb`: walk
|
|
26
|
+
`spec/fixtures/ps2svg/*.ps` and `spec/fixtures/eps2svg/*.eps`, run
|
|
27
|
+
through `Postsvg.to_svg`, summarize pass/fail and any unsupported
|
|
28
|
+
operators encountered. Output markdown table.
|
|
29
|
+
- [ ] `docs/compatibility_matrix.adoc`: live document, regenerated by
|
|
30
|
+
the report script, listing supported subset.
|
|
31
|
+
- [ ] `.github/workflows/release.yml`: triggered on tag push `v*` (by
|
|
32
|
+
a maintainer, never by an agent). Builds gem, pushes to rubygems.org,
|
|
33
|
+
creates GitHub Release with changelog excerpt.
|
|
34
|
+
- [ ] Version bump policy: bump `lib/postsvg/version.rb` on every PR
|
|
35
|
+
that changes public API. Use semver: 0.x means anything can move.
|
|
36
|
+
|
|
37
|
+
## What CI does NOT do
|
|
38
|
+
|
|
39
|
+
- Push tags. Tags are human actions.
|
|
40
|
+
- Push to main. PRs only.
|
|
41
|
+
- Run on Windows. PS is a Unix/Cocoa-adjacent ecosystem; Windows
|
|
42
|
+
support is best-effort, not gated.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Postsvg Roadmap — PS/EPS ⇔ SVG
|
|
2
|
+
|
|
3
|
+
This directory captures every work item needed to take Postsvg from a
|
|
4
|
+
one-directional (PS/EPS → SVG) hand-rolled interpreter to a fully
|
|
5
|
+
bidirectional (PS/EPS ⇔ SVG) transformer with a clean, OCP-compliant,
|
|
6
|
+
model-driven architecture modelled on `emfsvg`.
|
|
7
|
+
|
|
8
|
+
Each file is one unit of work. Files are numbered in dependency order;
|
|
9
|
+
later files depend on earlier ones unless noted.
|
|
10
|
+
|
|
11
|
+
## Status legend
|
|
12
|
+
|
|
13
|
+
- `[ ]` — not started
|
|
14
|
+
- `[~]` — in progress
|
|
15
|
+
- `[x]` — complete
|
|
16
|
+
|
|
17
|
+
## Index
|
|
18
|
+
|
|
19
|
+
| # | File | Priority | Status | Summary |
|
|
20
|
+
|----|-------------------------------------|----------|--------|---------------------------------------------------------------|
|
|
21
|
+
| 00 | `00-architecture.md` | P0 | [x] | Target architecture and design rationale |
|
|
22
|
+
| 01 | `01-autoload-migration.md` | P0 | [x] | Convert `lib/` to Ruby `autoload` |
|
|
23
|
+
| 02 | `02-isolate-dormant-code.md` | P0 | [x] | Quarantine Parslet/Converter/old SvgGenerator (no deletion) |
|
|
24
|
+
| 03 | `03-domain-model.md` | P0 | [x] | `Postsvg::Model::*` typed PS record value objects |
|
|
25
|
+
| 04 | `04-lexer.md` | P0 | [x] | Comment-safe PS lexer producing `Model::Token`s |
|
|
26
|
+
| 05 | `05-parser.md` | P0 | [x] | Token → `Model::Program` (AST with procedure inlining) |
|
|
27
|
+
| 06 | `06-graphics-state.md` | P0 | [x] | `Postsvg::GraphicsContext` immutable snapshot + stack |
|
|
28
|
+
| 07 | `07-matrix-and-color.md` | P0 | [x] | `Matrix` affine + `Color` RGB/Gray/CMYK value objects |
|
|
29
|
+
| 08 | `08-svg-builder.md` | P0 | [x] | `Postsvg::SvgBuilder` append-only emitter |
|
|
30
|
+
| 09 | `09-renderer.md` | P0 | [x] | `Postsvg::Renderer` orchestrator for PS→SVG |
|
|
31
|
+
| 10 | `10-visitor.md` | P0 | [x] | `Postsvg::Visitors::PsVisitor` OCP dispatch |
|
|
32
|
+
| 11 | `11-operator-coverage.md` | P1 | [~] | Comprehensive PS operator coverage (Levels 1/2/3) |
|
|
33
|
+
| 12 | `12-svg-domain.md` | P0 | [x] | `Postsvg::Svg::*` value objects + Nokogiri parser |
|
|
34
|
+
| 13 | `13-translation-handlers.md` | P0 | [x] | `Postsvg::Translation::Handlers::*` (SVG → PS, OCP) |
|
|
35
|
+
| 14 | `14-ps-serializer.md` | P0 | [x] | `Postsvg::Serializer` Model → PS/EPS source |
|
|
36
|
+
| 15 | `15-cli-and-public-api.md` | P0 | [x] | Finalise `Postsvg.convert/to_ps/from_svg` + CLI |
|
|
37
|
+
| 16 | `16-specs.md` | P0 | [~] | Per-component + round-trip spec coverage |
|
|
38
|
+
| 17 | `17-docs-sync.md` | P1 | [ ] | README/docs reflect the live pipeline |
|
|
39
|
+
| 18 | `18-performance-and-determinism.md` | P2 | [ ] | Frozen-string literals, dedup, deterministic output |
|
|
40
|
+
| 19 | `19-error-model.md` | P1 | [ ] | Typed errors: ParseError / UnsupportedError / SerializeError |
|
|
41
|
+
| 20 | `20-font-and-text.md` | P2 | [ ] | Font metrics, glyph outlines, `show`/`ashow`/`widthshow` |
|
|
42
|
+
| 21 | `21-images.md` | P2 | [ ] | `image`/`imagemask` round-trip with PNG encode/decode |
|
|
43
|
+
| 22 | `22-forms-and-resources.md` | P3 | [ ] | PS Forms, resource dictionary, `ExecuteForm` |
|
|
44
|
+
| 23 | `23-level2-level3.md` | P3 | [ ] | Shading, patterns, halftone, CID fonts, filters |
|
|
45
|
+
| 24 | `24-ci-and-release.md` | P2 | [ ] | Matrix CI, compatibility report, release flow |
|
|
46
|
+
|
|
47
|
+
## Priority key
|
|
48
|
+
|
|
49
|
+
- **P0** — without this, the bidirectional pipeline does not exist.
|
|
50
|
+
- **P1** — meaningful completeness gap (operator coverage, error model).
|
|
51
|
+
- **P2** — production hardening (perf, CI, fonts, images).
|
|
52
|
+
- **P3** — full PLRM conformance for advanced users.
|
|
53
|
+
|
|
54
|
+
## What "done" looks like
|
|
55
|
+
|
|
56
|
+
For 0.2.0 (this roadmap's target):
|
|
57
|
+
|
|
58
|
+
```ruby
|
|
59
|
+
# PS/EPS → SVG (existing direction, rebuilt on clean pipeline)
|
|
60
|
+
Postsvg.convert(ps_string) # => svg string
|
|
61
|
+
Postsvg.convert_file(in, out=nil)
|
|
62
|
+
|
|
63
|
+
# SVG → PS/EPS (new direction)
|
|
64
|
+
Postsvg.to_ps(svg_string, eps: false) # => ps string
|
|
65
|
+
Postsvg.to_eps(svg_string) # => eps string
|
|
66
|
+
Postsvg.from_svg_file(path, eps: true)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
postsvg convert INPUT.ps|INPUT.eps [OUTPUT.svg] # PS/EPS → SVG
|
|
71
|
+
postsvg to-ps INPUT.svg [OUTPUT.ps] # SVG → PS
|
|
72
|
+
postsvg to-eps INPUT.svg [OUTPUT.eps] # SVG → EPS
|
|
73
|
+
postsvg batch INPUT_DIR [OUTPUT_DIR] # auto-detects direction
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Test coverage: every public method has specs; round-trip
|
|
77
|
+
(`SVG → PS → SVG`) preserves geometry for the supported subset.
|
data/docs/.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Jekyll build artifacts
|
|
2
|
+
_site/
|
|
3
|
+
.sass-cache/
|
|
4
|
+
.jekyll-cache/
|
|
5
|
+
.jekyll-metadata
|
|
6
|
+
|
|
7
|
+
# Bundler
|
|
8
|
+
.bundle/
|
|
9
|
+
vendor/
|
|
10
|
+
|
|
11
|
+
# Ruby
|
|
12
|
+
*.gem
|
|
13
|
+
*.rbc
|
|
14
|
+
.config
|
|
15
|
+
coverage/
|
|
16
|
+
InstalledFiles
|
|
17
|
+
lib/bundler/man/
|
|
18
|
+
|
|
19
|
+
# Temporary files
|
|
20
|
+
*~
|
|
21
|
+
*.swp
|
|
22
|
+
*.swo
|
|
23
|
+
.DS_Store
|
|
24
|
+
|
|
25
|
+
# Log files
|
|
26
|
+
*.log
|
|
27
|
+
|
|
28
|
+
# Lock files (optional - comment out if you want to commit)
|
|
29
|
+
Gemfile.lock
|
data/docs/CHANGELOG.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Documentation Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Postsvg documentation will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Added - 2025-01-24
|
|
8
|
+
|
|
9
|
+
**Core Infrastructure:**
|
|
10
|
+
- Added Jekyll configuration with just-the-docs theme (`_config.yml`)
|
|
11
|
+
- Created documentation homepage and navigation hub (`index.adoc`)
|
|
12
|
+
- Added Gemfile for Jekyll dependencies
|
|
13
|
+
- Created .gitignore for build artifacts
|
|
14
|
+
- Added README.md with build and contribution guidelines
|
|
15
|
+
- Created comprehensive documentation plan (DOCUMENTATION_PLAN.md)
|
|
16
|
+
|
|
17
|
+
**Parent-Level Documentation (10 files):**
|
|
18
|
+
- Added Getting Started overview (`getting-started.adoc`)
|
|
19
|
+
- Added Core Concepts overview (`concepts.adoc`)
|
|
20
|
+
- Added API Reference overview (`api-reference.adoc`)
|
|
21
|
+
- Added CLI Reference overview (`cli-reference.adoc`)
|
|
22
|
+
- Added Architecture documentation (`architecture.adoc`)
|
|
23
|
+
- Added Advanced Topics overview (`advanced-topics.adoc`)
|
|
24
|
+
- Added Development Guide (`development.adoc`)
|
|
25
|
+
- Added Contributing Guide (`contributing.adoc`)
|
|
26
|
+
- Added Troubleshooting Guide (`troubleshooting.adoc`)
|
|
27
|
+
- Added Frequently Asked Questions (`faq.adoc`)
|
|
28
|
+
|
|
29
|
+
**Getting Started Child Topics:**
|
|
30
|
+
- Added Installation Guide (`getting-started/installation.adoc`)
|
|
31
|
+
- Platform-specific installation instructions
|
|
32
|
+
- Docker installation
|
|
33
|
+
- CI/CD integration examples
|
|
34
|
+
- Troubleshooting installation issues
|
|
35
|
+
- Added Basic Usage Guide (`getting-started/basic-usage.adoc`)
|
|
36
|
+
- CLI usage patterns
|
|
37
|
+
- Ruby API examples
|
|
38
|
+
- Common workflows
|
|
39
|
+
- Error handling patterns
|
|
40
|
+
- Added First Conversion Tutorial (`getting-started/first-conversion.adoc`)
|
|
41
|
+
- Step-by-step tutorial
|
|
42
|
+
- Creating PostScript files
|
|
43
|
+
- Converting to SVG
|
|
44
|
+
- Common issues and solutions
|
|
45
|
+
|
|
46
|
+
**Documentation Features:**
|
|
47
|
+
- 50+ practical code examples with syntax highlighting
|
|
48
|
+
- 200+ cross-references with file paths and line numbers
|
|
49
|
+
- ASCII diagrams for architecture visualization
|
|
50
|
+
- MECE principles (Mutually Exclusive, Collectively Exhaustive)
|
|
51
|
+
- Standard document structure (Purpose, References, Concepts, Bibliography)
|
|
52
|
+
- Search functionality enabled
|
|
53
|
+
- Mobile-responsive layout
|
|
54
|
+
- AsciiDoc format with rich formatting support
|
|
55
|
+
|
|
56
|
+
**Quality Standards:**
|
|
57
|
+
- Following LADL specification best practices
|
|
58
|
+
- Consistent document templates
|
|
59
|
+
- Clear hierarchical organization
|
|
60
|
+
- Example-driven content
|
|
61
|
+
- Comprehensive cross-referencing
|
|
62
|
+
|
|
63
|
+
### Documentation Stats
|
|
64
|
+
- **Total Files**: 19 documentation files
|
|
65
|
+
- **Total Lines**: ~8,500 lines
|
|
66
|
+
- **Parent Topics**: 10/10 (100%)
|
|
67
|
+
- **Child Topics**: 3/44 created (7%)
|
|
68
|
+
- **Code Examples**: 50+
|
|
69
|
+
- **Cross-References**: 200+
|
|
70
|
+
|
|
71
|
+
## Future Additions
|
|
72
|
+
|
|
73
|
+
### Priority 1: Essential Child Topics
|
|
74
|
+
- [ ] `getting-started/common-workflows.adoc` - Real-world usage patterns
|
|
75
|
+
- [ ] `api-reference/postsvg-module.adoc` - Main module documentation
|
|
76
|
+
- [ ] `api-reference/converter.adoc` - Converter class details
|
|
77
|
+
- [ ] `api-reference/interpreter.adoc` - Interpreter class details
|
|
78
|
+
- [ ] `cli-reference/convert-command.adoc` - Convert command details
|
|
79
|
+
- [ ] `cli-reference/batch-command.adoc` - Batch command details
|
|
80
|
+
- [ ] `cli-reference/check-command.adoc` - Check command details
|
|
81
|
+
|
|
82
|
+
### Priority 2: Core Concepts
|
|
83
|
+
- [ ] `concepts/conversion-pipeline.adoc` - Pipeline details
|
|
84
|
+
- [ ] `concepts/graphics-state.adoc` - State management
|
|
85
|
+
- [ ] `concepts/coordinate-systems.adoc` - Coordinate handling
|
|
86
|
+
|
|
87
|
+
### Priority 3: Architecture
|
|
88
|
+
- [ ] `architecture/conversion-pipeline.adoc` - Pipeline implementation
|
|
89
|
+
- [ ] `architecture/command-registry.adoc` - Command system
|
|
90
|
+
- [ ] `architecture/design-decisions.adoc` - Architectural rationale
|
|
91
|
+
|
|
92
|
+
## Notes
|
|
93
|
+
|
|
94
|
+
**Documentation Philosophy:**
|
|
95
|
+
- Write for clarity over cleverness
|
|
96
|
+
- Provide practical examples for every feature
|
|
97
|
+
- Cross-reference related topics extensively
|
|
98
|
+
- Follow MECE principles for organization
|
|
99
|
+
- Keep content up-to-date with code changes
|
|
100
|
+
|
|
101
|
+
**Contribution Guidelines:**
|
|
102
|
+
- All new features must be documented
|
|
103
|
+
- Documentation changes follow same PR process as code
|
|
104
|
+
- Use standard document template
|
|
105
|
+
- Include code examples that are tested
|
|
106
|
+
- Maintain cross-references
|
|
107
|
+
|
|
108
|
+
## Version History
|
|
109
|
+
|
|
110
|
+
- **2025-01-24** - Initial documentation infrastructure created
|
|
111
|
+
- Jekyll site configured
|
|
112
|
+
- Parent-level documentation complete
|
|
113
|
+
- Essential getting started guides added
|
|
114
|
+
- Ready for deployment to GitHub Pages
|