Ben Bass avatar Ben Bass committed 9de5986

add support for svg / inkscape

Comments (0)

Files changed (2)

Added
New image
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="New document 1">
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="375"
+     inkscape:cy="520"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="494"
+     inkscape:window-height="423"
+     inkscape:window-x="734"
+     inkscape:window-y="406"
+     inkscape:window-maximized="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1" />
+</svg>
         DIA_TEMPLATE_PATH=${EDITFILE_DIR}/_template/blank.dia
         [[ -s "$1" ]] || cp "$DIA_TEMPLATE_PATH" "$1" 2>/dev/null || die "No blank.dia in ${DIA_TEMPLATE_PATH}"
         EDIT="dia --nonew --nosplash"
+    elif [[ $TARGET_PATH =~ \.svg$ ]] ; then
+        # support svg with inkscape...
+        SVG_TEMPLATE_PATH=${EDITFILE_DIR}/_template/blank.svg
+        [[ -s "$1" ]] || cp "$SVG_TEMPLATE_PATH" "$1" 2>/dev/null || die "No blank.svg in ${SVG_TEMPLATE_PATH}"
+        EDIT="inkscape"
     elif [[ -n "${EDITOR}" ]] ; then
         EDIT=$EDITOR
     elif $(which gedit) ; then
 # Hopefully once an editor opens the user can see which
 # actual file got selected :-)
 # TODO: represent the list of supported file extensions somewhere.
-if ! [[ $TARGET_PATH =~ \.(rst|txt|md|mm|dia|doc|odt|docx|xls|ods|xlsx)$ ]] ; then
+if ! [[ $TARGET_PATH =~ \.(rst|txt|md|mm|dia|svg|doc|odt|docx|xls|ods|xlsx)$ ]] ; then
     for EXT in .rst .md .txt ; do
         [[ -f "${TARGET_PATH}${EXT}" ]] && break
     done
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.