Skip to content

Commit 2959acd

Browse files
committed
Automatically add groups from features
1 parent 77c7524 commit 2959acd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/docs_gen.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ def generate_documentation(dirs, output_dir):
3131
from tools.targets import TARGET_MAP
3232
toolchain = GCC_ARM(TARGET_MAP["Super_Target"])
3333
resources = toolchain.scan_resources(".")
34+
for src in resources.headers:
35+
with open(src) as fd:
36+
contents = fd.read()
37+
with open(src, "w+") as fd:
38+
fd.write("/** \\addtogroup feature_mbed_os */\n/** @{{*/\n{:s}\n/** @}}*/\n".format(contents))
39+
for name, res in resources.features.iteritems():
40+
for src in res.headers:
41+
with open(src) as fd:
42+
contents = fd.read()
43+
with open(src, "w+") as fd:
44+
fd.write("/** \\addtogroup feature_{:s} */\n/** @{{*/\n{:s}\n/** @}}*/\n".format(name.lower(),contents))
45+
3446
generate_documentation(sum(map(lambda x:x.headers, resources.features.values()), resources.headers),
3547
join(dirname(dirname(__file__)), "mbed-docs"))
3648
print resources

0 commit comments

Comments
 (0)