diff --git a/lib/docurium.rb b/lib/docurium.rb index e4bafbda6..1ba187ef5 100644 --- a/lib/docurium.rb +++ b/lib/docurium.rb @@ -503,13 +503,24 @@ def update_globals!(data, recs) when :struct, :fnptr data[:types][r[:name]] ||= {} + known = data[:types][r[:name]] r[:value] ||= r[:name] - wanted[:types].each do |k| - next unless r.has_key? k - if k == :comments - data[:types][r[:name]][k] = md.render r[k] - else - data[:types][r[:name]][k] = r[k] + # we don't want to override "opaque" structs with typedefs or + # "public" documentation + unless r[:tdef].nil? and known[:fields] and known[:comments] and known[:description] + wanted[:types].each do |k| + next unless r.has_key? k + if k == :comments + data[:types][r[:name]][k] = md.render r[k] + else + data[:types][r[:name]][k] = r[k] + end + end + else + # We're about to skip that type. Just make sure we preserve the + # :fields comment + if r[:fields] and known[:fields].empty? + data[:types][r[:name]][:fields] = r[:fields] end end if r[:type] == :fnptr diff --git a/lib/docurium/docparser.rb b/lib/docurium/docparser.rb index fd50fec02..524732f68 100644 --- a/lib/docurium/docparser.rb +++ b/lib/docurium/docparser.rb @@ -149,7 +149,7 @@ def extract_function_args(cursor, cmt) def extract_subject_desc(comment) subject = comment.child.text - paras = comment.find_all { |cmt| cmt.kind == :comment_paragraph }.drop(1).map { |p| p.map(&:text).join() } + paras = comment.find_all { |cmt| cmt.kind == :comment_paragraph }.drop(1).map { |p| p.text } desc = paras.join("\n\n") return subject, desc end diff --git a/site/css/style.css b/site/css/style.css index 2222d024b..9c22d3bad 100644 --- a/site/css/style.css +++ b/site/css/style.css @@ -117,18 +117,25 @@ table.methods tr td.methodName a { font-weight: bold; } -table.funcTable tr td { +table.funcTable tr td, +table.structTable tr td { padding: 5px 10px; border-bottom: 1px solid #eee; } -table.funcTable tr td.comment { - color: #999; -} -table.funcTable tr td.var { + +.enumTable .var, +.funcTable .var, +.structTable .var { font-weight: bold; color: #833; } +.enumTable .type, +.funcTable .type, +.structTable .type { + text-align: right; +} + code.params { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ @@ -152,7 +159,9 @@ code.params { .returns { margin-bottom: 15px; } -h1.funcTitle { +h1.funcTitle, +h1.enumTitle, +h1.structTitle { font-size: 1.6em; } h3.funcDesc { @@ -255,6 +264,3 @@ p.functionList a.introd { color: #933; } -.type-comment { - padding-left: 3em; -} \ No newline at end of file diff --git a/site/index.html b/site/index.html index 5ef9ca177..4669745e1 100644 --- a/site/index.html +++ b/site/index.html @@ -111,8 +111,10 @@
| <%= arg.link %> | +<%= arg.link %> | <%= arg.name %> | +
| <%= arg.comment %> |