1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 # This throwaway program can be used to convert idl_chapter_refs.txt to a
12 # "fake" IDL file that can be fed to doxygen to get the DevGuide Wiki links.
16 devguidewww
= "http://wiki.openoffice.org/wiki/"
23 # unfortunately we need to know what kind of entity to declare...
24 # generate this file like so:
25 # 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
26 for line
in open("/tmp/kinds") :
27 (kind
,_
,name
) = line
.strip().partition(" ")
30 for line
in sys
.stdin
:
32 if sline
.startswith("LINK:") :
33 link
= sline
.partition('LINK:')[2]
34 elif sline
.startswith("DESCR:") :
35 description
= sline
.partition('DESCR:')[2]
36 elif sline
== "TOPIC:" :
41 elif sline
in allthings
:
42 allthings
[sline
].append((link
, description
))
44 allthings
[sline
] = [(link
, description
)]
46 print("/* this file was generated from idl_chapter_refs.txt by wikilinks.py */")
50 parts
= key
.split(".")
52 for p
in parts
[0:-1] :
53 print("module", p
, "{")
54 # for enums the "{}" trick results in broken/duplicate output
56 print("/// @" + kind
, parts
[-1])
57 print("/// @par Developers Guide")
58 for item
in allthings
[key
] :
59 print("/// <a href=\"" + devguidewww
+ item
[0] + "\">"
60 + item
[1] + "</a><br>")
61 # doxygen does not have tags for e.g. @service but empty definition works
63 print(kind
, parts
[-1], "{}")
64 for p
in parts
[0:-1] :
67 # vim:set shiftwidth=4 softtabstop=4 expandtab: