From 95f61aeaaa94c203ac45a6e0851d5384ad2d2b91 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 25 Mar 2012 05:52:32 +0000 Subject: Clean up author and seeAlso information. Remove download row from documentation header table and rename "History" section to "Releases" (which contains download links and is hopefully clear enough). --- lv2specgen/lv2specgen.py | 56 ++++++++++++++++-------------------------------- lv2specgen/template.html | 7 +++--- 2 files changed, 22 insertions(+), 41 deletions(-) (limited to 'lv2specgen') diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index d6a6495..f8784ae 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -851,26 +851,32 @@ def specAuthors(m, subject): maint.add(getLiteralString(getObject(j))) doc = '' + + devdoc = '' first = True for d in dev: if not first: - doc += ', ' - doc += '%s' % d + devdoc += ', ' + devdoc += '%s' % d first = False + if len(dev) == 1: + doc += 'Developer%s' % devdoc + elif len(dev) > 0: + doc += 'Developers%s' % devdoc + maintdoc = '' + first = True for m in maint: if not first: - doc += ', ' - doc += '%s' % m + maintdoc += ', ' + maintdoc += '%s' % m first = False + if len(maint) == 1: + doc += 'Maintainer%s' % maintdoc + elif len(maint) > 0: + doc += 'Maintainers%s' % maintdoc - n_authors = len(dev) + len(maint) - if n_authors == 0: - return '' - elif n_authors == 1: - return 'Author' + doc + '' - else: - return 'Authors' + doc + '' + return doc def specHistory(m, subject): @@ -1140,33 +1146,9 @@ def specgen(specloc, indir, style_uri, docdir, tags, instances=False, mode="spec template = template.replace('@REVISION@', version_string) - header_path = bundle_path + '/' + basename + '.h' - - releases = '' - if not experimental: - release_name = "lv2-" + basename - if basename == "lv2core": - release_name = "lv2core" - filename = '%s-%d.%d.tar.bz2' % (release_name, version[0], version[1]) - url = 'http://lv2plug.in/spec/%s' % filename - releases += '%s (sig),' % ( - url, filename, url) - if version[0] == 0: - releases += ' n/a (unreleased)' - else: - releases += ' other releases' - releases = 'Download%s' % releases - template = template.replace('@RELEASES@', releases) - other_files = '' - if os.path.exists(os.path.abspath(header_path)): - other_files += 'API documentation, ' % ( - basename + '_8h.html') - - header = basename + '.h' - other_files += '%s, ' % (header, header) - see_also_files = specProperties(m, spec_url, rdfs.seeAlso) + see_also_files.sort() for f in see_also_files: uri = str(f) if uri[:7] == 'file://': @@ -1216,7 +1198,7 @@ def getNamespaces(m): """Return a prefix:URI dictionary of all namespaces seen during parsing""" nspaces = {} for prefix, uri in m.namespaces(): - if not re.match('default[0-9]*', prefix): + if not re.match('default[0-9]*', prefix) and not prefix == 'xml': # Skip silly default namespaces added by rdflib nspaces[prefix] = uri return nspaces diff --git a/lv2specgen/template.html b/lv2specgen/template.html index a9d1ded..6d154da 100644 --- a/lv2specgen/template.html +++ b/lv2specgen/template.html @@ -23,7 +23,6 @@ - @RELEASES@
URI@URI@
Version@REVISION@
Prefixes@PREFIXES@
Discuss @MAIL@ @@ -40,7 +39,7 @@
  • Description
  • Index
  • Documentation
  • -
  • Version History
  • +
  • Releases
  • @@ -60,8 +59,8 @@ @REFERENCE@ - -

    Version History

    + +

    Releases

    @HISTORY@
    -- cgit v1.2.1