Skip to content
jmoeckel edited this page Nov 16, 2015 · 9 revisions

Documention of Modelica code can be exported to HTML. Still, it is necessary to use correct syntax such that the documentation can be interpreted in the right way.

Typical Errors

The following rules fixed 90% of syntac errors/warnings:

Never use Always use Comment
`
`
`
`
tags must be closed
`` or `"` `` or `"` tags must be lowercase
`size=5` or `cellspacing=0` `size=\"5\"` and `cellspacing=\"0\"` double quotes around values, double quotes must be escaped
`x > 3` or `<` `x &gt 3;` or `<` < and > are special characters
`->` or `<-` `→` or `←` < and > are special characters
`

Title

`
`

Title

`
headers and lists already create paragraphs

Checking HTML Automatically

There exist several tools to check the HTML syntax for errors.

Buildings.py with HTML-tidy
BuildingsPy can validate the HTML documentation.
To install it, run pip install -U buildingspy (and possibly also pip install -U pytidylib).
You will also need the libtidy.dll from http://tidy.sourceforge.net/.

Then you can run the following Python 2.7 script (remember to change the path):

import os
import buildingspy.development.validator as v
moLibPath = '[PATH TO THE MODELICA LIBRARY ON YOUR MACHINE]'

val = v.Validator()
errStr = val.validateHTMLInPackage(moLibPath)
print(errStr)

htmlhint package of Atom editor
Experience shows, that BuildingsPy and HTML tidy did not find all the warnigns/errors! In addtion one could use the Atom.io editor with the htmlhint package to check the HTML syntax.