diff options
author | David Robillard <d@drobilla.net> | 2011-11-17 05:16:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-11-17 05:16:53 +0000 |
commit | a87331accdaec222af6fe84cac0c703e334e5a5f (patch) | |
tree | 3bfb12585abeb2ad7a95de3f88b94f84e4faacb1 | |
parent | 61fe9f27340e5aaea046db3d9c25507e3511fdd9 (diff) | |
download | lv2-a87331accdaec222af6fe84cac0c703e334e5a5f.tar.xz |
Add change log and release links to RDF.
Add "Version History" section to generated documentation.
Move doap metadata to separate file.
-rw-r--r-- | core.lv2/lv2-doap.ttl | 75 | ||||
-rw-r--r-- | core.lv2/lv2.ttl | 33 | ||||
-rw-r--r-- | core.lv2/manifest.ttl | 2 | ||||
-rwxr-xr-x | gendoc.py | 1 | ||||
-rwxr-xr-x | lv2specgen/lv2specgen.py | 67 | ||||
-rw-r--r-- | lv2specgen/template.html | 19 |
6 files changed, 163 insertions, 34 deletions
diff --git a/core.lv2/lv2-doap.ttl b/core.lv2/lv2-doap.ttl new file mode 100644 index 0000000..34b60dc --- /dev/null +++ b/core.lv2/lv2-doap.ttl @@ -0,0 +1,75 @@ +@prefix dcs: <http://ontologi.es/doap-changeset#> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix foaf: <http://xmlns.com/foaf/0.1/> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<http://lv2plug.in/ns/lv2core> + a doap:Project ; + doap:license <http://opensource.org/licenses/isc> ; + doap:name "LV2" ; + doap:homepage <http://lv2plug.in> ; + doap:created "2004-04-21" ; + doap:shortdesc "An audio plugin interface specification" ; + doap:programming-language "C" ; + doap:release [ + doap:revision "4.0" ; + doap:created "2011-03-18" ; + doap:file-release <http://lv2plug.in/spec/lv2core-4.0.tar.bz2> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Make doap:license suggested, but not required (for wrappers)." + ] , [ + rdfs:label "Define lv2:binary (MUST be in manifest.ttl)." + ] , [ + rdfs:label "Define lv2:majorVersion and lv2:minorVersion (MUST be in manifest.ttl)." + ] , [ + rdfs:label "Define lv2:documentation and use it to document lv2core." + ] , [ + rdfs:label "Add lv2:FunctionPlugin and lv2:ConstantPlugin classes." + ] , [ + rdfs:label "Move lv2:AmplifierPlugin under lv2:DynamicsPlugin." + ] , [ + rdfs:label "Loosen domain of lv2:optionalFeature and lv2:requiredFeature (to allow re-use in extensions)." + ] , [ + rdfs:label "Add generic lv2:Resource and lv2:PluginBase classes." + ] , [ + rdfs:label "Fix definition of lv2:minimum etc. (used for values, not scale points)." + ] , [ + rdfs:label "More precisely define properties with OWL." + ] , [ + rdfs:label "Move project metadata to manifest." + ] , [ + rdfs:label "Add lv2:enumeration port property." + ] , [ + rdfs:label "Define run() pre-roll special case (sample_count == 0)." + ] + ] + ] , [ + doap:revision "3.0" ; + doap:created "2008-11-08" ; + doap:file-release <http://lv2plug.in/spec/lv2core-3.0.tar.bz2> ; + dcs:changeset [ + dcs:item [ + rdfs:label "Require that serialisations refer to ports by symbol rather than index." + ] , [ + rdfs:label "Minor stylistic changes to lv2.ttl." + ] , [ + rdfs:label "No header changes." + ] + ] + ] , [ + doap:revision "2.0" ; + doap:created "2008-02-10" ; + doap:file-release <http://lv2plug.in/spec/lv2core-2.0.tar.gz> ; + ] ; + doap:maintainer [ + a foaf:Person ; + foaf:name "Steve Harris" ; + foaf:homepage <http://plugin.org.uk/> ; + rdfs:seeAlso <http://plugin.org.uk/swh.xrdf> + ] , [ + a foaf:Person ; + foaf:name "David Robillard" ; + foaf:homepage <http://drobilla.net/> ; + rdfs:seeAlso <http://drobilla.net/drobilla.rdf> + ] . diff --git a/core.lv2/lv2.ttl b/core.lv2/lv2.ttl index 798d9fd..0ab56c5 100644 --- a/core.lv2/lv2.ttl +++ b/core.lv2/lv2.ttl @@ -16,7 +16,6 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. @prefix doap: <http://usefulinc.com/ns/doap#> . -@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix lv2: <http://lv2plug.in/ns/lv2core#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @@ -59,33 +58,9 @@ devices). See <a href="http://www.w3.org/TR/xhtml-basic/#s_xhtmlmodules" """ . <http://lv2plug.in/ns/lv2core> - a lv2:Specification , owl:Ontology , doap:Project ; - owl:imports <http://purl.org/az/foaf.owl> , - <http://lv2plug.in/ns/doap.owl> ; - doap:license <http://opensource.org/licenses/isc> ; - doap:name "LV2" ; - doap:homepage <http://lv2plug.in> ; - doap:created "2004-04-21" ; - doap:shortdesc "An audio plugin interface specification" ; - doap:programming-language "C" ; - doap:release [ - doap:revision "4.0" ; - doap:created "2011-03-18" - ] ; - doap:maintainer [ - a foaf:Person ; - foaf:name "Steve Harris" ; - foaf:homepage <http://plugin.org.uk/> ; - rdfs:seeAlso <http://plugin.org.uk/swh.xrdf> - ] , [ - a foaf:Person ; - foaf:name "David Robillard" ; - foaf:homepage <http://drobilla.net/> ; - rdfs:seeAlso <http://drobilla.net/drobilla.rdf> - ] ; - lv2:documentation """ -<h4>Overview</h4> - + a owl:Ontology ; + owl:imports <http://lv2plug.in/ns/doap.owl> ; + lv2:documentation """ <p>LV2 is an interface for writing audio processors, or <q>plugins</q>, in C/C++ which can be dynamically loaded into many applications, or <q>hosts</q>. This <q>core</q> specification is simple and minimal, but is designed so that @@ -125,7 +100,7 @@ which are fixed and valid for the duration of the call to <code>run()</code>. Thus the <q>control rate</q> is determined by the block size, which is controlled by the host (and not necessarily constant).</p> -<h4>Threading Rules</h4> +<h3>Threading Rules</h3> <p>To faciliate use in multi-threaded programs, LV2 functions are partitioned into several threading classes:</p> diff --git a/core.lv2/manifest.ttl b/core.lv2/manifest.ttl index 08ed8d1..f9418d2 100644 --- a/core.lv2/manifest.ttl +++ b/core.lv2/manifest.ttl @@ -7,4 +7,4 @@ a doap:Project , lv2:Specification , owl:Ontology ; lv2:minorVersion 4 ; lv2:microVersion 1 ; - rdfs:seeAlso <lv2.ttl> . + rdfs:seeAlso <lv2.ttl> , <lv2-doap.ttl> .
\ No newline at end of file @@ -93,6 +93,7 @@ lv2_outdir = os.path.join(out_base, 'lv2core') os.mkdir(lv2_outdir) shutil.copy('core.lv2/lv2.h', lv2_outdir) shutil.copy('core.lv2/lv2.ttl', lv2_outdir) +shutil.copy('core.lv2/lv2-doap.ttl', lv2_outdir) shutil.copy('core.lv2/manifest.ttl', lv2_outdir) oldcwd = os.getcwd() diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index eb60e7c..f04a329 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -90,7 +90,8 @@ ns_list = { "http://www.w3.org/2003/01/geo/wgs84_pos#" : "geo", "http://www.w3.org/2004/02/skos/core#" : "skos", "http://lv2plug.in/ns/lv2core#" : "lv2", - "http://usefulinc.com/ns/doap#" : "doap" + "http://usefulinc.com/ns/doap#" : "doap", + "http://ontologi.es/doap-changeset#" : "dcs" } rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') @@ -98,6 +99,7 @@ rdfs = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#') owl = rdflib.Namespace('http://www.w3.org/2002/07/owl#') lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#') doap = rdflib.Namespace('http://usefulinc.com/ns/doap#') +dcs = rdflib.Namespace('http://ontologi.es/doap-changeset#') foaf = rdflib.Namespace('http://xmlns.com/foaf/0.1/') @@ -864,6 +866,55 @@ def specAuthors(m, subject): return '<tr><th class="metahead">Authors</th><td>' + doc + '</td></tr>' +def specHistory(m, subject): + entries = {} + for r in findStatements(m, None, doap.release, None): + release = getObject(r) + revNode = findOne(m, release, doap.revision, None) + if not revNode: + print "error: doap:release has no doap:revision" + continue + + rev = getLiteralString(getObject(revNode)) + + created = findOne(m, release, doap.created, None) + if not created: + print "error: doap:release has no doap:created" + continue + + dist = findOne(m, release, doap['file-release'], None) + if dist: + entry = '<dt><a href="%s">Version %s</a>' % (getObject(dist), rev) + else: + entry = '<dt>Version %s' % rev + #print "warning: doap:release has no doap:file-release" + + entry += ' (%s)</dt>' % ( + getLiteralString(getObject(created))) + + changeset = findOne(m, release, dcs.changeset, None) + if changeset: + entry += '<dd><ul>' + for i in findStatements(m, getObject(changeset), dcs.item, None): + item = getObject(i) + label = findOne(m, item, rdfs.label, None) + if not label: + print "error: dcs:item has no rdfs:label" + continue + + entry += '<li>%s</li>' % getLiteralString(getObject(label)) + + entry += '</dd>\n' + + entries[rev] = entry + + history = '<dl>' + for e in sorted(entries.keys(), reverse=True): + history += entries[e] + history += '</dl>' + return history + + def specVersion(m, subject): """ Return a (minorVersion, microVersion, date) tuple @@ -948,8 +999,19 @@ def specgen(specloc, indir, docdir, style_uri, doc_base, doclinks, instances=Fal m.parse(manifest_path, format='n3') m.parse(specloc, format='n3') + bundle_path = os.path.split(specloc[specloc.find(':') + 1:])[0] + abs_bundle_path = os.path.abspath(bundle_path) spec_url = getOntologyNS(m) + # Parse all seeAlso files in the bundle + for uri in specProperties(m, spec_url, rdfs.seeAlso): + if uri[:7] == 'file://': + path = uri[7:] + if (path.startswith(abs_bundle_path) + and path != os.path.abspath(specloc) + and path.endswith('.ttl')): + m.parse(path, format='n3') + spec_ns_str = spec_url if (spec_ns_str[-1] != "/" and spec_ns_str[-1] != "#"): spec_ns_str += "#" @@ -1012,6 +1074,7 @@ def specgen(specloc, indir, docdir, style_uri, doc_base, doclinks, instances=Fal template = template.replace('@FILENAME@', filename) template = template.replace('@HEADER@', basename + '.h') template = template.replace('@MAIL@', 'devel@lists.lv2plug.in') + template = template.replace('@HISTORY@', specHistory(m, spec_url)) version = specVersion(m, spec_url) # (minor, micro, date) date_string = version[2] @@ -1028,7 +1091,6 @@ def specgen(specloc, indir, docdir, style_uri, doc_base, doclinks, instances=Fal template = template.replace('@REVISION@', version_string) - bundle_path = os.path.split(specloc[specloc.find(':') + 1:])[0] header_path = bundle_path + '/' + basename + '.h' other_files = '' @@ -1045,7 +1107,6 @@ def specgen(specloc, indir, docdir, style_uri, doc_base, doclinks, instances=Fal header = basename + '.h' other_files += ', <a href="%s">%s</a>' % (header, header) - abs_bundle_path = os.path.abspath(bundle_path) see_also_files = specProperties(m, spec_url, rdfs.seeAlso) for f in see_also_files: uri = str(f) diff --git a/lv2specgen/template.html b/lv2specgen/template.html index 8906e6f..6065af6 100644 --- a/lv2specgen/template.html +++ b/lv2specgen/template.html @@ -32,8 +32,19 @@ @FILES@ </table> </div> - + + <div class="content"> + <h3>Contents</h3> + <ul> + <li><a href="#sec-description">Description</a></li> + <li><a href="#sec-index">Index</a></li> + <li><a href="#sec-documentation">Documentation</a></li> + <li><a href="#sec-history">Version History</a></li> + </ul> + </div> + <!-- DESCRIPTION --> + <h2 class="sec" id="sec-description">Description</h2> <div class="content">@COMMENT@</div> <!-- INDEX --> @@ -48,6 +59,12 @@ @REFERENCE@ </div> + <!-- HISTORY --> + <h2 class="sec" id="sec-history">Version History</h2> + <div class="content"> + @HISTORY@ + </div> + <!-- FOOTER --> <div id="footer"> <div> |