From acb668edf18466b9843f207b9141d6bd0e0f3b2a Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Thu, 7 Jul 2005 20:56:27 +0000 Subject: [PATCH] * Added support for layer summaries. * Added a "Index" link on the menu to link to index.html * Added links from the master interface & template lists to their respective documentation in their module. * Added links to "Interfaces" and "Templates" in modules that have both. * Added "Return" links after the "Interfaces" and "Templates" section that go to the top of the module site. --- refpolicy/Changelog | 9 +++++++-- refpolicy/doc/templates/int_list.html | 2 +- refpolicy/doc/templates/interface.html | 1 + refpolicy/doc/templates/menu.html | 2 ++ refpolicy/doc/templates/module.html | 4 +--- refpolicy/doc/templates/module_list.html | 3 +++ refpolicy/doc/templates/temp_list.html | 2 +- refpolicy/doc/templates/template.html | 1 + refpolicy/support/sedoctool.py | 8 +++++++- 9 files changed, 24 insertions(+), 8 deletions(-) diff --git a/refpolicy/Changelog b/refpolicy/Changelog index 924c03d6..513fb347 100644 --- a/refpolicy/Changelog +++ b/refpolicy/Changelog @@ -1,3 +1,7 @@ + * Doc tool now links directly to the interface/template in the + module page when it is selected in the interface/template index. + * Added support for layer summaries. + 20050707 (7 Jul 2005) * Changed xml to have modules encapsulated by layer tags, rather than putting layer="foo" in the module tags. Also in the future @@ -12,8 +16,9 @@ * Doc tool retains the user's settings in modules.conf and tunables.conf if the files already exist. * Modules.conf behavior has been changed to be a list of all - available modules, and the user can toggle the module on or - off to include the module or not. + available modules, and the user can specify if the module is + built as a loadable module, included in the monolithic policy, + or excluded. * Added policies: fstools (fsck, mkfs, swapon, etc. tools) logrotate diff --git a/refpolicy/doc/templates/int_list.html b/refpolicy/doc/templates/int_list.html index c2ebfb3f..b95c3435 100644 --- a/refpolicy/doc/templates/int_list.html +++ b/refpolicy/doc/templates/int_list.html @@ -2,7 +2,7 @@ [[for int in interfaces]]
-Module: +Module: [[int['mod_name']]]

Layer: [[int['mod_layer']]]

diff --git a/refpolicy/doc/templates/interface.html b/refpolicy/doc/templates/interface.html index 3ee60129..ae7bf49e 100644 --- a/refpolicy/doc/templates/interface.html +++ b/refpolicy/doc/templates/interface.html @@ -1,4 +1,5 @@ [[for int in interfaces]] +

[[if int.has_key("mod_layer")]] Layer: [[mod_layer]]
diff --git a/refpolicy/doc/templates/menu.html b/refpolicy/doc/templates/menu.html index 23453832..7a903a3d 100644 --- a/refpolicy/doc/templates/menu.html +++ b/refpolicy/doc/templates/menu.html @@ -10,6 +10,8 @@
[[end]]

+ * Layer Index +

* Interface Index

* Template Index diff --git a/refpolicy/doc/templates/module.html b/refpolicy/doc/templates/module.html index 33bb46a8..e1567959 100644 --- a/refpolicy/doc/templates/module.html +++ b/refpolicy/doc/templates/module.html @@ -1,12 +1,10 @@

Layer: [[mod_layer]]

Module: [[mod_name]]

-[[if interfaces]] -[[if templates]] +[[if interfaces and templates]] Interfaces Templates [[end]] -[[end]]

Description:

[[if mod_desc]]

[[mod_desc]]

diff --git a/refpolicy/doc/templates/module_list.html b/refpolicy/doc/templates/module_list.html index 06647ffb..7317a6be 100644 --- a/refpolicy/doc/templates/module_list.html +++ b/refpolicy/doc/templates/module_list.html @@ -1,5 +1,8 @@ [[if mod_layer]]

Layer: [[mod_layer]]

+[[if layer_summary]] +

[[layer_summary]]


+[[end]] [[end]] diff --git a/refpolicy/doc/templates/temp_list.html b/refpolicy/doc/templates/temp_list.html index 858e5309..9d635d87 100644 --- a/refpolicy/doc/templates/temp_list.html +++ b/refpolicy/doc/templates/temp_list.html @@ -2,7 +2,7 @@ [[for temp in templates]]
-Module: +Module: [[temp['mod_name']]]

Layer: [[temp['mod_layer']]]

diff --git a/refpolicy/doc/templates/template.html b/refpolicy/doc/templates/template.html index 9170972b..c24a83ef 100644 --- a/refpolicy/doc/templates/template.html +++ b/refpolicy/doc/templates/template.html @@ -1,4 +1,5 @@ [[for temp in templates]] +

[[if temp.has_key("mod_layer")]] Layer: [[mod_layer]]
diff --git a/refpolicy/support/sedoctool.py b/refpolicy/support/sedoctool.py index 74339589..5e7bf83c 100755 --- a/refpolicy/support/sedoctool.py +++ b/refpolicy/support/sedoctool.py @@ -308,8 +308,14 @@ def gen_docs(doc, working_dir, templatedir): for mod_layer,modules in module_list.iteritems(): menu = gen_doc_menu(mod_layer, module_list) + layer_summary = None + for desc in doc.getElementsByTagName("summary"): + if desc.parentNode.getAttribute("name") == mod_layer: + layer_summary = format_html_desc(desc) + menu_args = { "menulist" : menu, - "mod_layer" : mod_layer } + "mod_layer" : mod_layer, + "layer_summary" : layer_summary } menu_tpl = pyplate.Template(menudata) menu_buf = menu_tpl.execute_string(menu_args)
Module:Description: