text-mapper
v0.1.10
Published
Render SVGs from TextMapper-conformant descriptions of hex maps
Downloads
17
Maintainers
Readme
text-mapper.js
A port of Alex Schroeder's TextMapper Perl implementation to TypeScript.
Usage
For the syntax of TextMapper files, see the examples in this repository, those generated by the original TextMapper and the help pages.
The API is minimal. The following should get you going:
import { parseFile, renderFile } from "text-mapper";
const map = parseFile("examples/gnomeyland-example.txt", ["resources"]);
renderFile(map, "out.svg")
Example output
Gnomeyland
Traveller
Status of the port
This TypeScript implementation currently only supports hex maps (the original also supports maps with a square grid). Most, but not all the syntax is supported. In particular, all syntax used by the "gnomeyland" and "traveller" examples is supported and renders identically in the TypeScript port and the original Perl implementation.
License
Like the original implementation, the code of this port is licensed under the GNU Affero General Public License version 3, or any later version (AGPL-3-or-later).
Exceptions:
resources/gnomeyland.txt
was created by Gregory B. MacKenzie and Alex Schroeder and is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license (CC-BY-SA-4.0).resources/apocalypse.txt
,resources/default.txt
andresources/traveller.txt
were created by Alex Schroeder and are licensed in the Public Domain, "No Rights Reserved" (CC0-1.0).