Releases: edemaine/svgtiler
Releases · edemaine/svgtiler
v2.4.0
- Selective building (#70):
svgtiler
no longer builds everything; it now acts likemake
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 theirrequire
d 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.
- Use
- Support
require
/import
ing 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 viarequire(...).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 toContext
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 (whenrequire
/import
ing 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
- 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 runsvgink
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
toSVGTilerError
.
Full Changelog: v2.2.0...v2.3.0
v2.2.0
- .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
orimport
. - Reveals additional Node features (e.g.
module
global) - Enables a lot of other exciting features:
- Makes these files more interoperable when using them as mappings vs. via
- New support for
import
syntax as an alternative torequire
. - New ways to specify the mapping from a mapping file:
export default mapping
orexports.default = mapping
. You can still just write themapping
at the end of the file. require
d andimport
ed 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
viadata-*
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
- All settings can now be overridden in
xmldom
upgrade means that>
is now escaped as>
. 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
- 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
- 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 vianew Mapping(data)
wheredata
is an object or function. (Previously, you had to create anew Mapping
and then call theload
method.)- Document above subset of API as stable
v2.0.1
- Update xmldom, improving SVG output in edge cases, in particular addressing a security vulnerability
- Update Babel and xlsx
v2.0.0
- BREAKING CHANGE: Switch from
preserveAspectRatio="xMinYMin meet"
to defaultpreserveAspectRatio="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 addingDrawing.href
feature)
v1.17.0
- API improvements:
renderSVG*
no longer requires thestyles
argumentDrawing.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
tosetAttribute
; onlycreateElementNS
seems to be needed/preferred - Workarounds for
grapheme-splitter
(with imperfect Unicode handling),prettify-xml
(no prettification), and version number ((web)
)
- Switch from
v1.16.4
v1.16.3
- 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 manualwidth
/height
via--tw
/--th
options (as inexamples/tilt
).