Skip to content

Instantly share code, notes, and snippets.

View eerohele's full-sized avatar

Eero Helenius eerohele

View GitHub Profile
@eerohele
eerohele / descendant.xml
Last active August 29, 2015 13:55
dita-ot/dita-ot #1086
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="descendant" xml:lang="en-us">
<title>Descendant</title>
<body>
<p>Hello, world!</p>
</body>
</topic>
@eerohele
eerohele / ditabase.dita
Created February 4, 2014 06:31
dita-ot/dita-ot #1089
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA 1.2 Composite//EN" "ditabase.dtd">
<dita>
<topic id="ditabase" xml:lang="en-us">
<title>DITA</title>
<body>
<fig>
@eerohele
eerohele / root.ditamap
Created February 11, 2014 22:26
dita-ot/dita-ot #1217
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="id-1217" title="dita-ot/dita-ot #1217">
<topicref href="topic1.dita"/>
<topicref href="topic2.dita" print="no"/>
<topicref href="topic3.dita"/>
<reltable>
@eerohele
eerohele / root.ditamap
Last active August 29, 2015 13:56
dita-ot/dita-ot #1646
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="id-1646" title="dita-ot/dita-ot #1646">
<topicref href="topic1.dita" navtitle="Autobots" keys="autobots"/>
<topicref href="topic2.dita" keys="decepticons">
<topicmeta>
<navtitle>Decepticons</navtitle>
@eerohele
eerohele / default.ditaval
Created March 5, 2014 08:26
dita-ot/dita-ot #1454
<?xml version="1.0" encoding="UTF-8"?>
<val>
<prop action="flag" att="audience" val="my-audience">
<startflag>
<alt-text>my-audience (</alt-text>
</startflag>
<endflag>
<alt-text>)</alt-text>
</endflag>
</prop>
@eerohele
eerohele / life.xml
Last active August 29, 2015 13:57
dita-ot/dita-ot #1103
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="universe" xml:lang="en-us">
<title>Life, the Universe and Everything</title>
<body>
<section id="everything">
<title>Douglas Adams</title>
@eerohele
eerohele / root.ditamap
Created April 4, 2014 18:30
dita-ot/dita-ot #1596
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="id-1596" title="dita-ot/dita-ot #1596">
<topicref href="topic1.dita"/>
<topicref href="topic2.dita"/>
</map>
@eerohele
eerohele / build.gradle
Last active August 29, 2015 14:05
A minimal Gradle buildfile for running a DITA-OT transformation
defaultTasks 'ditaOt'
def ditaHome = System.env.DITA_HOME
def antHome = System.env.ANT_HOME
task ditaOt << {
ant.java(classname: "org.apache.tools.ant.launch.Launcher", fork: "true", failonerror: "true") {
ant.jvmarg(value: "-Dant.library.dir=${antHome}/lib")
ant.classpath {
@eerohele
eerohele / dita.clj
Created November 20, 2014 15:21
An example of parsing a DITA file with clojure-saxon
(ns dita
(:require [saxon :as xml])
(:import (net.sf.saxon.trans XmlCatalogResolver)))
(def xmldoc (slurp "/path/to/ditamap"))
(. net.sf.saxon.trans.XmlCatalogResolver
(setCatalog "/path/to/dita-ot/src/main/catalog-dita.xml" (.getUnderlyingConfiguration xml/proc) true))
(def xdmnode (xml/compile-xml xmldoc))
@eerohele
eerohele / paredit.markdown
Last active August 29, 2015 14:15
paredit keymap for Sublime Text on OS X

Kill

    ⌘ + ⌦    Forward kill word
    ⌘ + ⌫    Backward kill word

Move