Skip to content

Instantly share code, notes, and snippets.

@dietmarw
dietmarw / Modelica.xml
Created August 14, 2012 06:24 — forked from pclary/Modelica.xml
Modelica syntax highlighting for Notepad++
<NotepadPlus>
<UserLang name="Modelica" ext="mo">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">000000</Keywords>
<Keywords name="Folder+">function model for parfor block class connector record package</Keywords>
#!/bin/bash
OMLIBRARY="/tmp/MSLrelease/Modelica_aster/Modelica aster/Resources/help/"
cd "$OMLIBRARY"
rm -f *.png *.pdf FindFiles.log
grep -v http:// *.html | grep -v [Mm][Oo][Dd][Ee][Ll][Ii][Cc][Aa]:// | egrep -o "[A-Za-z_0-9%.: -]*/[A-Za-z_0-9%.:/ -]*\.(png|jpg|pdf)" | cut -d: -f2- | sort -u | tr -d \" > tmp
for f in `cat tmp`; do
f=`echo $f | sed 's/%20/ /'`
if test -f "$OMLIBRARY/$f"; then
## This one will be needed/adjusted for standalone documentation
`echo $f`
#!/usr/bin/env python
from __future__ import with_statement
from BeautifulSoup import BeautifulSoup
import subprocess as sub
import re
import glob
import sys
import os
os.chdir('/tmp/MSLrelease/Modelica_aster/Modelica aster/Resources/help/') # this is needed for check_local_files()
#!/usr/bin/env python
from __future__ import with_statement
from BeautifulSoup import BeautifulSoup
import subprocess as sub
import re
import glob
import sys
repls = [
(re.compile(r'^[Mm][Oo][Dd][Ee][Ll][Ii][Cc][Aa]://Modelica/'),'../../'),
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Linköping University,
* Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3
#!/usr/bin/env python
from pyquery import PyQuery as pq
import codecs
def convert_image(i, node):
print node
node = pq(node)
uri = node.attr("src")
if uri:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii">
<title>Test Case</title>
</head>
<body>
<p>
In the next figure, several features of the library are demonstrated with
a simple heating system with a closed flow cycle. By just changing one configuration parameter in the system object the equations are changed between steady-state and dynamic simulation with fixed or steady-state initial conditions.
</p>
<img src=\"modelica://Modelica/Resources/Images/Fluid/UsersGuide/HeatingSystem.png\" border=1>
<p>
With respect to previous versions, the design
#!/usr/bin/env bash
# Script to create a "Modelica" ready version of the Grammar.html
echo 'readFile("Grammar.html");' > /tmp/a.mos
omc $* /tmp/a.mos > Grammar.mo
# remove first line
sed '1d;3d' -i Grammar.mo
sed -e s#h1\>#h4\>#g -i Grammar.mo
sed -e s#h2\>#h5\>#g -i Grammar.mo
rm /tmp/a.mos
@dietmarw
dietmarw / demo
Created November 22, 2010 09:43
Demonstration Demonstration
line 1
line 2