require "html"
require "ecr/macros"
require "./page-html-view"
require "./api-methods"
module Guff
class APIDocsHTMLView
TITLE = "Guff API Documentation"
def self.run(context : HTTP::Server::Context)
page = PageHTMLView.new(TITLE, new.to_s)
context.response.content_type = page.content_type
context.response.puts page
end
private def namespaces
APIMethods::API.keys.sort
end
private def methods(namespace : String)
APIMethods::API[namespace].keys.sort
end
def h(s : String)
HTML.escape(s || "")
end
ECR.def_to_s("./src/guff/views/api-docs.ecr")
end
end