-
Notifications
You must be signed in to change notification settings - Fork 34
Correct HTML
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.
The following rules should help to avoid the most common syntax errors/warnings:
Never use | Always use | Comment |
---|---|---|
<br> |
<br/> |
tags must be closed |
<HTML> or "
|
<html> or "
|
tags must be lowercase |
size=5 or cellspacing=0
|
size=\"5\" and cellspacing=\"0\"
|
double quotes around values, double quotes must be escaped |
y > 2 or x<3
|
y > 2 or x<3
|
< and > are special characters |
-> or <-
|
→ or ←
|
< and > are special characters |
<p><h4>Title</h4></p> |
<h4>Title</h4> |
headers and lists already create paragraphs |
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.