Skip to content

Commit

Permalink
Fix svgtiler API access within symbol files
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Jul 27, 2021
1 parent 1ea17ed commit 680e88b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "svgtiler",
"description": "Tool for drawing diagrams on a grid, combining grids of SVGs into a big SVG figure",
"version": "1.16.3",
"version": "1.16.4",
"repository": {
"type": "git",
"url": "git+https://github.com/edemaine/svgtiler.git"
Expand Down
15 changes: 8 additions & 7 deletions src/svgtiler.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ unless window?
XMLSerializer = xmldom.XMLSerializer
prettyXML = require 'prettify-xml'
graphemeSplitter = new require('grapheme-splitter')()
svgtiler = require '../package.json'
metadata = require '../package.json'
require 'coffeescript/register'
else
DOMParser = window.DOMParser # escape CoffeeScript scope
Expand Down Expand Up @@ -881,7 +881,7 @@ class Drawing extends Input
## LaTeX based loosely on Inkscape's PDF/EPS/PS + LaTeX output extension.
## See http://tug.ctan.org/tex-archive/info/svg-inkscape/
lines = ["""
%% Creator: svgtiler #{svgtiler.version}, https://github.com/edemaine/svgtiler
%% Creator: svgtiler #{metadata.version}, https://github.com/edemaine/svgtiler
%% This LaTeX file includes and overlays text on top of companion file
%% #{basename}.pdf/.png
%%
Expand Down Expand Up @@ -1199,7 +1199,7 @@ convertSVG = (format, svg, sync) ->

help = ->
console.log """
svgtiler #{svgtiler.version ? "(web)"}
svgtiler #{metadata.version ? "(web)"}
Usage: #{process.argv[1]} (...options and filenames...)
Documentation: https://github.com/edemaine/svgtiler
Expand Down Expand Up @@ -1317,18 +1317,19 @@ main = ->
console.log 'Not enough filename arguments'
help()

exports = {
svgtiler = {
Symbol, StaticSymbol, DynamicSymbol, unrecognizedSymbol,
Mapping, ASCIIMapping, JSMapping, CoffeeMapping,
Drawing, ASCIIDrawing, DSVDrawing, SSVDrawing, CSVDrawing, TSVDrawing,
Drawings, XLSXDrawings,
Style, CSSStyle, StylusStyle,
extensionMap, Input, Mappings, Context,
SVGTilerException, SVGNS, XLINKNS, escapeId,
main, convertSVG
main, convertSVG,
version: metadata.version
}
module?.exports = exports
window?.svgtiler = exports
module?.exports = svgtiler
window?.svgtiler = svgtiler

unless window?
main() if require?.main == module
Expand Down

0 comments on commit 680e88b

Please sign in to comment.