From 4acfb4730957f814a36ed66421409e73775de6d8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 6 Sep 2012 01:25:53 +0000 Subject: Make documentation suitable for local installation. --- doc/header.html | 24 ++++++++++++++++++++++++ doc/mainpage.dox | 4 ++-- doc/reference.doxygen.in | 5 +++-- lv2specgen/lv2specgen.py | 25 ++++++++++++------------- lv2specgen/template.html | 2 +- waf | Bin 93483 -> 72017 bytes wscript | 40 +++++++++++++++++++++++++++++++--------- 7 files changed, 73 insertions(+), 27 deletions(-) create mode 100644 doc/header.html diff --git a/doc/header.html b/doc/header.html new file mode 100644 index 0000000..6ff2e60 --- /dev/null +++ b/doc/header.html @@ -0,0 +1,24 @@ + + + + +LV2: File List + + + + +
+
+ + + + + + +
+
LV2 +  1.0.13 +
+
+
+ diff --git a/doc/mainpage.dox b/doc/mainpage.dox index 078f67d..920ef1d 100644 --- a/doc/mainpage.dox +++ b/doc/mainpage.dox @@ -1,7 +1,7 @@ /** @mainpage * * This is the documentation for the LV2 specification and its - * extensions hosted at http://lv2plug.in. + * official extensions. * * An LV2 extension generally has two parts: the specification in * Turtle @@ -12,7 +12,7 @@ * documentation generated from Turtle with * lv2specgen. * - * \li LV2 Specifications + * \li LV2 Specifications * \li Data Structures * \li Headers */ diff --git a/doc/reference.doxygen.in b/doc/reference.doxygen.in index 88fe7ea..718a74c 100644 --- a/doc/reference.doxygen.in +++ b/doc/reference.doxygen.in @@ -666,6 +666,7 @@ INPUT = @LV2_SRCDIR@/doc/mainpage.dox \ lv2/lv2plug.in/ns/ext/event/event.h \ lv2/lv2plug.in/ns/ext/instance-access/instance-access.h \ lv2/lv2plug.in/ns/ext/log/log.h \ + lv2/lv2plug.in/ns/ext/midi/midi.h \ lv2/lv2plug.in/ns/ext/morph/morph.h \ lv2/lv2plug.in/ns/ext/options/options.h \ lv2/lv2plug.in/ns/ext/patch/patch.h \ @@ -906,7 +907,7 @@ HTML_FILE_EXTENSION = .html # have to redo this when upgrading to a newer version of doxygen or when # changing the value of configuration settings such as GENERATE_TREEVIEW! -HTML_HEADER = +HTML_HEADER = @LV2_SRCDIR@/doc/header.html # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a @@ -1730,7 +1731,7 @@ GRAPHICAL_HIERARCHY = YES # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. -DIRECTORY_GRAPH = YES +DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are svg, png, jpg, or gif. diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 9974265..28a84db 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -1037,7 +1037,7 @@ def load_tags(path, docdir): return linkmap -def specgen(specloc, indir, style_uri, docdir, tags, instances=False, mode="spec"): +def specgen(specloc, indir, style_uri, docdir, tags, instances=False, offline=False): """The meat and potatoes: Everything starts here.""" global spec_url @@ -1159,9 +1159,7 @@ def specgen(specloc, indir, style_uri, docdir, tags, instances=False, mode="spec template = template.replace('@REVISION@', version_string) - - header_files = '' - other_files = '' + file_list = '' see_also_files = specProperties(m, spec, rdfs.seeAlso) see_also_files.sort() for f in see_also_files: @@ -1173,21 +1171,22 @@ def specgen(specloc, indir, style_uri, docdir, tags, instances=False, mode="spec else: continue # Skip seeAlso file outside bundle - - entry = '%s' % (uri, uri) + + if offline: + entry = uri + else: + entry = '%s' % (uri, uri) if uri.endswith('.h') or uri.endswith('.hpp'): name = os.path.basename(uri) - entry += ' (Documentation) ' % ( + entry += ' - Documentation ' % ( docdir + '/' + name.replace('.', '_8') + '.html') - header_files += '
  • %s
  • ' % entry + file_list += '
  • %s
  • ' % entry else: - other_files += '
  • %s
  • ' % entry + file_list += '
  • %s
  • ' % entry files = '' - if header_files: - files += '
  • API
      %s
  • ' % header_files - if other_files: - files += '
  • Data
      %s
  • ' % other_files + if file_list: + files += '
  • Files
      %s
  • ' % file_list template = template.replace('@FILES@', files) diff --git a/lv2specgen/template.html b/lv2specgen/template.html index 4544323..691f6fd 100644 --- a/lv2specgen/template.html +++ b/lv2specgen/template.html @@ -84,7 +84,7 @@ href="http://jigsaw.w3.org/css-validator/check/referer"> CSS - generated on @TIME@ from @FILENAME@ by lv2specgen + generated from @FILENAME@ by lv2specgen
    diff --git a/waf b/waf index d4671db..02c8093 100755 Binary files a/waf and b/waf differ diff --git a/wscript b/wscript index f287e3b..937d3f5 100644 --- a/wscript +++ b/wscript @@ -25,6 +25,8 @@ def options(opt): autowaf.set_options(opt) opt.add_option('--test', action='store_true', dest='build_tests', help='Build unit tests') + opt.add_option('--online-docs', action='store_true', dest='online_docs', + help='Build documentation for web hosting') opt.add_option('--no-plugins', action='store_true', dest='no_plugins', help='Do not build example plugins') opt.add_option('--copy-headers', action='store_true', dest='copy_headers', @@ -41,6 +43,9 @@ def configure(conf): autowaf.configure(conf) autowaf.set_c99_mode(conf) + if Options.options.online_docs and Options.options.docs: + conf.fatal('At most one of --online-docs and --docs may be given') + if Options.platform == 'win32' or not hasattr(os.path, 'relpath'): Logs.warn('System does not support linking headers, copying') Options.options.copy_headers = True @@ -48,6 +53,7 @@ def configure(conf): conf.env.BUILD_TESTS = Options.options.build_tests conf.env.BUILD_PLUGINS = not Options.options.no_plugins conf.env.COPY_HEADERS = Options.options.copy_headers + conf.env.ONLINE_DOCS = Options.options.online_docs # Check for gcov library (for test coverage) if conf.env.BUILD_TESTS and not conf.is_defined('HAVE_GCOV'): @@ -156,13 +162,17 @@ def specgen(task): os.path.relpath(STYLEPATH, bundle), os.path.relpath('build/doc/html', bundle), TAGFILE, - instances=True) + instances=True, + offline=(not task.env.ONLINE_DOCS)) lv2specgen.save(task.outputs[0].abspath(), specdoc) # Name (comment is to act as a sort key) + target = path[len('lv2/lv2plug.in/ns/'):] + if not task.env.ONLINE_DOCS: + target += '/%s.html' % b row = '%s' % ( - b, path[len('lv2/lv2plug.in/ns/'):], b) + b, target, b) # Description if shortdesc: @@ -300,7 +310,7 @@ def build(bld): if bld.env.DOCS: # Build Doxygen documentation (and tags file) - autowaf.build_dox(bld, 'LV2', VERSION, top, out) + autowaf.build_dox(bld, 'LV2', VERSION, top, out, 'lv2plug.in/doc') # Copy stylesheet to build directory bld(features = 'subst', @@ -326,12 +336,13 @@ def build(bld): name = os.path.basename(i.srcpath()) # Generate .htaccess file - bld(features = 'subst', - source = 'doc/htaccess.in', - target = os.path.join(base, '.htaccess'), - install_path = None, - NAME = name, - BASE = base) + if bld.env.ONLINE_DOCS: + bld(features = 'subst', + source = 'doc/htaccess.in', + target = os.path.join(base, '.htaccess'), + install_path = None, + NAME = name, + BASE = base) # Call lv2specgen for each spec for i in specs: @@ -348,6 +359,12 @@ def build(bld): target = ['%s/%s.html' % (chop_lv2_prefix(i.srcpath()), name), index_file]) + # Install documentation + if not bld.env.ONLINE_DOCS: + base = chop_lv2_prefix(i.srcpath()) + bld.install_files('${DOCDIR}/' + i.srcpath(), + bld.path.get_bld().ant_glob(base + '/*.html')) + index_files.sort() bld.add_group() # Barrier (wait for lv2specgen to build index) @@ -357,6 +374,11 @@ def build(bld): source = ['lv2/lv2plug.in/ns/index.html.in'] + index_files, target = 'ns/index.html') + # Install main documentation files + if not bld.env.ONLINE_DOCS: + bld.install_files('${DOCDIR}/lv2/lv2plug.in/aux/', 'aux/style.css') + bld.install_files('${DOCDIR}/lv2/lv2plug.in/ns/', 'ns/index.html') + if bld.env.BUILD_TESTS: # Generate a compile test .c file that includes all headers def gen_build_test(task): -- cgit v1.2.1