From 4d1b7420a4aaaaa8da14091d95ed007f4efb93ab Mon Sep 17 00:00:00 2001 From: takahashim Date: Sun, 11 Oct 2015 23:29:06 +0900 Subject: support typedef documentation cf. #2 * add TypedefObject * add TypedefHandler for parser * generate Typedef documents in C header files --- templates/default/header/html/setup.rb | 8 ++++++++ templates/default/header/html/typedef_summary.erb | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 templates/default/header/html/typedef_summary.erb (limited to 'templates/default/header/html') diff --git a/templates/default/header/html/setup.rb b/templates/default/header/html/setup.rb index 204f823..7bb0159 100644 --- a/templates/default/header/html/setup.rb +++ b/templates/default/header/html/setup.rb @@ -5,6 +5,7 @@ def init sections :header, :pre_docstring, T('docstring'), :includes, :function_summary, [:item_summary], :define_summary, [T('docstring')], + :typedef_summary, [T('docstring')], :function_details_list, [T('function_details')] end @@ -22,3 +23,10 @@ def define_listing @defines = object.defines @defines end + +def typedef_listing + return @typedefs if @typedefs + + @typedefs = object.typedefs + @typedefs +end diff --git a/templates/default/header/html/typedef_summary.erb b/templates/default/header/html/typedef_summary.erb new file mode 100644 index 0000000..001ab2d --- /dev/null +++ b/templates/default/header/html/typedef_summary.erb @@ -0,0 +1,11 @@ +<% if typedef_listing.size > 0 %> +

Typedef Summary

+
+ <% typedef_listing.each do |typedef| %> +
typedef <%= typedef.name %> + <%= yieldall :object => typedef %> +
+
<%#= format_constant typedef.value %>
+ <% end %> +
+<% end %> -- cgit v1.2.3