PDV2SVG - CGI
This CGI 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.
Usage
Input Wiki source between {{plan de voies début}} and {{plan de voies fin}} in the box above, and click the "Convert" button. Then a new window opens and the SVG image is displayed, or, depending on your browser, a download dialog opens. Save the file with an appropriate name and ".svg" extension.
"Title" will be the title of SVG file.
Off-line version
If you can execute a perl script on your local machine, you can download and use the following off-line version. If you use this script very often, please use the off-line version because the bandwidth of this web site is limited. The off-line version has more features than the CGI version.
pdv2svg.zip
Bugs or Specifications
- All texts in the track diagram are ignored.
- If you convert a Wiki source that contains {{plan de voies partiel}} template, the corresponding image (and those correspond to following lines if you use rowspan) is moved from the proper position. To correct this, edit the SVG file manually as follows.
Move the part between <g> and </g> 5 colums right and 1 row up.
<!-- row 5 -->
<!-- This row is generated by "partial" template -->
<g transform="translate(5,-1)">
<use xlink:href="#M" x="6" y="4" width="2" height="2" />
<use xlink:href="#Q" x="8" y="4" width="2" height="2" />
<use xlink:href="#Q" x="9" y="4" width="2" height="2" />
<use xlink:href="#Q" x="10" y="4" width="2" height="2" />
<use xlink:href="#M" x="11" y="4" width="2" height="2" />
</g>
- There might be an error due to character codes. In such case, remove all non-ASCII characters from your source.
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.