You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Daniel Asher Resnick
5c2c1c5afc
|
5 months ago | |
---|---|---|
HexGrid | 11 months ago | |
svg | 11 months ago | |
tests | 11 months ago | |
.gitignore | ||
HexGrid.pm | 11 months ago | |
MWTemplate.pm | 11 months ago | |
README.md | ||
coord_tripler.pl | 5 months ago | |
grid-tester.pl | 5 months ago | |
test-regions | 5 months ago | |
wiki-map.pl | 11 months ago |
README.md
Generate a map from specifications on a wiki
Prereqs
The Hexgrid modules and MWTemplate modules must be in @INC
Invoking
Writes to STDOUT by default; use -o/--outfile <file>
to write to a <file>
instead
The script has 2 flags controlling files generated:
--regiondir <dir>
: If specified, also generate maps for each region and location, writing them to files in<dir>
. Off by default.--html/--no-html
: Whether to generate (an) SVG file(s) or (an) html file(s), including logic for popups on clicks (currently half done). Makes html by default.
Examples of the four combinations:
perl wiki-map.pl -o output/Map.svg --no-html --api https://vipersgate.obscuritus.ca/api.php
Creates a main map as an SVG output/Map.svgperl wiki-map.pl -o output/Map.svg --no-html --regiondir output --api https://vipersgate.obscuritus.ca/api.php
Creates a main map as an SVG output/Map.svg and an SVG for each region and location, also in the output dirperl wiki-map.pl -o output/Map.html --api https://vipersgate.obscuritus.ca/api.php
Creates a main map with popups as output/Map.htmlperl wiki-map.pl -o output/Map.html --regiondir output --api https://vipersgate.obscuritus.ca/api.php
Creates a main map with popups as output/Map.html and an html page for each region and location, also in the output dir
1 is intented to make just a map for the main page. Unnecessary if using 2.
2 is intended to make a map for the main page, and for each Region, Subregion and Location page.
3 is intended to be linked to and haswill have click-toggleable popups.
4 is an artifact of the above 3 and doesn't have intended use.
Options
Options can be abbreviated per Getopt::Long
- --api-url:
- Base URL of the wiki. Required.
- --region-template-name
- --subregion-template-name
- --location-template-name
- --site-template-name
- --border-width
- Width of the border between hexes. Defaults to 1.
- --border-colour
- Colour of the border between hexes. Defaults to black.
- --show-coords
- Include coordinates in the image. If included in the html document, a checkbox to toggle their visibility is added.
- --html-document
- --outfile
- --regiondir
- --embed-images
- Whether or not to embed referenced images directly in the document(s), by fetching them from the wiki and base64 encoding them. Defaults to true.