Skip to content

gbrlpzz/liminal-substack-map-inline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Liminal Substack Map Inline

A specialized utility to generate ultra-horizontal, minimalist vector locator maps tailored for substack publications and articles. It uses local GeoJSON boundaries of Italy and compiles high-resolution inline graphics with smooth edge-fading and regional inset keymaps.

Features

  • Substack-Ready Palette: Tailored to sit beautifully on standard cream substack backplates (Background: #FDFCF1, vector outline color: #5D5A37).
  • Aspect Ratio: Designed for an ultra-horizontal single cropped layout ($24:9$ ratio, rendering at high-res $4800 \times 1800$ pixels).
  • Edge Fading: Linear gradients at the top and bottom edges ($150\text{px}$ fade zones) to blend the map seamlessly into the surrounding article body.
  • Floating Inset Keymap: A borderless, clean keymap of Italy placed in the top-left corner that automatically highlights the target region.
  • GeoJSON Caching: Automatically downloads and caches click-that-hood's Italy regions GeoJSON locally for offline, zero-network generation.
  • Headless Chrome Rendering: Compiles HTML/SVG templates and leverages your system's headless Google Chrome to snap crisp PNG outputs.

Installation

Prerequisites

  1. Python 3.x
  2. Google Chrome (default location /Applications/Google Chrome.app/Contents/MacOS/Google Chrome on macOS, or customizable via CLI)

No external Python dependencies are required (uses standard libraries).


Usage

1. Generating from Presets

The tool contains preconfigured coordinates for three location locators:

  • monti_prenestini_locator (Lazio)
  • pettorano_sul_gizio_locator (Abruzzo)
  • fontainemore_locator (Valle d'Aosta)

Generate them using the --preset argument:

./generate.py --preset monti_prenestini_locator
./generate.py --preset pettorano_sul_gizio_locator
./generate.py --preset fontainemore_locator

2. Generating a Custom Map

You can specify custom coordinates, highlight region, and layout settings using CLI options:

./generate.py \
  --lat 45.6467 \
  --lon 7.8594 \
  --region "Valle d'Aosta/Vallée d'Aoste" \
  --name custom_map \
  --fade-height 150 \
  --keymap-y 95 \
  --keymap-height 170

Options

Option Description
--preset Load predefined map configurations from presets.json
--lat Latitude of target location marker
--lon Longitude of target location marker
--region Italy region name to highlight in keymap/main map (e.g., Lazio)
--name Base file name of generated outputs
--ref-lat Latitude of a secondary reference point (e.g. Rome coordinates)
--ref-lon Longitude of a secondary reference point
--fade-height Height in pixels of top/bottom gradients (default: 150)
--keymap-y Inset keymap Y placement on viewBox canvas (default: 95)
--keymap-height Inset keymap vertical scale height (default: 170)
--output-dir Folder to save the output files (default: .)
--chrome Path to Google Chrome binary (default: macOS default path)

Presets Config (presets.json)

You can view and modify presets in the presets.json file:

{
  "monti_prenestini_locator": {
    "lat": 41.87,
    "lon": 12.90,
    "region": "Lazio",
    "ref_lat": 41.902783,
    "ref_lon": 12.496366
  }
}

Output Files

For each execution, the script generates:

  1. A target SVG-embedded HTML web-view template ([name].html).
  2. A high-resolution PNG render screenshot ([name].png).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages