# This file is part of NIT ( http://www.nitlanguage.org ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Render commands results as HTML module commands_html import commands::commands_graph import commands::commands_usage import templates::templates_html import doc_down import highlight redef class DocCommand # Render results as a HTML string fun to_html: Writable do return "
Not yet implemented
" end redef class CmdMessage # Render the message as a HTML string fun to_html: Writable is abstract end redef class CmdError redef fun to_html do return "Error: {to_s}
" end redef class CmdWarning redef fun to_html do return "Warning: {to_s}
" end # Model commands redef class CmdEntity redef fun to_html do var mentity = self.mentity if mentity == null then return "" return mentity.html_link end end redef class CmdEntities redef fun to_html do var mentities = self.results if mentities == null then return "" var tpl = new Template tpl.add "{output.write_to_string}" end end # Graph commands redef class CmdGraph redef fun to_html do var output = render if output == null then return "" return output.write_to_string end end