Skip to content

Releases: edemaine/svgtiler

v2.4.0

28 Jul 19:35
Compare
Choose a tag to compare
  • Selective building (#70): svgtiler no longer builds everything; it now acts like make and selectively builds what it detects needs rebuilding. .svg/.tex files will be recomputed only when they are older than the drawing file, any mapping file (or one of their required dependencies), or any style file; otherwise, you will see the message (SKIPPED). These files only get rewritten (and their date stamp changed) if their contents have actually changed; otherwise, you will see the message (UNCHANGED). This pairs well with the PDF/PNG conversion of v2.3.0, which only does Inkscape conversion when the SVG file is newer: if the SVG doesn't change, it will no longer trigger PDF/PNG conversion.
    • Use -f/--force to override and force all builds, like the old behavior.
  • Support require/importing raster images and SVG files from JavaScript/CoffeeScript mapping files (#73). Returns the SVG content as Preact Virtual DOM, making it easy to modify (e.g., strip off <svg> wrapper or add a child). Raw SVG string also available via require(...).svg.
  • New Chess example illustrating new require feature for loading and manipulating .svg files, dynamic symbol computation, and JSX notation for creating and composing symbols.
  • Provide new share global variable for sharing state between mapping files (#77). For example, this lets you define one mapping file whose behavior is controlled by options specified by one or more other mapping files. (See revised Mario example.)
  • Add match method to Context for simpler RegExp matching (previously documented by not implemented)
  • Omit SVG Tiler version number from generated .tex files, for consistent builds and version control across multiple users
  • Warn instead of crash when mapping returns string
  • Fix multiple xmlns:xlink attributes arising when embedding using .svg files directly inside tiles.
  • Fix removal of SVG/XML comment headers in .svg source files (when require/importing and for namespace mangling)
  • Remove examples directory from NPM package, reducing package size from 1.1 MB (135.6 kB compressed) to 184.9 kB (55.8 kB compressed), for faster installation.
  • Document -i/--inkscape option
  • Documentation now has table of contents for easier navigation

Full Changelog: v2.3.0...v2.4.0

v2.3.0

22 Jul 03:14
Compare
Choose a tag to compare
  • More efficient conversion of SVG files to PDF/PNG via a new spin-off project svgink. (#75)
  • You can now specify an .svg file (drawn with another tool) directly on the command line to just convert it to PDF/PNG. (Alternatively, you can run svgink directly.) (#75)
  • New command-line options -f/--force to force conversion.
  • Bug fix for Linux which prevented v2.2.0 from running.
  • API change: renamed SVGTilerException to SVGTilerError.

Full Changelog: v2.2.0...v2.3.0

v2.2.0

12 May 00:59
Compare
Choose a tag to compare
  • .js and .coffee mapping files are now loaded as NodeJS modules. (Previously, they were run as special functions.)
    • Makes these files more interoperable when using them as mappings vs. via require or import.
    • Reveals additional Node features (e.g. module global)
    • Enables a lot of other exciting features:
  • New support for import syntax as an alternative to require.
  • New ways to specify the mapping from a mapping file: export default mapping or exports.default = mapping. You can still just write the mapping at the end of the file.
  • required and imported modules can use JSX syntax, so you can share JSX code between mapping files. (#65)
  • Source maps are now fully supported, which means errors from your CoffeeScript mapping files will now have correct line numbers. (#56)
  • Command-line interface has new options for setting the output directory, helping you keep organized. (#58)
    • -o/--output sets an overall default output directory
    • -os/--output-svg, -op/--output-pdf, -oP/--output-png, -ot/--output-tex control output directory by file type
  • API changes to support a settings object instead of overriding class static attributes. (#47)
    • All settings can now be overridden in renderDOM via data-* attributes.
    • New defaultSettings exported object to modify defaults.
    • Replaces old undocumented renderDOMDefaults object.
    • Replaces old undocumented overrides: Drawing.inlineImages, Drawing.keepMargins, Drawing.useHref, Drawings.keepHidden, Symbol.svgEncoding, Symbol.forceWidth, Symbol.forceHeight, Symbol.texText, Symbol.overflowDefault
  • xmldom upgrade means that > is now escaped as &gt;. This can affect CSS output, but should make the resulting SVG easier to parse.

Full Changelog: v2.1.1...v2.2.0

v2.1.1

02 Apr 16:19
Compare
Choose a tag to compare
  • Fix support for DOS-formatted (\r\n newlines) and old Mac-formatted (\r newlines) .txt files

Full Changelog: v2.1.0...v2.1.1

v2.1.0

24 Aug 04:01
Compare
Choose a tag to compare
  • New renderDOM API feature for rendering DOM elements that contain drawings (e.g. ASCII art) directly into SVG (#64). See these slides for an example of usage.
  • Mapping API now supports direct construction of a mapping via new Mapping(data) where data is an object or function. (Previously, you had to create a new Mapping and then call the load method.)
  • Document above subset of API as stable

v2.0.1

20 Aug 14:57
Compare
Choose a tag to compare
  • Update xmldom, improving SVG output in edge cases, in particular addressing a security vulnerability
  • Update Babel and xlsx

v2.0.0

07 Aug 17:14
Compare
Choose a tag to compare
  • BREAKING CHANGE: Switch from preserveAspectRatio="xMinYMin meet" to default preserveAspectRatio="xMidyMid meet" (centering), which seems more useful especially in the context of slides. See preserveAspectRatio.
  • Fix href attribute in case of image embedding (broken in v1.17.0 when adding Drawing.href feature)

v1.17.0

05 Aug 00:49
Compare
Choose a tag to compare
  • API improvements:
    • renderSVG* no longer requires the styles argument
    • Drawing.useHref can be set to use <use href=...> (SVG 2) instead of <use xlink:href=...> (SVG 1.1). This behaves better when embedding directly into HTML.
  • Fix use of svgtiler on web (via <script> tag, no bundling)
    • Switch from setAttributeNS to setAttribute; only createElementNS seems to be needed/preferred
    • Workarounds for grapheme-splitter (with imperfect Unicode handling), prettify-xml (no prettification), and version number ((web))

v1.16.4

27 Jul 19:28
Compare
Choose a tag to compare
  • Fix svgtiler API access within symbol definition files (introduced in v1.16.3 when fixing exports)
  • Add support for svgtiler.version version number in API

v1.16.3

27 Jul 19:26
Compare
Choose a tag to compare
  • Update dependencies, including DoS security vulnerabilities in xlsx
  • Render Preact to string before duplicate detection, needed for latest Preact. You may need smaller SVG output files thanks to better duplicate detection.
  • Fix svgtiler not knowing its own version number (in .svg_tex files and command-line output)
  • Fix exports when using svgtiler.js in browser or in Node
  • Fix handling of symbol without viewBox and manual width/height via --tw/--th options (as in examples/tilt).