Skip to content

Commit

Permalink
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/compiler/crystal/tools/doc/constant.cr
Original file line number Diff line number Diff line change
@@ -17,6 +17,10 @@ class Crystal::Doc::Constant
@const.name
end

def id
name
end

def value
@const.value
end
@@ -27,6 +31,7 @@ class Crystal::Doc::Constant

def to_json(builder : JSON::Builder)
builder.object do
builder.field "id", id
builder.field "name", name
builder.field "value", value.try(&.to_s)
builder.field "doc", doc
2 changes: 1 addition & 1 deletion src/compiler/crystal/tools/doc/html/type.html
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ <h2>Constant Summary</h2>
<% end %>
<dl>
<% type.constants.each do |const| %>
<dt class="entry-const" id="<%= const.name %>">
<dt class="entry-const" id="<%= const.id %>">
<strong><%= const.name %></strong> = <code><%= const.formatted_value %></code>
</dt>
<% if doc = const.formatted_doc %>

0 comments on commit 666c192

Please sign in to comment.