Skip to content

Commit

Permalink
Update documentation server with enum parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Sep 9, 2018
1 parent 6d29570 commit cea0c1a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/documentation_server.cr
Expand Up @@ -101,6 +101,9 @@ module Mint
end
end

def generate(node : Ast::Node, json)
end

def generate(mint_json, ast : Ast, json)
json.object do
json.field "name", mint_json.name
Expand Down
4 changes: 4 additions & 0 deletions src/documentation_server/enum.cr
Expand Up @@ -5,6 +5,10 @@ module Mint
json.field "description", node.comment.try(&.to_html)
json.field "name", node.name

json.field "parameters" do
generate node.parameters, json
end

json.field "options" do
generate node.options, json
end
Expand Down
4 changes: 4 additions & 0 deletions src/documentation_server/enum_option.cr
Expand Up @@ -4,6 +4,10 @@ module Mint
json.object do
json.field "description", node.comment.try(&.to_html)
json.field "name", node.value

json.field "parameters" do
generate node.parameters, json
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions src/documentation_server/type.cr
Expand Up @@ -8,5 +8,9 @@ module Mint

"#{node.name}#{parameters}"
end

def generate(node : Ast::Type, json : JSON::Builder)
json.string stringify(node)
end
end
end
4 changes: 4 additions & 0 deletions src/documentation_server/type_variable.cr
Expand Up @@ -3,5 +3,9 @@ module Mint
def stringify(node : Ast::TypeVariable)
node.value
end

def generate(node : Ast::TypeVariable, json : JSON::Builder)
json.string node.value
end
end
end

0 comments on commit cea0c1a

Please sign in to comment.