aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/reference.doxygen.in2
-rw-r--r--doc/style.css112
-rw-r--r--lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl2
-rw-r--r--lv2/lv2plug.in/ns/extensions/ui/ui.h195
-rw-r--r--lv2/lv2plug.in/ns/extensions/ui/ui.ttl13
-rwxr-xr-xlv2specgen/lv2specgen.py66
-rw-r--r--lv2specgen/template.html37
-rw-r--r--wscript3
8 files changed, 236 insertions, 194 deletions
diff --git a/doc/reference.doxygen.in b/doc/reference.doxygen.in
index bff8a8a..940b848 100644
--- a/doc/reference.doxygen.in
+++ b/doc/reference.doxygen.in
@@ -1120,7 +1120,7 @@ HTML_COLORSTYLE_HUE = 160
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_COLORSTYLE_SAT = 60
+HTML_COLORSTYLE_SAT = 30
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
diff --git a/doc/style.css b/doc/style.css
index c7a6280..f5f37d5 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -25,7 +25,7 @@ img {
}
h1, h2, h3, h4, h5, h6 {
line-height: 1em;
- margin: 1em 0 0.5em 0;
+ margin: 0.75em 0 0.5em 0;
}
h1 {
font-size: 180%;
@@ -52,20 +52,55 @@ h6 {
font-weight: 450;
}
#header {
- background-color: #F3F3F3;
+ background-color: #F0F0F0;
border: 0;
- border-bottom: 1px solid #DDD;
- margin: 0 0 1em 0;
+ border-bottom: 1px solid #E8E8E8;
+ margin: 0;
padding: 1ex;
+ vertical-align: top;
+}
+#titlebox, #meta {
+ display: inline-block;
+}
+#titlebox{
+ display: inline-block;
+ width: 75%;
+ left: 0;
+ top: 0;
+}
+#meta{
+ display: inline-block;
+ position: absolute;
+ right: 0;
+ top: 0;
+ padding: 1ex;
+ margin: 0.5ex 0.25ex 0 0.5ex;
+ font-size: x-small;
+ border-style: hidden;
+}
+#meta tr, #meta th, #meta td {
+ border: 0;
+ font-weight: normal;
+}
+#meta th {
+ text-align: right;
+}
+#meta th:after {
+ content: ": ";
}
#title {
font-size: 200%;
font-weight: 700;
- margin: .25ex 0 .25ex 0;
+ margin: 0 0 .25ex 0;
padding: 0;
}
#subtitle {
- margin: 0 auto 2ex 0.5ex;
+ font-size: x-small;
+ margin-bottom: 1em;
+}
+#shortdesc {
+ font-size: small;
+ font-style: italic;
}
#logo {
height: 63px;
@@ -324,7 +359,7 @@ blockquote {
border-top: 1px solid #DDD;
}
#footer div {
- padding-top: 1em;
+ padding-top: 1em;
}
#searchbox a.reference, #searchbox span.reference {
@@ -336,10 +371,6 @@ blockquote {
text-decoration: none;
top: 2.9em;
}
-#content {
- font-size: 115%;
- min-height: 500px;
-}
#body-main .success p {
margin: 4px 8px;
}
@@ -371,9 +402,22 @@ ul, ol {
padding-top: 0;
margin: 0 0 0.5ex 0;
}
+#contents {
+ background-color: #F3F3F3;
+ border: 0;
+ border-bottom: 1px solid #EAEAEA;
+ padding: 0.25ex 0 0 0.5ex;
+ vertical-align: top;
+ font-size: small;
+}
+#contents li {
+ display: inline;
+ list-style-type: none;
+ margin-right: 1.25em;
+ padding: 0.25ex;
+}
.content {
- margin-left: 2em;
- margin-right: 2em;
+ margin: 0 2em 0 2em;
}
.label {
font-style: italic;
@@ -397,8 +441,8 @@ ul, ol {
padding-right: .5em;
}
.terminfo, .restriction {
- border-collapse: collapse;
- border-style: hidden;
+ border-collapse: collapse;
+ border-style: hidden;
}
.restriction {
margin: 0 0 0.5ex 0;
@@ -406,7 +450,7 @@ ul, ol {
vertical-align: text-top;
}
.restriction td {
- vertical-align: text-top;
+ vertical-align: text-top;
}
.terminfo th {
padding: 0 1ex 0 0;
@@ -456,27 +500,21 @@ div.head table {
margin-top: 2em;
}
table {
- border-collapse: collapse;
- border-style: hidden;
- margin: 0;
+ border-collapse: collapse;
+ border-style: hidden;
+ margin: 0;
+ border: 0;
}
th {
- vertical-align: text-top;
+ vertical-align: text-top;
}
td, th {
- border: 1px dashed #ccc;
- padding: 0.3ex 0.5em 0.3ex 0.5em;
-}
-#meta {
- margin: 1ex 0 0 0.5ex;
- font-size: small;
-}
-#meta tr th {
- padding-left: 0;
+ border: 1px dashed #ccc;
+ padding: 0.3ex 0.5em 0.3ex 0.5em;
}
pre {
- margin: 1em 1em 1em 4em;
- padding: 0;
+ margin: 1em 1em 1em 4em;
+ padding: 0;
}
code {
color: #373;
@@ -494,16 +532,16 @@ h1, h2, h3, h4, h5, h6, th {
text-align: left;
}
.error {
- color: red;
- font-weight: bold;
+ color: red;
+ font-weight: bold;
}
.warning {
- color: orange;
- font-weight: bold;
+ color: orange;
+ font-weight: bold;
}
.success {
- color: green;
- font-weight: bold;
+ color: green;
+ font-weight: bold;
}
/* Pygments Style */
diff --git a/lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl b/lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl
index 2abb648..24397c3 100644
--- a/lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl
+++ b/lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl
@@ -8,7 +8,7 @@
rdfs:seeAlso <../../meta/meta.ttl> ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 UI" ;
- doap:shortdesc "Generic UI interface for LV2 plugins." ;
+ doap:shortdesc "LV2 plugin UIs of any type." ;
doap:created "2006-00-00" ;
doap:developer <http://lv2plug.in/ns/meta#larsl> ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
diff --git a/lv2/lv2plug.in/ns/extensions/ui/ui.h b/lv2/lv2plug.in/ns/extensions/ui/ui.h
index e59e298..9eaa75c 100644
--- a/lv2/lv2plug.in/ns/extensions/ui/ui.h
+++ b/lv2/lv2plug.in/ns/extensions/ui/ui.h
@@ -1,6 +1,6 @@
/*
LV2 UI Extension
- Copyright 2009-2013 David Robillard <d@drobilla.net>
+ Copyright 2009-2014 David Robillard <d@drobilla.net>
Copyright 2006-2011 Lars Luthman <lars.luthman@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
@@ -17,8 +17,9 @@
*/
/**
- @file ui.h
- C header for the LV2 UI extension <http://lv2plug.in/ns/extensions/ui>.
+ @file ui.h User Interface API
+
+ For high-level documentation, see <http://lv2plug.in/ns/extensions/ui>.
*/
#ifndef LV2_UI_H
@@ -75,20 +76,16 @@ extern "C" {
typedef void* LV2UI_Widget;
/**
- A pointer to an instance of a UI.
+ A pointer to UI instance internals.
- It is valid to compare this to NULL (0 for C++) but otherwise the host MUST
- not attempt to interpret it. The UI plugin may use it to reference internal
- instance data.
+ The host may compare this to NULL, but otherwise MUST NOT interpret it.
*/
typedef void* LV2UI_Handle;
/**
A pointer to a controller provided by the host.
- It is valid to compare this to NULL (0 for C++) but otherwise the UI plugin
- MUST NOT attempt to interpret it. The host may use it to reference internal
- instance data.
+ The UI may compare this to NULL, but otherwise MUST NOT interpret it.
*/
typedef void* LV2UI_Controller;
@@ -98,22 +95,20 @@ typedef void* LV2UI_Controller;
typedef void* LV2UI_Feature_Handle;
/**
- The type of the host-provided function that the UI can use to
- send data to a plugin's input ports.
+ A host-provided function that sends data to a plugin's input ports.
- The @p buffer parameter must point to a block of data, @c buffer_size bytes
+ The @p buffer parameter must point to a block of data, @p buffer_size bytes
large. The format of this data and how the host should use it is defined by
the @p port_protocol. This buffer is owned by the UI and is only valid for
the duration of this call.
The @p port_protocol parameter should either be 0 or the URID for a
ui:PortProtocol. If it is 0, the protocol is implicitly ui:floatProtocol,
- the port must be an lv2:ControlPort input, @c buffer must point to a single
- float value, and @c buffer_size must be sizeof(float).
+ the port MUST be an lv2:ControlPort input, @p buffer MUST point to a single
+ float value, and @p buffer_size MUST be sizeof(float).
- The UI SHOULD NOT use a PortProtocol not supported by the host (i.e. one not
- passed by the host as a feature), but the host MUST gracefully ignore any
- port_protocol it does not understand.
+ The UI SHOULD NOT use a protocol not supported by the host, but the host
+ MUST gracefully ignore any protocol it does not understand.
*/
typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller,
uint32_t port_index,
@@ -122,7 +117,7 @@ typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller,
const void* buffer);
/**
- The implementation of a UI.
+ A plugin UI.
A pointer to an object of this type is returned by the lv2ui_descriptor()
function.
@@ -134,32 +129,29 @@ typedef struct _LV2UI_Descriptor {
const char* URI;
/**
- Create a new UI object and return a handle to it. This function works
- similarly to the instantiate() member in LV2_Descriptor.
+ Create a new UI and return a handle to it. This function works
+ similarly to LV2_Descriptor::instantiate().
- @param descriptor The descriptor for the UI that you want to instantiate.
+ @param descriptor The descriptor for the UI to instantiate.
@param plugin_uri The URI of the plugin that this UI will control.
- @param bundle_path The path to the bundle containing the RDF data file
- that references this shared object file, including the trailing '/'.
+ @param bundle_path The path to the bundle containing this UI, including
+ the trailing directory separator.
- @param write_function A function provided by the host that the UI can use
- to send data to the plugin's input ports.
+ @param write_function A function that the UI can use to send data to the
+ plugin's input ports.
- @param controller A handle for the plugin instance that should be passed
- as the first parameter of @p write_function.
+ @param controller A handle for the plugin instance to be passed as the
+ first parameter of UI methods.
- @param widget A pointer to an LV2UI_Widget. The UI will write a widget
- pointer to this location (what type of widget depends on the RDF class of
- the UI) that will be the main UI widget.
+ @param widget (output) widget pointer. The UI points this at its main
+ widget, which has the type defined by the UI type in the data file.
- @param features An array of LV2_Feature pointers. The host must pass all
- feature URIs that it and the UI supports and any additional data, just
- like in the LV2 plugin instantiate() function. Note that UI features and
- plugin features are NOT necessarily the same, they just share the same
- data structure - this will probably not be the same array as the one the
- plugin host passes to a plugin.
+ @param features An array of LV2_Feature pointers. The host must pass
+ all feature URIs that it and the UI supports and any additional data, as
+ in LV2_Descriptor::instantiate(). Note that UI features and plugin
+ features are not necessarily the same.
*/
LV2UI_Handle (*instantiate)(const struct _LV2UI_Descriptor* descriptor,
@@ -172,33 +164,29 @@ typedef struct _LV2UI_Descriptor {
/**
- Destroy the UI object and the associated widget. The host must not try
- to access the widget after calling this function.
+ Destroy the UI. The host must not try to access the widget after
+ calling this function.
*/
void (*cleanup)(LV2UI_Handle ui);
/**
Tell the UI that something interesting has happened at a plugin port.
- What is interesting and how it is written to the buffer passed to this
- function is defined by the @p format parameter, which has the same
- meaning as in LV2UI_Write_Function. The only exception is ports of the
- class lv2:ControlPort, for which this function should be called when the
- port value changes (it does not have to be called for every single change
- if the host's UI thread has problems keeping up with the thread the
- plugin is running in), @p buffer_size should be 4, the buffer should
- contain a single IEEE-754 float, and @p format should be 0.
-
- By default, the host should only call this function for input ports of
- the lv2:ControlPort class. However, this can be modified by using
- ui:portNotification in the UI data, or the ui:portSubscribe feature.
-
- The @p buffer is only valid during the time of this function call, so if
- the UI wants to keep it for later use it has to copy the contents to an
- internal buffer.
-
- This member may be set to NULL if the UI is not interested in any
- port events.
+ What is "interesting" and how it is written to @p buffer is defined by
+ @p format, which has the same meaning as in LV2UI_Write_Function().
+ Format 0 is a special case for lv2:ControlPort, where this function
+ should be called when the port value changes (but not necessarily for
+ every change), @p buffer_size must be sizeof(float), and @p buffer
+ points to a single IEEE-754 float.
+
+ By default, the host should only call this function for lv2:ControlPort
+ inputs. However, the UI can request updates for other ports statically
+ with ui:portNotification or dynamicaly with ui:portSubscribe.
+
+ The UI MUST NOT retain any reference to @p buffer after this function
+ returns, it is only valid for the duration of the call.
+
+ This member may be NULL if the UI is not interested in any port events.
*/
void (*port_event)(LV2UI_Handle ui,
uint32_t port_index,
@@ -207,22 +195,21 @@ typedef struct _LV2UI_Descriptor {
const void* buffer);
/**
- Return a data structure associated with an extension URI, for example
- a struct containing additional function pointers.
+ Return a data structure associated with an extension URI, typically an
+ interface struct with additional function pointers
- Avoid returning function pointers directly since standard C/C++ has no
- valid way of casting a void* to a function pointer. This member may be set
- to NULL if the UI is not interested in supporting any extensions. This is
- similar to the extension_data() member in LV2_Descriptor.
+ This member may be set to NULL if the UI is not interested in supporting
+ any extensions. This is similar to LV2_Descriptor::extension_data().
+
*/
const void* (*extension_data)(const char* uri);
} LV2UI_Descriptor;
/**
- UI Resize Feature (LV2_UI__resize)
+ Feature/interface for resizable UIs (LV2_UI__resize).
- This structure may be used in two ways: as a feature passed by the host via
- LV2UI_Descriptor::instantiate(), or as extension data provided by a UI via
+ This structure is used in two ways: as a feature passed by the host via
+ LV2UI_Descriptor::instantiate(), or as an interface provided by a UI via
LV2UI_Descriptor::extension_data()).
*/
typedef struct _LV2UI_Resize {
@@ -232,13 +219,13 @@ typedef struct _LV2UI_Resize {
LV2UI_Feature_Handle handle;
/**
- Request or advertise a size change.
+ Request/advertise a size change.
- When this struct is provided by the host, the UI may call this
- function to inform the host about the size of the UI.
+ When provided by the host, the UI may call this function to inform the
+ host about the size of the UI.
- When this struct is provided by the UI, the host may call this
- function to notify the UI that it should change its size accordingly.
+ When provided by the UI, the host may call this function to notify the
+ UI that it should change its size accordingly.
@return 0 on success.
*/
@@ -246,16 +233,15 @@ typedef struct _LV2UI_Resize {
} LV2UI_Resize;
/**
- Port Map Feature (LV2_UI__portMap).
+ Feature to map port symbols to UIs.
- This feature can be used by the UI to get the index for a port with the
- given symbol. This makes it possible to implement and distribute a UI
- separately from the plugin (since symbol is a guaranteed stable port
- identifier while index is not).
+ This can be used by the UI to get the index for a port with the given
+ symbol. This makes it possible to implement and distribute a UI separately
+ from the plugin (since symbol, unlike index, is a stable port identifier).
*/
typedef struct _LV2UI_Port_Map {
/**
- Pointer to opaque data which must be passed to ui_resize().
+ Pointer to opaque data which must be passed to port_index().
*/
LV2UI_Feature_Handle handle;
@@ -269,11 +255,12 @@ typedef struct _LV2UI_Port_Map {
} LV2UI_Port_Map;
/**
- Port subscription feature (LV2_UI__portSubscribe);
+ Feature to subscribe to port updates (LV2_UI__portSubscribe).
*/
typedef struct _LV2UI_Port_Subscribe {
/**
- Pointer to opaque data which must be passed to ui_resize().
+ Pointer to opaque data which must be passed to subscribe() and
+ unsubscribe().
*/
LV2UI_Feature_Handle handle;
@@ -319,7 +306,7 @@ typedef struct _LV2UI_Port_Subscribe {
} LV2UI_Port_Subscribe;
/**
- A feature to notify the host the user has grabbed a UI control.
+ A feature to notify the host that the user has grabbed a UI control.
*/
typedef struct _LV2UI_Touch {
/**
@@ -330,6 +317,9 @@ typedef struct _LV2UI_Touch {
/**
Notify the host that a control has been grabbed or released.
+ The host should cease automating the port or otherwise manipulating the
+ port value until the control has been ungrabbed.
+
@param handle The handle field of this struct.
@param port_index The index of the port associated with the control.
@param grabbed If true, the control has been grabbed, otherwise the
@@ -341,19 +331,23 @@ typedef struct _LV2UI_Touch {
} LV2UI_Touch;
/**
- UI Idle Feature (LV2_UI__idleInterface)
+ UI Idle Interface (LV2_UI__idleInterface)
- This feature is an addition to the UI API that provides a callback for the
- host to call rapidly, e.g. to drive the idle callback of a toolkit.
+ UIs can provide this interface to have an idle() callback called by the host
+ rapidly to update the UI.
*/
typedef struct _LV2UI_Idle_Interface {
/**
Run a single iteration of the UI's idle loop.
- This will be called "frequently" in the UI thread at a rate appropriate
- for a toolkit main loop. There are no precise timing guarantees.
+ This will be called rapidly in the UI thread at a rate appropriate
+ for a toolkit main loop. There are no precise timing guarantees, but
+ the host should attempt to call idle() at a high enough rate for smooth
+ animation, at least 30Hz.
- @return 0 on success, or anything else to stop being called.
+ @return non-zero if the UI has been closed, in which case the host
+ should stop calling idle(), and can either completely destroy the UI, or
+ re-show it and resume calling idle().
*/
int (*idle)(LV2UI_Handle ui);
} LV2UI_Idle_Interface;
@@ -361,11 +355,15 @@ typedef struct _LV2UI_Idle_Interface {
/**
UI Show Interface (LV2_UI__showInterface)
- UIs can use this interface to provide show/hide methods to pop up a window,
- which allows them to function in hosts unable to embed their widget type.
+ UIs can provide this interface to show and hide a window, which allows them
+ to function in hosts unable to embed their widget. This allows any UI to
+ provide a fallback for embedding that works in any host.
- If used, LV2UI_Idle_Interface should also be used to drive the UI. The UI
- should return non-zero from idle() when the window has been closed.
+ If used:
+ - The host MUST use LV2UI_Idle_Interface to drive the UI.
+ - The UI MUST return non-zero from LV2UI_Idle_Interface::idle() when it has been closed.
+ - If idle() returns non-zero, the host MUST call hide() and stop calling
+ idle(). It MAY later call show() then resume calling idle().
*/
typedef struct _LV2UI_Show_Interface {
/**
@@ -407,17 +405,10 @@ typedef struct _LV2UI_Peak_Data {
} LV2UI_Peak_Data;
/**
- A plugin UI programmer must include a function called "lv2ui_descriptor"
- with the following function prototype within the shared object file. This
- function will have C-style linkage (if you are using C++ this is taken care
- of by the 'extern "C"' clause at the top of the file). This function is
- loaded from the library by the UI host and called to get a
- LV2UI_Descriptor for the wanted plugin.
-
- Just like lv2_descriptor(), this function takes an index parameter. The
- index should only be used for enumeration and not as any sort of ID number -
- the host should just iterate from 0 and upwards until the function returns
- NULL or a descriptor with an URI matching the one the host is looking for.
+ Prototype for UI accessor function.
+
+ This is the entry point to a UI library, which works in the same way as
+ lv2_descriptor() but for UIs rather than plugins.
*/
LV2_SYMBOL_EXPORT
const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index);
diff --git a/lv2/lv2plug.in/ns/extensions/ui/ui.ttl b/lv2/lv2plug.in/ns/extensions/ui/ui.ttl
index c8aa10a..9fb19c9 100644
--- a/lv2/lv2plug.in/ns/extensions/ui/ui.ttl
+++ b/lv2/lv2plug.in/ns/extensions/ui/ui.ttl
@@ -11,10 +11,15 @@
rdfs:seeAlso <ui.h> ,
<lv2-ui.doap.ttl> ;
lv2:documentation """
-<p>This extension defines an interface that can be used in LV2 plugins and
-hosts to create UIs for plugins. The UIs are similar to plugins and reside in
-shared object files in an LV2 bundle. UIs are associated with a plugin in RDF
-using the triples:</p>
+
+<p>This extension is used to create User Interfaces (UIs) for LV2 plugins.</p>
+
+<p>UIs are implemented as an LV2UI_Descriptor loaded via lv2ui_descriptor() in
+a shared library, and are distributed in bundles just like plugins. See the <a
+href="../../../doc/html/ui_8h.html">API reference</a> for details on the C
+API.</p>
+
+<p>UIs are associated with plugins in data:</p>
<pre class="turtle-code">
@prefix ui: &lt;http://lv2plug.in/ns/extensions/ui#&gt; .
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index 3040049..1c4b93c 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -866,15 +866,23 @@ def specProperties(m, subject, predicate):
def specAuthors(m, subject):
"Return an HTML description of the authors of the spec."
+
+ subjects = [subject];
+ p = findOne(m, subject, lv2.project, None)
+ if p:
+ subjects += [getObject(p)]
+
dev = set()
- for i in findStatements(m, subject, doap.developer, None):
- for j in findStatements(m, getObject(i), foaf.name, None):
- dev.add(getLiteralString(getObject(j)))
+ for s in subjects:
+ for i in findStatements(m, s, doap.developer, None):
+ for j in findStatements(m, getObject(i), foaf.name, None):
+ dev.add(getLiteralString(getObject(j)))
maint = set()
- for i in findStatements(m, subject, doap.maintainer, None):
- for j in findStatements(m, getObject(i), foaf.name, None):
- maint.add(getLiteralString(getObject(j)))
+ for s in subjects:
+ for i in findStatements(m, s, doap.maintainer, None):
+ for j in findStatements(m, getObject(i), foaf.name, None):
+ maint.add(getLiteralString(getObject(j)))
doc = ''
@@ -1053,7 +1061,7 @@ def load_tags(path, docdir):
return linkmap
-def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, offline=False):
+def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False):
"""The meat and potatoes: Everything starts here."""
global spec_url
@@ -1086,14 +1094,21 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, offl
spec_url = getOntologyNS(m)
spec = rdflib.URIRef(spec_url)
- # Parse all seeAlso files in the bundle
- for uri in specProperties(m, spec, rdfs.seeAlso):
- if uri[:7] == 'file://':
- path = uri[7:]
- if (path != os.path.abspath(specloc)
- and path.endswith('.ttl')):
+ # Load all seeAlso files recursively
+ seeAlso = set()
+ done = False
+ while not done:
+ done = True
+ for uri in specProperties(m, spec, rdfs.seeAlso):
+ if uri[:7] == 'file://':
+ path = uri[7:]
+ if (path != os.path.abspath(specloc) and
+ path.endswith('ttl') and
+ path not in seeAlso):
+ seeAlso.add(path)
m.parse(path, format='n3')
-
+ done = False
+
spec_ns_str = spec_url
if (spec_ns_str[-1] != "/" and spec_ns_str[-1] != "#"):
spec_ns_str += "#"
@@ -1140,7 +1155,7 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, offl
termlist += docTerms('Instance', instalist, m, classlist, proplist, instalist)
template = template.replace('@NAME@', specProperty(m, spec, doap.name))
- template = template.replace('@SUBTITLE@', specProperty(m, spec, doap.shortdesc))
+ template = template.replace('@SHORT_DESC@', specProperty(m, spec, doap.shortdesc))
template = template.replace('@URI@', spec)
template = template.replace('@PREFIX@', spec_pre)
if spec_pre == 'lv2':
@@ -1175,7 +1190,7 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, offl
if date_string == "":
date_string = "Undated"
- version_string = "%s.%s (%s)" % (version[0], version[1], date_string)
+ version_string = "%s.%s" % (version[0], version[1])
experimental = (version[0] == 0 or version[1] % 2 == 1)
if experimental:
version_string += ' <span class="warning">EXPERIMENTAL</span>'
@@ -1183,7 +1198,7 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, offl
if isDeprecated(m, rdflib.URIRef(spec_url)):
version_string += ' <span class="warning">DEPRECATED</span>'
- template = template.replace('@REVISION@', version_string)
+ template = template.replace('@VERSION@', version_string)
file_list = ''
see_also_files = specProperties(m, spec, rdfs.seeAlso)
@@ -1197,24 +1212,16 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, offl
else:
continue # Skip seeAlso file outside bundle
-
- if offline:
- entry = uri
- else:
- entry = '<a href="%s">%s</a>' % (uri, uri)
+ entry = '<a href="%s">%s</a>' % (uri, uri)
if uri.endswith('.h') or uri.endswith('.hpp'):
name = os.path.basename(uri)
- entry += ' - <a href="%s">Documentation</a> ' % (
+ entry += ' <a href="%s">(docs)</a> ' % (
docdir + '/' + name.replace('.', '_8') + '.html')
file_list += '<li>%s</li>' % entry
- else:
+ elif not uri.endswith('.doap.ttl'):
file_list += '<li>%s</li>' % entry
- files = ''
- if file_list:
- files += '<li>Files<ul>%s</ul></li>' % file_list
-
- template = template.replace('@FILES@', files)
+ template = template.replace('@FILES@', file_list)
comment = getComment(m, rdflib.URIRef(spec_url), classlist, proplist, instalist)
if comment != '':
@@ -1222,6 +1229,7 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, offl
else:
template = template.replace('@COMMENT@', '')
+ template = template.replace('@DATE@', datetime.datetime.utcnow().strftime('%F'))
template = template.replace('@TIME@', datetime.datetime.utcnow().strftime('%F %H:%M UTC'))
return template
diff --git a/lv2specgen/template.html b/lv2specgen/template.html
index f2aaeee..d8b56c6 100644
--- a/lv2specgen/template.html
+++ b/lv2specgen/template.html
@@ -18,26 +18,27 @@
<!-- HEADER -->
<div id="header">
- <h1 id="title">@NAME@</h1>
- <span id="subtitle">@SUBTITLE@</span>
+ <div id="titlebox">
+ <h1 id="title">@NAME@</h1>
+ <div id="subtitle"><a href="@URI@">@URI@</a> @VERSION@</div>
+ <div id="shortdesc">@SHORT_DESC@</div>
+ </div>
<table id="meta">
- <tr><th>URI</th><td><a href="@URI@">@URI@</a></td></tr>
- <tr><th>Version</th><td>@REVISION@</td></tr>
- <tr><th>Prefixes</th><td>@PREFIXES@</td></tr>
+ <!--<tr><th>URI</th><td><a href="@URI@">@URI@</a></td></tr>
+ <tr><th>Version</th><td>@REVISION@</td></tr>-->
+ <!--<tr><th>Prefixes</th><td>@PREFIXES@</td></tr>-->
+ <tr><th>Date</th><td>@DATE@</td></tr>
@MAIL@
@AUTHORS@
</table>
</div>
-
- <h2 class="sec">Contents</h2>
- <div class="content">
- <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-releases">Releases</a></li>
- @FILES@
- </ul>
+ <ul id="contents">
+ <li><a href="#sec-description">Description</a></li>
+ <li><a href="#sec-index">Index</a></li>
+ <li><a href="#sec-reference">Reference</a></li>
+ <li><a href="#sec-history">History</a></li>
+ @FILES@
+ </ul>
</div>
<!-- DESCRIPTION -->
@@ -51,13 +52,13 @@
</div>
<!-- DOCUMENTATION -->
- <h2 class="sec" id="sec-documentation">Documentation</h2>
+ <h2 class="sec" id="sec-reference">Reference</h2>
<div class="content">
@REFERENCE@
</div>
- <!-- RELEASES -->
- <h2 class="sec" id="sec-releases">Releases</h2>
+ <!-- HISTORY -->
+ <h2 class="sec" id="sec-history">History</h2>
<div class="content">
@HISTORY@
</div>
diff --git a/wscript b/wscript
index eea1746..0c26870 100644
--- a/wscript
+++ b/wscript
@@ -175,8 +175,7 @@ def specgen(task):
TAGFILE,
{ 'list_email': 'devel@lists.lv2plug.in',
'list_page': 'http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in' },
- instances=True,
- offline=(not task.env.ONLINE_DOCS))
+ instances=True)
lv2specgen.save(task.outputs[0].abspath(), specdoc)