diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/index.php | 60 | ||||
-rw-r--r-- | doc/mainpage.dox | 24 | ||||
-rw-r--r-- | doc/style.css | 180 |
3 files changed, 264 insertions, 0 deletions
diff --git a/doc/index.php b/doc/index.php new file mode 100644 index 0000000..e6cdd10 --- /dev/null +++ b/doc/index.php @@ -0,0 +1,60 @@ +<?php +# Content-type negotiation for LV2 specification bundles + +$rdfxml = accepts("application\/rdf\+xml"); +$turtle = accepts("application\/turtle"); +$x_turtle = accepts("application\/x-turtle"); +$text_turtle = accepts("text\/turtle"); +$json = accepts("application\/json"); +$html = accepts("text\/html"); +$xhtml = accepts("application\/xhtml\+xml"); +$text_plain = accepts("text\/plain"); + +$name = basename($_SERVER['REQUEST_URI']); + +# Return Turtle ontology +if ($turtle or $x_turtle or $text_turtle) { + header("Content-Type: application/x-turtle"); + passthru("cat ./$name.ttl"); + +# Return ontology translated into rdf+xml +} else if ($rdfxml) { + header("Content-Type: application/rdf+xml"); + passthru("~/bin/rapper -q -i turtle -o rdfxml-abbrev ./$name.ttl"); + +} else if ($json) { + header("Content-Type: application/json"); + passthru("~/bin/rapper -q -i turtle -o json ./$name.ttl"); + +# Return HTML documentation +} else if ($html or $xhtml) { + if ($html) { + header("Content-Type: text/html"); + } else { + header("Content-Type: application/xhtml+xml"); + } + $name = basename($_SERVER['REQUEST_URI']); + passthru("cat ./$name.html | sed ' +s/<\/body>/<div style=\"font-size: smaller; color: gray; text-align: right; margin: 1ex;\">This document is content-negotiated. If you request it with <code>Accept: application\/x-turtle<\/code> you will get the description in Turtle. Also supported: <code>application\/rdf+xml<\/code>, <code>application\/json<\/code>, <code>text\/plain<\/code><\/div><\/body>/'"); + +# Return NTriples (text/plain) +} else if ($text_plain) { + header("Content-Type: text/plain"); + passthru("~/bin/rapper -q -i turtle -o ntriples ./$name.ttl"); + +# Return Turtle ontology by default +} else { + header("Content-Type: application/x-turtle"); + passthru("cat ./$name.ttl"); +} + +function accepts($type) { + global $_SERVER; + if (preg_match("/$type(;q=(\d+\.\d+))?/i", $_SERVER['HTTP_ACCEPT'], $matches)) { + return isset($matches[2]) ? $matches[2] : 1; + } else { + return 0; + } +} + +?> diff --git a/doc/mainpage.dox b/doc/mainpage.dox new file mode 100644 index 0000000..f8f0827 --- /dev/null +++ b/doc/mainpage.dox @@ -0,0 +1,24 @@ +/** @mainpage + * + * This is the documentation for the LV2 specification and its + * extensions hosted at http://lv2plug.in. + * + * An LV2 extension generally has two parts: the specification in + * <a href="http://www.w3.org/TeamSubmission/turtle/">Turtle</a> + * (e.g. ext.lv2/ext.ttl), and an accompanying + * <a href="http://en.wikipedia.org/wiki/C99">C</a> header (e.g. ext.lv2/ext.h). + * The header documentation is generated with <a href="http://doxygen.org"> + * Doxygen</a> and hyperlinked (in both directions) with the extension + * documentation generated from Turtle with + * <a href="http://drobilla.net/software/lv2specgen">lv2specgen</a>. + * + * \par Header Documentation + * \li <a href="annotated.html">Data Structures Index</a> + * \li <a href="files.html">Files Index</a> + * + * \par Extension Documentation + * \li <a href="../../lv2core">LV2 core documentation</a> + * \li <a href="../../ext">Extensions at lv2plug.in/ns/ext</a> + * \li <a href="../../extensions">Extensions at lv2plug.in/ns/extensions</a> + */ + diff --git a/doc/style.css b/doc/style.css new file mode 100644 index 0000000..de1ec1f --- /dev/null +++ b/doc/style.css @@ -0,0 +1,180 @@ +body { + color: black; + background: white; + margin: 0; +} + +:link { + color: #00C; + background: transparent; +} + +:visited { + color: #609; + background: transparent; +} + +a:active { + color: #C00; + background: transparent; +} + +h1, h2, h3, h4, h5, h6 { + text-align: left; +} + +h1, h2 { + background-color: #f2f2f2; + margin-top: 0; + color: #000; + border-bottom: 1px solid #cccccc; +} + +h1 { + padding: 1ex; + margin-bottom: 0; +} + +h2 { + border-bottom: 1px solid #b2c0dd; + padding: 0.5ex; +} + +h3, h4, h5, h6 { + padding: 0; + margin: 0 0 0.75ex 0; +} + +h2 { + margin: 3ex 0 1ex 0; +} + +ul, ol { + margin: 0 1ex 2ex 1ex; +} + +.content { + margin-left: 1.5em; + margin-right: 1.5em; +} + +.label { + font-style: italic; + margin: 1ex 0 1ex 0; + } + +.index { + margin-left: 1em; +} + +.restriction { + margin: 0.5ex 0 2ex 4ex; + background-color: #eee; + padding: 0.25ex; + border: 1px solid #ddd; +} + +.description { + margin-bottom: 2ex; +} + +.blankdesc { + background-color: #eee; + margin: 0.5em; + border: 1px solid #ddd; +} + +.blankterm { + padding-right: 0.5em; +} + +.specterm { + margin-top: 1ex; + padding: 1ex; + background-color: #fafafa; + border: 1px solid #ddd; +} + +.footer { + margin-top: 3ex; + padding: 1ex; + border-top: solid #4a6aaa 1px; + text-align: right; +} + +.footer-text { + font-size: small; + color: #2a3c61; + vertical-align: top; +} + +dl { + padding: 0; + margin: 0; +} + +dt { + font-weight: bold ; + margin-top: 0.75ex; +} + +hr { + color: silver; + background-color: silver; + height: 1px; + border: 0; + margin-top: 1.5ex; + margin-bottom: 1.5ex; +} + +div.head { + margin-bottom: 1em; +} + +div.head h1 { + margin-top: 2em; + clear: both; +} + +div.head table { + margin-left: 2em; + margin-top: 2em; +} + +th { + text-align: left; +} + +td { + padding-right: 2ex; +} + +.meta { + background-color: #f9fafc; + font-size: small; + margin: 0 0 2ex 0; + padding: 1ex 0 1ex 2ex; + border-bottom: 1px solid #c4cfe5; +} + +.metahead { + padding-right: 1ex; +} + +pre { + margin-left: 2em; + color: #373; +} + +code { + color: #373; +} + +@media aural { + dt { + pause-before: 20% + } + pre { + speak-punctuation: code + } +} |