Kaydet (Commit) 91dde49e authored tarafından Michael Stahl's avatar Michael Stahl

odk: add DevGuide wiki links to doxygen documentation

Unsurprisingly doxygen does not support reading a idl_chapter_refs.txt
file like autodoc does.  And it looks like doxygen tag files can not
be used to do this, as they link only in the "other" direction.

But with a bit of hackery we can generate a "dummy" IDL input file, with
emtpy definitions for those types that have DevGuide links.
Doxygen will nicely combine documentation from multiple definitions of a
type, and fortunately does only put in references to the first file that
defines a type, so hopefully adding the generated file as the last input
file is suffficient to make things work nicely.

The generated file is committed to git because there is a bit of a
problem with finding out what sort of entity a name like
"com.sun.star.Foo" refers to, which needs to be in the doxygen input.

Change-Id: I793bc59c8acfecf460e4addea7838c76a3ede77e
üst 363a37b6
......@@ -60,8 +60,11 @@ $(eval $(call gb_CustomTarget_register_targets,odk/docs,\
))
odk_idl_PREFIX := $(SRCDIR)/udkapi/ $(SRCDIR)/offapi/
# note: generated_idl_chapter_refs.idl must be the _last_ input file!
# otherwise spurious references to it will appear in the output
odk_idl_DOXY_INPUT := $(SRCDIR)/odk/pack/gendocu/idl/main.dox \
$(addsuffix com,$(odk_idl_PREFIX)) \
$(SRCDIR)/odk/pack/gendocu/idl/generated_idl_chapter_refs.idl
odk_idl_DOXY_WORKDIR := $(call gb_CustomTarget_get_workdir,odk/docs/idl)/ref
# don't depend on the IDL files directly but instead on the udkapi/offapi
......
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# wikilinks.py:
# This throwaway prgram can be used to convert idl_chapter_refs.txt to a
# "fake" IDL file that can be fed to doxygen to get the DevGuide Wiki links.
import sys
devguidewww = "http://wiki.services.openoffice.org/wiki/"
in_topic = False
link = None
description = None
allthings = {}
allkinds = {}
# unfortunately we need to know what kind of entity to declare...
# generate this file like so:
# solver/unxlngx6/bin/regview solver/unxlngx6/bin/types.rdb | grep -A1 "type class:" | awk '/type class:/ { class = $NF } /type name:/ { gsub("/", ".", $NF); gsub("\"", "", $NF); print class, $NF }' > /tmp/kinds
for line in open("/tmp/kinds") :
(kind,_,name) = line.strip().partition(" ")
allkinds[name] = kind
for line in sys.stdin :
sline = line.strip()
if sline.startswith("LINK:") :
link = sline.partition('LINK:')[2]
elif sline.startswith("DESCR:") :
description = sline.partition('DESCR:')[2]
elif sline == "TOPIC:" :
in_topic = True
elif in_topic :
if sline == "" :
in_topic = False
elif sline in allthings :
allthings[sline].append((link, description))
else:
allthings[sline] = [(link, description)]
print("/* this file was generated from idl_chapter_refs.txt by wikilinks.py */")
for key in allthings:
kind = allkinds[key]
parts = key.split(".")
print("\n")
for p in parts[0:-1] :
print("module", p, "{")
# for enums the "{}" trick results in broken/duplicate output
if kind == "enum" :
print("/// @" + kind, parts[-1])
print("/// @par Developers Guide")
for item in allthings[key] :
print("/// <a href=\"" + devguidewww + item[0] + "\">"
+ item[1] + "</a><br>")
# doxygen does not have tags for e.g. @service but empty definition works
if kind != "enum" :
print(kind, parts[-1], "{}")
for p in parts[0:-1] :
print("};")
# vim:set shiftwidth=4 softtabstop=4 expandtab:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment