PDV2SVG - off line version

This perl script converts a Wiki source with {{plan de voies}} templates to an SVG image. For the detail of {{plan de voies}} templates, see [[Projet:Ferrovipédia/Plan_de_voies]] in French Wikipedia or [[Template:Å´Æ»ÇÛÀþ¿Þ/doc]] in Japanese Wikipedia. For updates of this script, see http://kiritachinoboru.tripod.com/pdv2svg_en.html.

You need Perl (version 5.8 or later) to use this script.

Files

Usage

Options

-a
Include definitions of all symbols.
-c CREATOR
Embed the creator information in the SVG file.
-d SYMBOL
Include definitions of specified symbol(s). To specify plural symbols, separate them with commas. Use -a or -d option to edit the SVG file manually after generating them.
-h
help.
-i FILE
Specify the source file. The default is the standard input (STDIN).
-o FILE
Specify the output file. The default is the standard output (STDIN).
-s SCALE
pixels per icons. The default is 30.
-t TITLE
title of the SVG file.
-v
verbose mode
-A
"abbreviation" mode (see below).
-C
color mode. Some icons (eg. platforms) are displayed with colors.

Examples

./pdv2svg -i Chatelet.txt -o Chatelet.svg -c Matsukaze -t "Gare de Chatelet - Les Halles"
Convert the rail track map described in Chatelet.txt to an SVG file named Chatelet.svg. The creator is Matsukaze, and the title is "Gare de Chatelet - Les Halles".
./pdv2svg -i Chatelet.txt -o Chatelet.svg -d "BV,T1" -s 50
Convert Chatelet.txt to Chatelet.svg, with definitions of symbols BV (station building) and T1 (portal of tunnel). The scale is 50px per icon.
./bs2svg -a -i /dev/null -o sample.svg
Generate a blank SVG file with definitions of all symbols. Use this to edit the SVG file manually.

Abbreviation mode

If you execute the script with -A option, each lines of the source are considered as elements of {{plan de voies}} templates. You can also use abbreviations of names of some icons as follows. For example, the following source generates the same SVG file as Chatelet.svg.
 ,|->|- |- |- |-.|- |- |- |- |->|- |- |- |- |- |->|' 
  |  |  |  |  |  |\ |  |Q |Q |Q |Q |Q |  |  |  |  |  
  |  |  |  |, |- |- |-`|- |- |->|- |- |- |-,|- |->|- 
- |->|-.|-'|- |- |- |-,|- |- |->|- |- |-'|- |-,|->|' 
  |  |  |\ |  |  |/ |  |Q |Q |Q |Q |Q |  |/ |  |  |  
  |  |  |  |.`|-'|- |- |- |- |<>|- |- |,'|  |  |  |  
  |  |  |/ |  |  |  |  |Q |Q |Q |Q |Q |  |\ |  |  |  
- |<-|-'| .|  |  |, |- |- |- |<-|- |- |-.|- |-`|<-|' 
  |  |  |  | `|-'|- |-,|- |- |<-|- |- |- |-`|- |<-|- 
  |  |  |  |  |  |/ |  |Q |Q |Q |Q |Q |  |  |  |  |  
, |<-|- |- |- |-'|- |- |- |- |<-|- |- |- |- |- |<-|' 

Licence

GPL version3 (original text) or version 2 (original text ).

Bugs or Specifications

Attention

If your Wiki source is not your own work and the arrangement of icons has enough originality, the SVG file may be considerd as a derivation of the original source and a subject of copyright. In such case, if you want to release the file (eg. upload to Wikimedia Commons), you must take an appropriate procedure required by the licence of the source (eg. GFDL).

Aknowledgements

This script uses icons (in public domain) made by Benji in French Wikipedia/Wikimedia Commons.