This script converts HTML Code in Modelica to get a HTML and Dymola conform code.
-
Install tidylib for python with
pip install pytidylib
-
Install library
-
Get binary from: http://binaries.html-tidy.org/
!Take correct version (64bit 32bit)!
-
Pack .dll and .exe data to PATH environment variable in windows
-
-
copy html_tidy.py into the modelica directory in which you want to correct your modelica files
Important: The html_tidy.py has to be in one directory with your package.mo file. All files in this directory and the directory below will be scanned and corrected
-
use
html_tidy.py --help
for instructions
-
Install pytidylib with dll's as described above
-
run from command line::
$ python view_html_errors.py <file> [file [...]]
The script will
- collect all the HTML code (
<html>...</html>
) in the Modelica file and - print out the original code with line numbers as well as
- the tidy version of the code (with line numbers).
- tidylib will look for errors and present the respective line numbers.
You can then inspect the code and make corrections to your Modelica file by hand. You might want to use the tidy version as produced by tidylib.
This script uses Python 3.6 for printing syntax and
function parameter annotations.
- The script was made for usage at the EON ERC EBC at RWTH Aachen University
- It uses HTML Tidy
- Some parts of the code are based on the validator.py script from BuildingsBy
- Feel free to use and manipulate the script