Skip to content

Commit

Permalink
--maketile option for custom Maketiles (#99)
Browse files Browse the repository at this point in the history
Also fix glob spec to match first Maketile, not last
  • Loading branch information
edemaine committed Oct 16, 2022
1 parent fb2ecd4 commit 0b358e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ The top-level code of your .js or .coffee mapping file can also call:
side effects (in particular, reading or writing to the `share` object
for communication with other mapping files), it's important to wrap that code
in `svgtiler.onInit`, so that SVG Tiler can correctly limit and restore
these side effects in the presense of parentheses on the command line.
these side effects in the presence of parentheses on the command line.
* `svgtiler.preprocess(callback)` to schedule calling `callback(render)`
when preparing to rendering each drawing, e.g.,
to initialize drawing-specific data or globally examine the drawing.
Expand Down Expand Up @@ -854,6 +854,7 @@ Optional arguments:
--ot DIR / --output-tex DIR Write all .svg_tex files to directory DIR
-i PATH / --inkscape PATH Specify PATH to Inkscape binary
-j N / --jobs N Run up to N Inkscape jobs in parallel
--maketile GLOB Custom Maketile file or glob pattern
-s KEY=VALUE / --share KEY=VALUE Set share.KEY to VALUE (undefined if no =)
-m / --margin Don't delete blank extreme rows/columns
--uneven Don't make all rows have same length by padding with ''
Expand Down
6 changes: 5 additions & 1 deletion src/svgtiler.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2313,6 +2313,7 @@ Optional arguments:
--ot DIR / --output-tex DIR Write all .svg_tex files to directory DIR
-i PATH / --inkscape PATH Specify PATH to Inkscape binary
-j N / --jobs N Run up to N Inkscape jobs in parallel
--maketile GLOB Custom Maketile file or glob pattern
-s KEY=VALUE / --share KEY=VALUE Set share.KEY to VALUE (undefined if no =)
-m / --margin Don't delete blank extreme rows/columns
--uneven Don't make all rows have same length by padding with ''
Expand Down Expand Up @@ -2419,7 +2420,7 @@ class Driver extends HasSettings
filenames = glob @settings.maketile, nodir: true
@maketile =
if filenames.length
inputRequire filenames.sort().pop(), @settings
inputRequire filenames.sort()[0], @settings
else
null
addInit: (input) ->
Expand Down Expand Up @@ -2546,6 +2547,9 @@ class Driver extends HasSettings
when '-i', '--inkscape'
i++
@settings.inkscape = args[i]
when '--maketile'
i++
@settings.maketile = args[i]
when '-p', '--pdf'
@settings.formats.push 'pdf'
when '-P', '--png'
Expand Down

0 comments on commit 0b358e8

Please sign in to comment.