From 5a1072f6d87546713fd9624499be7da139f1146e Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Sat, 15 Jul 2023 13:55:16 -0500 Subject: [PATCH] Add README --- README | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..93251f2 --- /dev/null +++ b/README @@ -0,0 +1,65 @@ +# 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 ` to write to a `` instead + +The script has 2 flags controlling files generated: + +* `--regiondir `: If specified, also generate maps for each region and location, + writing them to files in . 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: + +1. `perl wiki-tile.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 +2. `perl wiki-tile.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 dir +3. `perl wiki-tile.pl -o output/Map.html --api https://vipersgate.obscuritus.ca/api.php` + Creates a main map with popups as output/Map.html +4. `perl wiki-tile.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 ~has~will 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
+
+Template names. Defaults to MapRegion, MapSubregion, MapLocation, MapSite. +
+
--region-template-name
+
--subregion-template-name
+
--location-template-name
+
--site-template-name
+
+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. +
+
--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. + Eventual goal is to have them be toggleable in the HTML output mode. +
+
+Output options. See above. +
+
--html-document
+
--outfile
+
--regiondir
+