# Dump of Nit model into hypertext human-readable format.
module model_hyperdoc
-import model
import metrics_base
-import phase
-import frontend
redef class ToolContext
var model_hyperdoc_phase: Phase = new ModelHyperdocPhase(self, null)
# The generated file contains the description of each entity of the model
fun generate_model_hyperdoc(toolcontext: ToolContext, model: Model)
do
- var buf = new Buffer
+ var buf = new FlatBuffer
buf.append("<html>\n<body>\n")
buf.append("<h1>Model</h1>\n")
buf.append("<dt>project</dt>\n")
buf.append("<dd>{linkto(mproject)}</dd>\n")
buf.append("<dt>filepath</dt>\n")
- buf.append("<dd>{mgroup.filepath}</dd>\n")
+ buf.append("<dd>{mgroup.filepath.to_s}</dd>\n")
var p = mgroup.parent
if p != null then
buf.append("<dt>parent group</dt>\n")
end
end
buf.append("</body></html>\n")
- var f = new OFStream.open(toolcontext.output_dir.join_path("model.html"))
+ var f = new FileWriter.open(toolcontext.output_dir.join_path("model.html"))
f.write(buf.to_s)
f.close
end