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.
wiki-map/README.md

73 lines
2.9 KiB

10 months ago
# 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.
10 months ago
* `--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:
9 months ago
1. `perl wiki-map.pl -o output/Map.svg --no-html --api https://vipersgate.obscuritus.ca/api.php`
10 months ago
Creates a main map as an SVG output/Map.svg
10 months ago
2. `perl wiki-map.pl -o output/Map.svg --no-html --regiondir output --api https://vipersgate.obscuritus.ca/api.php`
10 months ago
Creates a main map as an SVG output/Map.svg and an SVG for each region and location, also in the output dir
10 months ago
3. `perl wiki-map.pl -o output/Map.html --api https://vipersgate.obscuritus.ca/api.php`
10 months ago
Creates a main map with popups as output/Map.html
10 months ago
4. `perl wiki-map.pl -o output/Map.html --regiondir output --api https://vipersgate.obscuritus.ca/api.php`
10 months ago
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 <s>has</s>will have click-toggleable popups.
10 months ago
4 is an artifact of the above 3 and doesn't have intended use.
### Options
Options can be abbreviated per Getopt::Long
<dl>
<dt>--api-url:</dt><dd>Base URL of the wiki. Required.</dd>
10 months ago
</dl>
Template names. Defaults to MapRegion, MapSubregion, MapLocation, MapSite.
<dl>
<dt>--region-template-name</dt><dd></dd>
<dt>--subregion-template-name</dt><dd></dd>
<dt>--location-template-name</dt><dd></dd>
<dt>--site-template-name</dt><dd></dd>
</dl>
Formatting options.
The tiling module supports more overrides including per region/tile granularity.
These are not settable in the script but can be added if desired.
<dl>
<dt>--border-width</dt><dd>Width of the border between hexes. Defaults to 1.</dd>
<dt>--border-colour</dt><dd>Colour of the border between hexes. Defaults to black.</dd>
9 months ago
<dt>--show-coords</dt><dd>
10 months ago
Include coordinates in the image.
If included in the html document, a checkbox to toggle their visibility is added.
10 months ago
</dd>
</dl>
Output options. See above.
<dl>
<dt>--html-document</dt><dd></dd>
<dt>--outfile</dt><dd></dd>
<dt>--regiondir</dt><dd></dd>
</dl>
9 months ago
Miscellanious
<dl>
<dt>--embed-images</dt><dd>
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.
</dd>
</dl>