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

Develop the package system #369

Open
wants to merge 314 commits into
base: dev-0-1-0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
5998011
move 'footnote-scheme'
gfngfn Nov 2, 2022
9dac222
move 'proof'
gfngfn Nov 2, 2022
c509f94
move 'md-ja'
gfngfn Nov 2, 2022
86a1a17
move 'std-ja{,-report,-book}'
gfngfn Nov 2, 2022
0b4c770
lessen contents of package config files
gfngfn Nov 2, 2022
04eefc8
Merge pull request #370 from gfngfn/dev-0-1-0-lock-file
gfngfn Nov 3, 2022
2f32a2c
support 'use open' etc.
gfngfn Nov 3, 2022
301833f
refactor libraries by using 'use package open'
gfngfn Nov 3, 2022
604bcbe
fix how to extend type environments with 'use package open'
gfngfn Nov 3, 2022
ae65ebc
remove 'Stdlib.'
gfngfn Nov 3, 2022
bda1b1a
use 'use package open' and 'use open' in '{tests,doc,demo}'
gfngfn Nov 3, 2022
8a43e85
Merge pull request #372 from gfngfn/dev-0-1-0-dev-use-open
gfngfn Nov 3, 2022
b12b274
begin to support package builds
gfngfn Nov 3, 2022
d451f37
support package builds
gfngfn Nov 3, 2022
da2866f
add 'package.satysfi-lock' to packages
gfngfn Nov 3, 2022
42ee609
set 'opam-depext' to false
gfngfn Nov 3, 2022
edc8e29
set 'opam-depext' to true again
gfngfn Nov 3, 2022
48fd6d6
re-support the 'Foo.(...)' syntax
gfngfn Nov 3, 2022
43612a8
fix 'subtype_type_scheme'
gfngfn Nov 3, 2022
ddcc384
extend 'UTConstructor' to take module names
gfngfn Nov 3, 2022
288a2db
update the parser test
gfngfn Nov 3, 2022
e911722
implement 'update_subsignature' for 'with type'
gfngfn Nov 3, 2022
3568508
extend 'UTPConstructor' to take module names
gfngfn Nov 3, 2022
f06325a
remove OCaml 4.12.1 from CI
gfngfn Nov 4, 2022
7943569
make lock configs support 'local'
gfngfn Nov 4, 2022
03874ea
begin to develop 'PackageConstraintSolver'
gfngfn Nov 6, 2022
3ebfbe1
develop 'PackageConstraintSolver' about semver
gfngfn Nov 6, 2022
8c3d612
develop 'PackageConstraintSolver.solve'
gfngfn Nov 6, 2022
79919ae
begin to develop 'PackageRegistry'
gfngfn Nov 6, 2022
f7553b1
make package contexts passed to the constraint solver through roles
gfngfn Nov 6, 2022
2ce9a8e
introduce 'LocalRole' and 'LocalImpl'
gfngfn Nov 6, 2022
ea7446b
add the interface file of 'PackageConstraintSolver'
gfngfn Nov 7, 2022
540282f
begin to add a subcommand 'solve' for constraint solving
gfngfn Nov 7, 2022
4d53ed1
begin to develop 'Main.solve'
gfngfn Nov 7, 2022
2f2fa48
develop command 'solve'
gfngfn Nov 7, 2022
4ca690b
refactor how to decode lock configs
gfngfn Nov 7, 2022
7dbee97
develop how to convert solutions to lock configs
gfngfn Nov 7, 2022
853f5ef
fix 'requires' of constraint solving
gfngfn Nov 7, 2022
e7d54e5
add 'dependencies:' to the configs of the pre-installed packages
gfngfn Nov 7, 2022
0d7506f
introduce the attribute syntax '#[foo ...]'
gfngfn Nov 7, 2022
d321e71
update the parser test
gfngfn Nov 7, 2022
dd2bfcd
introduce 'DocumentAttribute'
gfngfn Nov 7, 2022
7828f72
use 'DocumentAttribute' for specifying dependencies of documents
gfngfn Nov 7, 2022
02d153f
add '#[dependencies ...]' attribute to '{demo,doc}/*.saty'
gfngfn Nov 7, 2022
8ba9bf9
add 'Logging.show_package_dependency_{before_solving,solutions}'
gfngfn Nov 7, 2022
d1cf570
remove printf for debugging
gfngfn Nov 7, 2022
da59286
implement how to encode lock configs
gfngfn Nov 7, 2022
735e288
make 'LockConfig.write' output lock files
gfngfn Nov 7, 2022
0a5607b
generate '{demo,doc}/*.satysfi-lock' by 'satysfi solve'
gfngfn Nov 7, 2022
6038102
generate 'tests/**/*.satysfi-lock' by 'satysfi solve' (except for 'te…
gfngfn Nov 7, 2022
58c1117
develop how to load registry configs
gfngfn Nov 8, 2022
ac610ba
introduce 'dist/cache/registry.yaml'
gfngfn Nov 8, 2022
7697370
Merge pull request #373 from gfngfn/dev-0-1-0-constraint-solver
gfngfn Nov 9, 2022
13e9849
refactor how to read files
gfngfn Nov 11, 2022
89d242c
refactor Uchar-handling functions
gfngfn Nov 11, 2022
48f5dda
replace 'MyUtil.list_make' with 'List.init'
gfngfn Nov 11, 2022
b11a866
remove 'MyUtil.list_some', which was unused
gfngfn Nov 11, 2022
65833b1
replace 'MyUtil.list_fold_left_index' with 'Core.List.foldi'
gfngfn Nov 11, 2022
480924c
migrate 'pickup'
gfngfn Nov 11, 2022
29455a5
replace 'MyUtil.first_some' with 'List.find_map'
gfngfn Nov 11, 2022
61cb903
remove 'MyUtil.(+=)'
gfngfn Nov 11, 2022
ee130ff
separate '{Option,Result,Escape}Monad' from 'MyUtil'
gfngfn Nov 11, 2022
617d51c
remove sources that are no longer used
gfngfn Nov 11, 2022
6efda64
remove from 'MyUtil' functions that are no longer used
gfngfn Nov 11, 2022
72caea1
remove 'open_out_abs' by using 'Core.Out_channel.write_all'
gfngfn Nov 11, 2022
bdf84aa
fix tests about migration of modules
gfngfn Nov 11, 2022
3f9c01f
Merge pull request #374 from gfngfn/dev-0-1-0-refactor-file-path
gfngfn Nov 11, 2022
66a62f5
make 'Makefile' generate lock files and compare them to the correspon…
gfngfn Nov 11, 2022
d8866f5
make 'doc/Makefile' generate lock files and compare them to the corre…
gfngfn Nov 11, 2022
5df59ac
make 'tests/**/Makefile' generate lock files and compare them to the …
gfngfn Nov 11, 2022
2299b43
begin to develop the notion of font packages
gfngfn Nov 12, 2022
50ad7f8
add 'Load{Single,Collection}Font', 'FontType', etc.
gfngfn Nov 12, 2022
6391f31
replace 'font_abbrev' with 'FontKey.t'
gfngfn Nov 12, 2022
a1b2fc8
FIRST SUCCESS in typesetting 'demo.pdf' by using font packages
gfngfn Nov 12, 2022
61edbf9
slight refactoring
gfngfn Nov 12, 2022
0849d2d
replace 'math_font_abbrev' with 'FontKey.t'
gfngfn Nov 12, 2022
b7d26ff
discard 'LoadFont' and 'SetDefaultFont'
gfngfn Nov 12, 2022
4e9b385
discard 'lib-satysfi/{fonts,hash}'
gfngfn Nov 12, 2022
6c60b49
update 'demo.satysfi-lock-expected'
gfngfn Nov 12, 2022
e3fd715
update CI
gfngfn Nov 12, 2022
8868271
make 'doc/*.saty' pass
gfngfn Nov 12, 2022
5c413bd
fix 'opam-version'
gfngfn Nov 12, 2022
a5781b2
make 'doc/*.saty' pass (2)
gfngfn Nov 12, 2022
c1989e3
remove OCaml 4.13.1 from 'ci.yml'
gfngfn Nov 12, 2022
0950d7b
make 'tests/*' pass
gfngfn Nov 12, 2022
c43ac40
update lock files of packages
gfngfn Nov 12, 2022
43a5085
disable printf for debugging
gfngfn Nov 12, 2022
47cbcdc
refactor 'FontInfo' and 'FontFormat'
gfngfn Nov 12, 2022
c1927c0
modify 'FailedToDecodeFont'
gfngfn Nov 12, 2022
f5b1552
refactor 'FontFormat' to remove exception 'BrokenFont'
gfngfn Nov 12, 2022
ac0a37e
refactor 'FontFormat' (mostly cosmetic changes)
gfngfn Nov 12, 2022
5646c3e
completely remove exceptions from 'FontFormat'
gfngfn Nov 12, 2022
2f6479b
cosmetic changes
gfngfn Nov 12, 2022
a8b54e4
add 'logging.mli' etc.
gfngfn Nov 12, 2022
9d4568d
use '{,Math}FontIsNotSet'
gfngfn Nov 12, 2022
7db60f2
Merge pull request #375 from gfngfn/dev-0-1-0-font-package
gfngfn Nov 12, 2022
e450f24
add 'conversion' section to the format of 'satysfi.yaml'
gfngfn Nov 14, 2022
865d7e4
migrate 'omd' from '1.3.1' to '2.0.0~alpha2'
gfngfn Nov 14, 2022
153e836
modify how to decode Markdown documents
gfngfn Nov 14, 2022
2babe4c
implement how to extract Markdown command records from configs
gfngfn Nov 14, 2022
07a82c8
FIRST SUCCESS in using Markdown conversion rules given in package con…
gfngfn Nov 14, 2022
f71206f
slight refactoring of 'OpenFileDependencyResolver'
gfngfn Nov 14, 2022
1848486
abandon 'LoadMDSetting'
gfngfn Nov 14, 2022
86be82f
delete 'mdja.satysfi-md'
gfngfn Nov 14, 2022
47ab101
change the '--markdown' option to a flag
gfngfn Nov 14, 2022
e6cd964
change some field names about Markdown
gfngfn Nov 14, 2022
97579ba
remove flag '--markdown'
gfngfn Nov 14, 2022
1013781
remove flag '--show-fonts'
gfngfn Nov 14, 2022
17bf1c4
make 'satysfi solve' support Markdown inputs
gfngfn Nov 14, 2022
2fb962d
various small updates
gfngfn Nov 14, 2022
b14fb35
refactor 'DecodeMD' into monadic
gfngfn Nov 14, 2022
f92926c
rename 'DecodeMD' to 'MarkdownParser'
gfngfn Nov 14, 2022
3118894
refactor 'MarkdownParser' about variable names
gfngfn Nov 14, 2022
e93188e
abandon 'code_block_map'
gfngfn Nov 14, 2022
7208759
remove unnecessary code from 'md-ja.satyh'
gfngfn Nov 15, 2022
b836516
Merge pull request #376 from gfngfn/dev-0-1-0-markdown-package
gfngfn Nov 15, 2022
024478c
support 'test_dependencies' section
gfngfn Nov 15, 2022
e41b0f6
add 'reachability_closure' to 'DependencyGraph'
gfngfn Nov 15, 2022
bf1d1cc
develop tests for 'reachability_closure'
gfngfn Nov 15, 2022
6f1104c
use 'LockDependencyGraph' to compute source dependencies and test-onl…
gfngfn Nov 15, 2022
237a5cb
FIRST SUCCESS in distinguishing whether each dependency is for test only
gfngfn Nov 15, 2022
c88ee48
update tests
gfngfn Nov 15, 2022
c61b4d5
take 'test_only' in lock files into account when building
gfngfn Nov 15, 2022
c0fae46
update tests
gfngfn Nov 15, 2022
3f8ccf6
remove printf for debugging
gfngfn Nov 15, 2022
1d80ed0
Merge pull request #377 from gfngfn/dev-0-1-0-test-dependency
gfngfn Nov 15, 2022
6cd9ed6
make 'val' bindings support attributes
gfngfn Nov 15, 2022
aa6840d
make 'val' bindings support '#[test]' attributes
gfngfn Nov 15, 2022
153fcbd
add the subcommand 'satysfi test'
gfngfn Nov 16, 2022
a8ba9d7
make package configs support the 'test_directories' section
gfngfn Nov 16, 2022
8d49cf0
slight fixes on 'OptionState'
gfngfn Nov 16, 2022
3be1f55
add a small example unit test for 'stdlib'
gfngfn Nov 16, 2022
ddec1ce
make test result message printed, and set the exit status code to 1 w…
gfngfn Nov 17, 2022
a688852
change the result type of tests from 'option string' to 'unit'
gfngfn Nov 17, 2022
848b94b
fix how to run tests about 'use_test_only_lock'
gfngfn Nov 17, 2022
6828cfb
develop a new package 'testing' and use it in tests for 'stdlib'
gfngfn Nov 17, 2022
71f20d1
Merge pull request #378 from gfngfn/dev-0-1-0-test-system
gfngfn Nov 17, 2022
13bc074
slight refactoring
gfngfn Nov 18, 2022
4ea8383
extend the format of registry configs with sections about how to fetc…
gfngfn Nov 18, 2022
6335309
extend 'package_solution' with 'locked_source'
gfngfn Nov 18, 2022
f0bea39
introduce 'implementation_spec'
gfngfn Nov 19, 2022
14d79ca
introduce 'primary_root_dir' for fetching package implementations
gfngfn Nov 19, 2022
9613c8d
update expected lock files
gfngfn Nov 19, 2022
55a9ba6
update CI about 'diff' on 'macos-latest'
gfngfn Nov 21, 2022
bcdbf10
add 'LockFetcher'
gfngfn Nov 22, 2022
7644fb6
develop how to extract tarballs of locked packages
gfngfn Nov 22, 2022
30c4c8c
small fixes
gfngfn Nov 22, 2022
2bea99c
add an interface file to 'LockFetcher'
gfngfn Dec 5, 2022
5291900
small changes
gfngfn Dec 5, 2022
27ac5d8
Merge pull request #379 from gfngfn/dev-0-1-0-package-fetch
gfngfn Dec 5, 2022
e05a63c
remove 'dist/'
gfngfn Dec 6, 2022
35dca89
update expected lock files
gfngfn Dec 6, 2022
97474e2
update 'download-fonts.sh'
gfngfn Dec 6, 2022
ffc588a
Merge pull request #380 from gfngfn/dev-0-1-0-discard-dist-and-local
gfngfn Dec 6, 2022
aeb99f3
modify how to decode version requirements
gfngfn Dec 7, 2022
7fa26a3
modify version requirements in config files
gfngfn Dec 7, 2022
4ee734f
modify version requirements in 'test.md'
gfngfn Dec 7, 2022
eb1e2fd
Merge pull request #381 from gfngfn/dev-0-1-0-modify-version-requirem…
gfngfn Dec 7, 2022
0a82268
make multiple versions of a package incompatible to each other able t…
gfngfn Dec 8, 2022
5dd55a8
fix 'PackageConstraintSolver' about name collision
gfngfn Dec 8, 2022
26c5338
refactor about locks
gfngfn Dec 8, 2022
db12c59
fix the constraint solver and add a test for it
gfngfn Dec 8, 2022
fe3d9c3
add a test for the constraint solver
gfngfn Dec 8, 2022
17b8dd6
Merge pull request #382 from gfngfn/dev-0-1-0-incompatible-version-co…
gfngfn Dec 9, 2022
4957f4d
add 'package_name_decoder' etc.
gfngfn Dec 9, 2022
7715f06
rename 'PackageRegistry' to 'PackageRegistryConfig'
gfngfn Dec 9, 2022
56c432a
add 'name' and 'authors' sections to the package config format
gfngfn Dec 9, 2022
3facf7b
add 'name' and 'authors' sections to package configs
gfngfn Dec 9, 2022
541ace3
fix unit tests
gfngfn Dec 9, 2022
587e5c0
add 'check-packages.sh' (for CI as well as for manual execution)
gfngfn Dec 10, 2022
6002693
update how to decode/encode the package/lock configs
gfngfn Dec 10, 2022
8779d45
update config files and lock files
gfngfn Dec 10, 2022
759e893
update lock files
gfngfn Dec 10, 2022
8acc695
add the 'language' section to the 'implementations' entry format in r…
gfngfn Dec 10, 2022
d03d05a
fix tests
gfngfn Dec 10, 2022
8dfb04f
refactor how to run tests in CI
gfngfn Dec 10, 2022
8086423
update tests of checking packages
gfngfn Dec 10, 2022
8ec4f36
Merge pull request #383 from gfngfn/dev-0-1-0-refactor-configs
gfngfn Dec 10, 2022
05c9702
add 'LibraryRootConfig'
gfngfn Dec 10, 2022
f2ebbc4
slight changes
gfngfn Dec 10, 2022
d849871
add the 'registry' section etc. to config formats
gfngfn Dec 11, 2022
ec1b55e
update config files
gfngfn Dec 11, 2022
8728d7b
fix unit tests
gfngfn Dec 11, 2022
54d7247
fix 'MarkdownParser' about '#[config ...]'
gfngfn Dec 11, 2022
967b1cc
update 'test.md' about '#[config ...]'
gfngfn Dec 11, 2022
4fedfda
add 'LibraryRootConfig.write'
gfngfn Dec 11, 2022
79fa0f3
implement 'PackageRegistryFetcher'
gfngfn Dec 11, 2022
98a00a9
migrate 'satysfi-registry.yaml' to 'https://github.com/SATySFi/defaul…
gfngfn Dec 11, 2022
cd5bf43
refactor by using 'Constant'
gfngfn Dec 11, 2022
7156557
refactor by introducing 'ShellCommand'
gfngfn Dec 11, 2022
3957c09
refine how to decode document attributes
gfngfn Dec 11, 2022
e45029e
refine how to decode document attributes (2)
gfngfn Dec 11, 2022
c074573
implement 'CanonicalRegistryUrl'
gfngfn Dec 11, 2022
4a3c3a2
Merge pull request #384 from gfngfn/dev-0-1-0-registry-fetch
gfngfn Dec 11, 2022
2c46b3c
add the 'external_sources' to the package config format
gfngfn Dec 12, 2022
e6e4b78
develop 'LockFetcher' about 'external_sources'
gfngfn Dec 12, 2022
746ebad
develop 'LockFetcher' about checking fetched files by checksums
gfngfn Dec 12, 2022
ad1536e
develop 'LockFetcher' about extracting zip files
gfngfn Dec 12, 2022
b0b2971
implement how to copy files extracted from zip files
gfngfn Dec 12, 2022
940f785
add an 'external_sources' section to config files of font packages
gfngfn Dec 12, 2022
804c9c4
add 'make-package-tarballs.sh' for testing releases
gfngfn Dec 12, 2022
54c7cae
fix 'make-package-tarballs.sh'
gfngfn Dec 12, 2022
2934986
fix how to match checksums
gfngfn Dec 12, 2022
dc1bc4e
use remote packages in CI
gfngfn Dec 12, 2022
dd544e2
use remote packages in CI (2)
gfngfn Dec 12, 2022
6622f8b
use remote packages in CI (3)
gfngfn Dec 12, 2022
c0cafcd
use remote packages in CI (4)
gfngfn Dec 12, 2022
e715ee8
Merge pull request #385 from gfngfn/dev-0-1-0-external-source
gfngfn Dec 12, 2022
b10607c
support 'format' and 'checksum' of registry configs
gfngfn Dec 12, 2022
35236e9
add registry hash values to paths to locked packages
gfngfn Dec 12, 2022
a862853
add registry hash values to paths to cache files
gfngfn Dec 12, 2022
5ad9736
add registry hash values to paths to cache files (2)
gfngfn Dec 12, 2022
4ea6f8d
update lock file expectations
gfngfn Dec 12, 2022
910712f
update unit tests
gfngfn Dec 12, 2022
dc391b7
update lock files of packages
gfngfn Dec 12, 2022
3aa4023
Merge pull request #386 from gfngfn/dev-0-1-0-small-fixes-of-package-…
gfngfn Dec 12, 2022
148f39b
begin to refactor 'Constant'
gfngfn Dec 17, 2022
785abf9
begin to refactor 'Constant' (2)
gfngfn Dec 18, 2022
92e1b3d
refactor paths about locks
gfngfn Dec 18, 2022
063dcc4
fix the version of 'omd' to '2.0.0~alpha'
gfngfn Dec 18, 2022
7437cb1
fix the version of 'omd' to '2.0.0~alpha3'
gfngfn Dec 18, 2022
16146db
update lock files
gfngfn Dec 18, 2022
bb064b1
change the lock config format and refactor how to determine the libra…
gfngfn Dec 18, 2022
e66294e
change the lock config format and refactor how to determine the libra…
gfngfn Dec 18, 2022
6ef1ada
change the lock config format and refactor how to determine the libra…
gfngfn Dec 18, 2022
d1e7778
update lock files
gfngfn Dec 18, 2022
499420d
update lock files (2)
gfngfn Dec 18, 2022
b5f6fee
update the package config format
gfngfn Dec 18, 2022
1580297
update packages
gfngfn Dec 18, 2022
fb23502
update unit tests
gfngfn Dec 18, 2022
adeba36
Merge pull request #387 from gfngfn/dev-0-1-0-refactor-config-path
gfngfn Dec 18, 2022
1bf3543
merge 'dev-0-1-0' with conflicts fixed
gfngfn May 25, 2023
04da70c
merge `master` via `dev-0-1-0` with conflicts fixed
gfngfn Oct 24, 2023
bcee545
upgrade the URL for the Latin Modern font in `font-latin-modern`
gfngfn Oct 24, 2023
4990513
remove `output_mode` from `OptionState`
gfngfn Oct 29, 2023
aae3ab0
remove `bytecomp` from `OptionState`
gfngfn Oct 29, 2023
1e236dc
remove `page_number_limit` from `OptionState`
gfngfn Oct 29, 2023
3a2cadc
migrate `debug_*` fields from `OptionState` to `HandlePdf.config`
gfngfn Oct 29, 2023
5176297
remove unnecessary fields from `OptionState`
gfngfn Oct 29, 2023
b586422
refactor `OptionState` about `input_file`
gfngfn Oct 29, 2023
fed99e2
migrate `show_full_path` from `OptionState` to `Logging`
gfngfn Oct 30, 2023
4c8a575
migrate `job_directory` to `runtime_config`, and delete `OptionState`
gfngfn Oct 30, 2023
da99d03
Merge pull request #420 from gfngfn/discard-option-state
gfngfn Nov 29, 2023
b8b4ae4
Allow importing submodules in use statement
kyori19 Dec 1, 2023
66af49c
remove unnecessary open
kyori19 Dec 4, 2023
12d4c64
Merge pull request #421 from kyori19/use-submodules
gfngfn Dec 5, 2023
6bcd2f5
merge `dev-0-1-0` with conflicts fixed
gfngfn Apr 7, 2024
dd0c14f
merge `dev-0-1-0` with conflicts in the CI workflow fixed
gfngfn Jun 22, 2024
bbaea00
merge `dev-0-1-0` with a lot of conflicts fixed (probably midway)
gfngfn Aug 11, 2024
7ed6178
fix dependencies
gfngfn Aug 11, 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
Prev Previous commit
Next Next commit
migrate debug_* fields from OptionState to HandlePdf.config
  • Loading branch information
gfngfn committed Oct 29, 2023
commit 3a2cadc9d616d6bafd2202994ff4a58ceaa9400b
56 changes: 34 additions & 22 deletions src/backend/handlePdf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ open HorzBox
type t =
| PDF of Pdf.t * Pdfpage.t Alist.t * abs_path

type config = {
debug_show_bbox : bool;
debug_show_space : bool;
debug_show_block_bbox : bool;
debug_show_block_space : bool;
debug_show_overfull : bool;
}

type 'o op_funcs = {
config : config;
graphics : (intermediate_horz_box list) GraphicD.t -> (point -> intermediate_horz_box list -> 'o list) -> 'o list;
text : horz_string_info -> point -> OutputText.t -> 'o list;
math : math_string_info -> point -> OutputText.t -> 'o list;
Expand Down Expand Up @@ -39,7 +47,8 @@ let pdfops_of_image imgkey pt wid hgt =
GraphicD.pdfops_of_image pt xratio yratio tag


let fs_pdf = {
let fs_pdf (config : config) = {
config = config;
graphics = GraphicD.to_pdfops;
text = pdfops_of_text;
math = pdfops_of_math;
Expand Down Expand Up @@ -67,7 +76,7 @@ let warn_ratios (fs : 'o op_funcs) (pbinfo : page_break_info) pt hgt dpt (ratios
match ratios with
| TooLong{ required = wid_required; actual = wid_actual } ->
Logging.warn_overfull_line pageno;
if OptionState.does_debug_show_overfull () then
if fs.config.debug_show_overfull then
List.append
(fs.test_frame color_show_overfull pt wid_actual hgt dpt)
(fs.test_frame color_show_overfull pt wid_required hgt dpt)
Expand All @@ -76,7 +85,7 @@ let warn_ratios (fs : 'o op_funcs) (pbinfo : page_break_info) pt hgt dpt (ratios

| TooShort{ required = wid_required; actual = wid_actual } ->
Logging.warn_underfull_line pageno;
if OptionState.does_debug_show_overfull () then
if fs.config.debug_show_overfull then
List.append
(fs.test_frame color_show_overfull pt wid_actual hgt dpt)
(fs.test_frame color_show_overfull pt wid_required hgt dpt)
Expand All @@ -91,7 +100,7 @@ let warn_reachability (fs : 'o op_funcs) (pbinfo : page_break_info) pt hgt dpt (
match reach with
| Unreachable ->
Logging.warn_unreachable pbinfo.current_page_number;
if OptionState.does_debug_show_overfull () then
if fs.config.debug_show_overfull then
let wid = Length.of_pdf_point 2. in (* temporary *)
fs.test_frame color_show_unreachable pt wid hgt dpt
else
Expand All @@ -112,7 +121,7 @@ let rec ops_of_evaled_horz_box (fs : 'o op_funcs) (pbinfo : page_break_info) ypo
match evhbmain with
| EvHorzEmpty ->
let opaccnew =
if OptionState.does_debug_show_space () then
if fs.config.debug_show_space then
let opsgr = fs.test_box color_show_space (xpos, yposbaseline) wid (Length.of_pdf_point 2.) in
Alist.append opacc opsgr
else
Expand Down Expand Up @@ -143,7 +152,7 @@ let rec ops_of_evaled_horz_box (fs : 'o op_funcs) (pbinfo : page_break_info) ypo
let opsmain =
fs.text hsinfo (xpos, yposbaseline +% hsinfo.rising) otxt
in
if OptionState.does_debug_show_bbox () then
if fs.config.debug_show_bbox then
let opsgr = fs.test_frame color_show_bbox (xpos, yposbaseline) wid hgt dpt in
List.append opsgr opsmain
else
Expand All @@ -157,7 +166,7 @@ let rec ops_of_evaled_horz_box (fs : 'o op_funcs) (pbinfo : page_break_info) ypo
let opsmain =
fs.math msinfo (xpos, yposbaseline) otxt
in
if OptionState.does_debug_show_bbox () then
if fs.config.debug_show_bbox then
let opsgr = fs.test_frame color_show_bbox (xpos, yposbaseline) wid hgt dpt in
List.append opsgr opsmain
else
Expand All @@ -172,7 +181,7 @@ let rec ops_of_evaled_horz_box (fs : 'o op_funcs) (pbinfo : page_break_info) ypo
in
let opaccnew =
(*
if OptionState.does_debug_show_bbox () then
if fs.config.debug_show_bbox then
Alist.append opaccsub (GraphicD.pdfops_test_frame (xpos, yposbaseline) wid hgt dpt)
else
*)
Expand All @@ -193,7 +202,7 @@ let rec ops_of_evaled_horz_box (fs : 'o op_funcs) (pbinfo : page_break_info) ypo
let opsgr = pdfops_of_graphics fs pbinfo gr in
let opaccsub = Alist.append opacc opsgr in
let opaccnew =
if OptionState.does_debug_show_bbox () then
if fs.config.debug_show_bbox then
let opsgr = fs.test_frame color_show_bbox (xpos, yposbaseline) wid hgt dpt in
Alist.append opaccsub opsgr
else
Expand Down Expand Up @@ -297,7 +306,7 @@ and ops_of_evaled_vert_box_list (fs : 'o op_funcs) pbinfo (xinit, yinit) opaccin
match evvb with
| EvVertFixedEmpty(debug_margins, vskip) ->
let opacc =
if OptionState.does_debug_show_block_space () then
if fs.config.debug_show_block_space then
let ops =
match debug_margins with
| Fixed -> fs.test_skip_fixed color_show_skip pos vskip
Expand All @@ -321,7 +330,7 @@ and ops_of_evaled_vert_box_list (fs : 'o op_funcs) pbinfo (xinit, yinit) opaccin
evhblst @|> (xpos, opacc) @|> List.fold_left (ops_of_evaled_horz_box fs pbinfo yposbaseline)
in
let opaccend =
if OptionState.does_debug_show_block_bbox () then
if fs.config.debug_show_block_bbox then
let wid = xposlast -% xpos in
Alist.append opaccend (fs.test_frame color_show_block_bbox (xpos, yposbaseline) wid hgt dpt)
else
Expand Down Expand Up @@ -376,25 +385,26 @@ let get_paper_height (paper : Pdfpaper.t) : length =


let opacc_of_body_and_footnote
(config : config)
(txtlen : length) (* -- for option `--debug-show-block-bbox` -- *)
(pbinfo : page_break_info)
((ptbody, evvblstbody) : (length * length) * evaled_vert_box list)
((ptfootnote, evvblstfootnote) : (length * length) * evaled_vert_box list)
: Pdfops.t Alist.t =

let fs = fs_pdf config in
let opaccbody =
let (_, opaccbody) = ops_of_evaled_vert_box_list fs_pdf pbinfo ptbody Alist.empty evvblstbody in
if OptionState.does_debug_show_block_bbox () then
Alist.append opaccbody (fs_pdf.test_scale color_show_frame ptbody txtlen)
let (_, opaccbody) = ops_of_evaled_vert_box_list fs pbinfo ptbody Alist.empty evvblstbody in
if config.debug_show_block_bbox then
Alist.append opaccbody (fs.test_scale color_show_frame ptbody txtlen)
else
opaccbody
in
let opaccfootnote =
let (_, opaccfootnote) = ops_of_evaled_vert_box_list fs_pdf pbinfo ptfootnote Alist.empty evvblstfootnote in
if OptionState.does_debug_show_block_bbox () then
let (_, opaccfootnote) = ops_of_evaled_vert_box_list fs pbinfo ptfootnote Alist.empty evvblstfootnote in
if fs.config.debug_show_block_bbox then
let wid = Length.of_pdf_point 5. in
let len = Length.of_pdf_point 1. in
Alist.append opaccfootnote (fs_pdf.test_box color_show_frame ptfootnote wid len)
Alist.append opaccfootnote (fs.test_box color_show_frame ptfootnote wid len)
else
opaccfootnote
in
Expand Down Expand Up @@ -425,6 +435,7 @@ let make_empty_page


let add_column_to_page
(config : config)
(Page(paper, pagecontsch, opacc, pbinfo))
(origin_shift : length)
(evvblstbody : evaled_vert_box list)
Expand All @@ -449,25 +460,26 @@ let add_column_to_page
content_origin
evvblstfootnote
in
opacc_of_body_and_footnote content_height pbinfo
opacc_of_body_and_footnote config content_height pbinfo
(posbody, evvblstbody)
(posfootnote, evvblstfootnote)
in
Page(paper, pagecontsch, Alist.cat opacc opacccolumn, pbinfo)


let write_page (Page(paper, _pagecontsch, opaccpage, pbinfo) : page) (pagepartsf : page_parts_scheme_func) ((PDF(pdf, pageacc, flnm)) : t) : t =
let write_page (config : config) (Page(paper, _pagecontsch, opaccpage, pbinfo) : page) (pagepartsf : page_parts_scheme_func) ((PDF(pdf, pageacc, flnm)) : t) : t =

let fs = fs_pdf config in
let paper_height = get_paper_height paper in

let pagepartssch = pagepartsf pbinfo in (* -- invokes the page-parts function -- *)
let (evvblst_header, _) = pagepartssch.header_content |> PageInfo.embed_page_info_vert pbinfo in
let pt_header = invert_coordinate paper_height pagepartssch.header_origin in
let (_, opacc_header) = ops_of_evaled_vert_box_list fs_pdf pbinfo pt_header opaccpage evvblst_header in
let (_, opacc_header) = ops_of_evaled_vert_box_list fs pbinfo pt_header opaccpage evvblst_header in

let (evvblst_footer, _) = pagepartssch.footer_content |> PageInfo.embed_page_info_vert pbinfo in
let pt_footer = invert_coordinate paper_height pagepartssch.footer_origin in
let (_, opacc_footer) = ops_of_evaled_vert_box_list fs_pdf pbinfo pt_footer opacc_header evvblst_footer in
let (_, opacc_footer) = ops_of_evaled_vert_box_list fs pbinfo pt_footer opacc_header evvblst_footer in

let oplst = Alist.to_list opacc_footer in

Expand Down
12 changes: 10 additions & 2 deletions src/backend/handlePdf.mli
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ type t

val create_empty_pdf : abs_path -> t

type config = {
debug_show_bbox : bool;
debug_show_space : bool;
debug_show_block_bbox : bool;
debug_show_block_space : bool;
debug_show_overfull : bool;
}

type page

val write_page : page -> page_parts_scheme_func -> t -> t
val write_page : config -> page -> page_parts_scheme_func -> t -> t

val write_to_file : t -> unit

val make_empty_page : paper_size:(length * length) -> page_break_info -> page_content_scheme -> page

val add_column_to_page : page -> length -> evaled_vert_box list -> evaled_vert_box list -> page
val add_column_to_page : config -> page -> length -> evaled_vert_box list -> evaled_vert_box list -> page
16 changes: 0 additions & 16 deletions src/backend/optionState.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ open MyUtil
type build_state = {
input_file : abs_path;
output_file : abs_path option;
debug_show_bbox : bool;
debug_show_space : bool;
debug_show_block_bbox : bool;
debug_show_block_space : bool;
debug_show_overfull : bool;
type_check_only : bool;
}

Expand Down Expand Up @@ -42,12 +37,6 @@ let get () =
| Some(r) -> r


let get_build_state () =
match (get ()).command_state with
| BuildState(b) -> b
| _ -> assert false


let get_input_file () =
match (get ()).command_state with
| BuildState({ input_file; _ }) -> input_file
Expand All @@ -56,11 +45,6 @@ let get_input_file () =


let does_show_full_path () = (get ()).show_full_path
let does_debug_show_bbox () = (get_build_state ()).debug_show_bbox
let does_debug_show_space () = (get_build_state ()).debug_show_space
let does_debug_show_block_bbox () = (get_build_state ()).debug_show_block_bbox
let does_debug_show_block_space () = (get_build_state ()).debug_show_block_space
let does_debug_show_overfull () = (get_build_state ()).debug_show_overfull


let job_directory () =
Expand Down
10 changes: 0 additions & 10 deletions src/backend/optionState.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ open MyUtil
type build_state = {
input_file : abs_path;
output_file : abs_path option;
debug_show_bbox : bool;
debug_show_space : bool;
debug_show_block_bbox : bool;
debug_show_block_space : bool;
debug_show_overfull : bool;
type_check_only : bool;
}

Expand All @@ -33,10 +28,5 @@ val set : state -> unit
val get : unit -> state

val does_show_full_path : unit -> bool
val does_debug_show_bbox : unit -> bool
val does_debug_show_space : unit -> bool
val does_debug_show_block_bbox : unit -> bool
val does_debug_show_block_space : unit -> bool
val does_debug_show_overfull : unit -> bool

val job_directory : unit -> string
12 changes: 6 additions & 6 deletions src/backend/pageBreak.ml
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ let chop_single_column_with_insertion (pbinfo : page_break_info) (content_height
chop_single_column pbinfo content_height (List.append pbvblst_inserted pbvblst)


let main (absname_out : abs_path) ~(paper_size : length * length) (columnhookf : column_hook_func) (pagecontf : page_content_scheme_func) (pagepartsf : page_parts_scheme_func) (vblst : vert_box list) : HandlePdf.t =
let main (pdf_config : HandlePdf.config) (absname_out : abs_path) ~(paper_size : length * length) (columnhookf : column_hook_func) (pagecontf : page_content_scheme_func) (pagepartsf : page_parts_scheme_func) (vblst : vert_box list) : HandlePdf.t =

let pdfinit = HandlePdf.create_empty_pdf absname_out in

Expand All @@ -704,8 +704,8 @@ let main (absname_out : abs_path) ~(paper_size : length * length) (columnhookf :
chop_single_column_with_insertion pbinfo pagecontsch.page_content_height columnhookf pbvblst
in
let page = HandlePdf.make_empty_page ~paper_size pbinfo pagecontsch in
let page = HandlePdf.add_column_to_page page Length.zero evvblstpage footnote in
let pdfaccnew = pdfacc |> HandlePdf.write_page page pagepartsf in
let page = HandlePdf.add_column_to_page pdf_config page Length.zero evvblstpage footnote in
let pdfaccnew = pdfacc |> HandlePdf.write_page pdf_config page pagepartsf in
match restopt with
| None -> pdfaccnew
| Some(rest) -> aux (pageno + 1) pdfaccnew rest
Expand All @@ -714,7 +714,7 @@ let main (absname_out : abs_path) ~(paper_size : length * length) (columnhookf :
aux 1 pdfinit pbvblst


let main_multicolumn ~(page_number_limit : int) (absname_out : abs_path) ~(paper_size : length * length) (origin_shifts : length list) (columnhookf : column_hook_func) (columnendhookf : column_hook_func) (pagecontf : page_content_scheme_func) (pagepartsf : page_parts_scheme_func) (vblst : vert_box list) : HandlePdf.t =
let main_multicolumn (pdf_config : HandlePdf.config) ~(page_number_limit : int) (absname_out : abs_path) ~(paper_size : length * length) (origin_shifts : length list) (columnhookf : column_hook_func) (columnendhookf : column_hook_func) (pagecontf : page_content_scheme_func) (pagepartsf : page_parts_scheme_func) (vblst : vert_box list) : HandlePdf.t =

let pdfinit = HandlePdf.create_empty_pdf absname_out in

Expand All @@ -734,7 +734,7 @@ let main_multicolumn ~(page_number_limit : int) (absname_out : abs_path) ~(paper
in

(* Adds the column to the page and invokes hook functions. *)
let page = HandlePdf.add_column_to_page page origin_shift body footnote in
let page = HandlePdf.add_column_to_page pdf_config page origin_shift body footnote in
begin
match restopt with
| None ->
Expand All @@ -761,7 +761,7 @@ let main_multicolumn ~(page_number_limit : int) (absname_out : abs_path) ~(paper
(* Creates an empty page and iteratively adds columns to it. *)
let page = HandlePdf.make_empty_page ~paper_size pbinfo pagecontsch in
let (page, rest) = iter_on_column pbinfo content_height page pbvbs origin_shifts in
let pdfacc = pdfacc |> HandlePdf.write_page page pagepartsf in
let pdfacc = pdfacc |> HandlePdf.write_page pdf_config page pagepartsf in
match rest with
| [] -> pdfacc
| _ :: _ -> iter_on_page (pageno + 1) pdfacc rest
Expand Down
4 changes: 2 additions & 2 deletions src/backend/pageBreak.mli
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ exception PageNumberLimitExceeded of int

val solidify : vert_box list -> intermediate_vert_box list

val main : abs_path -> paper_size:(length * length) -> column_hook_func -> page_content_scheme_func -> page_parts_scheme_func -> vert_box list -> HandlePdf.t
val main : HandlePdf.config -> abs_path -> paper_size:(length * length) -> column_hook_func -> page_content_scheme_func -> page_parts_scheme_func -> vert_box list -> HandlePdf.t

val main_multicolumn : page_number_limit:int -> abs_path -> paper_size:(length * length) -> length list -> column_hook_func -> column_hook_func -> page_content_scheme_func -> page_parts_scheme_func -> vert_box list -> HandlePdf.t
val main_multicolumn : HandlePdf.config -> page_number_limit:int -> abs_path -> paper_size:(length * length) -> length list -> column_hook_func -> column_hook_func -> page_content_scheme_func -> page_parts_scheme_func -> vert_box list -> HandlePdf.t

val adjust_to_first_line : intermediate_vert_box list -> length * length

Expand Down
Loading
Loading