aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen
diff options
context:
space:
mode:
Diffstat (limited to 'lv2specgen')
-rw-r--r--lv2specgen/DTD/xhtml-rdfa-1.dtd1
-rwxr-xr-xlv2specgen/lv2docgen.py17
-rwxr-xr-xlv2specgen/lv2specgen.py114
-rw-r--r--lv2specgen/meson.build7
-rw-r--r--lv2specgen/template.html9
5 files changed, 15 insertions, 133 deletions
diff --git a/lv2specgen/DTD/xhtml-rdfa-1.dtd b/lv2specgen/DTD/xhtml-rdfa-1.dtd
index bd3479e..53890bb 100644
--- a/lv2specgen/DTD/xhtml-rdfa-1.dtd
+++ b/lv2specgen/DTD/xhtml-rdfa-1.dtd
@@ -444,7 +444,6 @@
validation, so here we are.
-->
-<!ATTLIST html xmlns:dcs CDATA #IMPLIED>
<!ATTLIST html xmlns:dcterms CDATA #IMPLIED>
<!ATTLIST html xmlns:doap CDATA #IMPLIED>
<!ATTLIST html xmlns:foaf CDATA #IMPLIED>
diff --git a/lv2specgen/lv2docgen.py b/lv2specgen/lv2docgen.py
index c5e13a7..9b1685a 100755
--- a/lv2specgen/lv2docgen.py
+++ b/lv2specgen/lv2docgen.py
@@ -1,20 +1,7 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-#
-# lv2docgen, a documentation generator for LV2 plugins
+
# Copyright 2012 David Robillard <d@drobilla.net>
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# SPDX-License-Identifier: ISC
import errno
import os
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index 3345b5a..d6e86f8 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -1,34 +1,13 @@
#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
#
-# lv2specgen, a documentation generator for LV2 specifications.
-# Copyright (c) 2009-2014 David Robillard <d@drobilla.net>
+# Copyright 2009-2022 David Robillard <d@drobilla.net>
+# Copyright 2003-2008 Christopher Schmidt <crschmidt@crschmidt.net>
+# Copyright 2005-2008 Uldis Bojars <uldis.bojars@deri.org>
+# Copyright 2007-2008 Sergio Fernández <sergio.fernandez@fundacionctic.org>
+# SPDX-License-Identifier: MIT
#
# Based on SpecGen:
# <http://forge.morfeo-project.org/wiki_en/index.php/SpecGen>
-# Copyright (c) 2003-2008 Christopher Schmidt <crschmidt@crschmidt.net>
-# Copyright (c) 2005-2008 Uldis Bojars <uldis.bojars@deri.org>
-# Copyright (c) 2007-2008 Sergio Fernández <sergio.fernandez@fundacionctic.org>
-#
-# This software is licensed under the terms of the MIT License.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
import datetime
import markdown
@@ -86,7 +65,6 @@ spec_pre = None
spec_bundle = None
specgendir = None
ns_list = {
- "http://ontologi.es/doap-changeset#": "dcs",
"http://purl.org/dc/terms/": "dcterms",
"http://usefulinc.com/ns/doap#": "doap",
"http://xmlns.com/foaf/0.1/": "foaf",
@@ -101,7 +79,6 @@ 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/")
@@ -134,15 +111,15 @@ def getLiteralString(s):
def isResource(n):
- return type(n) == rdflib.URIRef
+ return isinstance(n, rdflib.URIRef)
def isBlank(n):
- return type(n) == rdflib.BNode
+ return isinstance(n, rdflib.BNode)
def isLiteral(n):
- return type(n) == rdflib.Literal
+ return isinstance(n, rdflib.Literal)
def niceName(uri):
@@ -1040,79 +1017,6 @@ def specAuthors(m, subject):
return doc
-def releaseChangeset(m, release, prefix=""):
- changeset = findOne(m, release, dcs.changeset, None)
- if changeset is None:
- return ""
-
- entry = ""
- # entry = '<dd><ul>\n'
- for i in sorted(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
-
- text = getLiteralString(getObject(label))
- if prefix:
- text = prefix + ": " + text
-
- entry += "<li>%s</li>\n" % text
-
- # entry += '</ul></dd>\n'
- return entry
-
-
-def specHistoryEntries(m, subject, entries):
- for r in findStatements(m, subject, 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)
-
- 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")
-
- if created:
- entry += " (%s)</dt>\n" % getLiteralString(getObject(created))
- else:
- entry += ' (<span class="warning">EXPERIMENTAL</span>)</dt>'
-
- entry += "<dd><ul>\n%s" % releaseChangeset(m, release)
-
- if dist is not None:
- entries[(getObject(created), getObject(dist))] = entry
- elif int(rev.split(".")[-1]) % 2 == 0:
- print("warning: %s %s has no file-release" % (subject, rev))
-
- return entries
-
-
-def specHistoryMarkup(entries):
- if len(entries) > 0:
- history = "<dl>\n"
- for e in sorted(entries.keys(), reverse=True):
- history += entries[e] + "</ul></dd>"
- history += "</dl>\n"
- return history
- else:
- return ""
-
-
-def specHistory(m, subject):
- return specHistoryMarkup(specHistoryEntries(m, subject, {}))
-
-
def specVersion(m, subject):
"""
Return a (minorVersion, microVersion, date) tuple
@@ -1208,7 +1112,6 @@ def load_tags(path, docdir):
and cn.tagName == "compound"
and cn.getAttribute("kind") != "page"
):
-
name = getChildText(cn, "name")
filename = getChildText(cn, "filename")
anchor = getChildText(cn, "anchor")
@@ -1383,7 +1286,6 @@ def specgen(
template = template.replace("@REFERENCE@", termlist)
template = template.replace("@FILENAME@", filename)
template = template.replace("@HEADER@", basename + ".h")
- template = template.replace("@HISTORY@", specHistory(m, spec))
mail_row = ""
if "list_email" in opts:
diff --git a/lv2specgen/meson.build b/lv2specgen/meson.build
index 9ecb8d4..69b029b 100644
--- a/lv2specgen/meson.build
+++ b/lv2specgen/meson.build
@@ -1,5 +1,5 @@
# Copyright 2022 David Robillard <d@drobilla.net>
-# SPDX-License-Identifier: CC0-1.0 OR ISC
+# SPDX-License-Identifier: 0BSD OR ISC
lv2specgen_py = files('lv2specgen.py')
@@ -10,11 +10,14 @@ lv2specgen_command_prefix = [
lv2specgen_py,
'--list-email=' + lv2_list_email,
'--list-page=' + lv2_list_page,
+ '--style-dir=' + lv2_source_root / 'doc' / 'style',
+ '--template',
+ files('template.html'),
]
if is_variable('lv2_tags')
lv2specgen_command_prefix += [
- '--tags', lv2_tags.full_path(), # TODO: Remove full_path() in meson 0.60.0
+ ['--tags', lv2_tags.full_path()], # TODO: Remove full_path() in meson 0.60.0
]
endif
diff --git a/lv2specgen/template.html b/lv2specgen/template.html
index 4eb3d96..dcc2759 100644
--- a/lv2specgen/template.html
+++ b/lv2specgen/template.html
@@ -2,7 +2,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html about="@URI@"
xmlns="http://www.w3.org/1999/xhtml"
- xmlns:dcs="http://ontologi.es/doap-changeset#"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:doap="http://usefulinc.com/ns/doap#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
@@ -30,7 +29,6 @@
<table id="meta">
<tr><th>ID</th><td><a href="@URI@">@URI@</a></td></tr>
<tr><th>Version</th><td>@VERSION@</td></tr>
- <tr><th>Date</th><td>@DATE@</td></tr>
@MAIL@
@AUTHORS@
</table>
@@ -44,7 +42,6 @@
<ul id="contents">
<!-- <li><a href="#sec-description">Description</a></li> -->
<li><a href="#sec-index">Index</a></li>
- <li><a href="#sec-history">History</a></li>
@CONTENT_LINKS@
</ul>
</div>
@@ -63,12 +60,6 @@
@REFERENCE@
</div>
- <!-- HISTORY -->
- <h2 id="sec-history">History</h2>
- <div class="section">
- @HISTORY@
- </div>
-
<!-- FOOTER -->
<div id="footer">
<div>