Skip to content

Instantly share code, notes, and snippets.

View dwcramer's full-sized avatar

David Cramer dwcramer

  • Apple Inc.
  • Austin
View GitHub Profile
@dwcramer
dwcramer / pxp:nvdl output
Last active June 25, 2019 22:58
Output of pxp:nvdl with errors
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step version='1.0' name="main"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:pxp="http://exproc.org/proposed/steps"
xmlns:ex="http://xproc.org/ns/xproc/ex">
<!-- Always include this to ward off evil -->
<p:import href="http://xmlcalabash.com/extension/steps/library-1.0.xpl"/>
<p:input port="source">
@dwcramer
dwcramer / 1) Output
Last active April 17, 2018 20:11
Loading collection() from a second document provided on the input port to an xslt
dcramer@anatine-2 ~/Downloads/load-xinclude
$ /Applications/xmlcalabash-1.1.20-98/calabash -i ./book.xml load-xinclude.xpl
<wrapper xmlns:c="http://www.w3.org/ns/xproc-step"><loadme.xml><book xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>test</title>
<chapter version="5.0" xml:base="file:/Users/dcramer/Downloads/load-xinclude/chapter.xml">
<title>Chapter</title>
<para>Ipsum</para>
</chapter>
<glossary role="auto"/>
</book></loadme.xml><glossary.xml><glossary xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
@dwcramer
dwcramer / Oxygen-Error-Dialog.png
Last active January 16, 2018 15:36
Oxygen insert row bug
Oxygen-Error-Dialog.png
@dwcramer
dwcramer / load-xinclude.xpl
Last active November 17, 2017 21:33
Sample Pipeline to test Calabash's caching of loaded source (assumes a loadme.xml that contains a valid xi:include element)
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step"
version="1.0" name="main">
<p:input port="source">
<p:inline>
<doc>Hello world!</doc>
</p:inline>
</p:input>
<p:output port="result">
<p:pipe port="result" step="test"/>
@dwcramer
dwcramer / 1-Sample Output
Last active October 15, 2017 19:20
XProc Preprocessing Parameters Example
dcramer@Anatine ~
$ /Applications/xmlcalabash-1.1.16-97/calabash -pgen.summary.tables='0' -pfoo='' Documents/git-repos/xproc-param-example/pipeline.xpl
INFO : Documents/git-repos/xproc-param-example/library.xpl:49:42:
Incoming Parameters:
<c:param-set xmlns:c="http://www.w3.org/ns/xproc-step">
<c:param name="gen.summary.tables" namespace="" value="0"/>
<c:param name="foo" namespace="" value=""/>
</c:param-set>
@dwcramer
dwcramer / DeltaXML-table-fixes.xsl
Last active October 11, 2017 20:36
Fixup of DocBook CALS tables to make DeltaXML happy
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://docbook.org/ns/docbook"
xmlns:db="http://docbook.org/ns/docbook"
exclude-result-prefixes="xs db"
version="2.0">
<!--
DeltaXML is much better at diffing tables if the following things are true:
@dwcramer
dwcramer / dialog.png
Last active September 11, 2018 18:20
Nice oxygen dialog
dialog.png
@dwcramer
dwcramer / jenkins-slave.yml
Created October 9, 2015 18:35
Launch a Jenkins Slave on OpenStack
---
- hosts: localhost
user: "{{ linuxUser }}"
roles:
- role: launch_instance
cloud: openstack
node_name: jenkins-slave2.xbudev.org
flavor_id: 2ad22f89-86b5-43fd-bea5-7b89a7d9b6e6
network_id: 05706879-d518-4fe2-9113-627e514c23b5
attach_volume: false

Keybase proof

I hereby claim:

  • I am dwcramer on github.
  • I am dcramer (https://keybase.io/dcramer) on keybase.
  • I have a public key whose fingerprint is 0755 8849 F254 F737 A1D2 E13F C1DE 4971 BB69 F521

To claim this, I am signing this object:

#!/usr/bin/python
# Chunk a big markdown file into smaller files
# at the h2 level. Throw away anything above that.
# This assumes a 'well-formed' file. I.e. if you put an
# h1 below an h2, this happily sticks it in the file
# for it's parent h2.
# Name output files based on heading names, replacing
# spaces with - and adding ".html.md". No other bad characters