Skip to content

Commit

Permalink
Merge pull request modelica#2479 from otronarp/merge-in-master
Browse files Browse the repository at this point in the history
Merge master into the MCP branch
  • Loading branch information
henrikt-ma committed Feb 11, 2020
2 parents 25ccd65 + 7e0259f commit d2a06ed
Show file tree
Hide file tree
Showing 60 changed files with 4,506 additions and 3,950 deletions.
83 changes: 83 additions & 0 deletions .CI/Jenkinsfile
@@ -0,0 +1,83 @@
pipeline {
agent none
options {
disableConcurrentBuilds()
}
stages {
stage('checks') {
agent {
docker {
image 'alpine:3.9'
label 'linux'
}
}
steps {
sh label: "Find files with trailing whitespace", script: '! grep -n "[ \t]$" *.tex chapters/*.tex'
}
}
stage('build') {
agent {
docker {
image 'modelicaspec/latexml:20190319'
label 'linux'
alwaysPull true
}
}
steps {
sh 'latexmk -pdf MLS.tex'
sh 'latexml MLS.tex --dest MLS.xml'
sh 'latexmlpost MLS.xml -format html -pmml --splitat=chapter --javascript=css/LatexML-maybeMathJax.js --navigationtoc=context --css=css/LaTeXML-navbar-left.css --dest MLS.html'
sh 'tar czf MLS.tar.gz *.html *.css media css/'
archiveArtifacts artifacts: 'MLS.tar.gz', fingerprint: true
archiveArtifacts artifacts: 'MLS.pdf', fingerprint: true
stash name: 'MLS', includes: '*.html,*.css,MLS.pdf,media/**,css/**,MLS.tar.gz'
}
}
stage('upload') {
when {
allOf {
not {
changeRequest()
}
anyOf {
buildingTag()
anyOf {
branch 'master'
}
}
}
beforeAgent true
}
agent {
label 'linux'
}
steps {
unstash name: 'MLS'
sh "test ! -z ${env.GIT_BRANCH}"
sshPublisher(publishers: [sshPublisherDesc(configName: 'ModelicaSpecification', transfers: [sshTransfer(remoteDirectory: "${env.GIT_BRANCH}", sourceFiles: '*.html,*.css,MLS.pdf,media/**,css/**')])])
}
}
stage('index') {
agent {
docker {
image 'modelicaspec/markdown:20190307'
label 'linux'
alwaysPull true
}
}
when {
allOf {
not {
changeRequest()
}
branch 'master'
}
beforeAgent true
}
steps {
sh 'python3 .CI/index.py'
sshPublisher(publishers: [sshPublisherDesc(configName: 'ModelicaSpecification', transfers: [sshTransfer(sourceFiles: 'index.html')])])
}
}
}
}
11 changes: 11 additions & 0 deletions .CI/index.py
@@ -0,0 +1,11 @@
import markdown, sys
import xml.etree.ElementTree as ET
xml = "<xml>" + markdown.markdown(open('README.md', encoding="utf-8").read(), extensions=['markdown.extensions.tables']) + "</xml>"
root = ET.fromstring(xml)
for elem in root.findall('.//table'):
f = open("index.html", "w")
f.write("<html>")
f.write(ET.tostring(elem).decode('utf-8'))
f.write("</html>")
sys.exit(0)
sys.exit(1)
3 changes: 3 additions & 0 deletions .CI/latexml-iterative/Dockerfile
@@ -0,0 +1,3 @@
FROM modelicaspec/latexml:20190214

RUN tlmgr install parskip etoolbox
31 changes: 31 additions & 0 deletions .CI/latexml/Dockerfile
@@ -0,0 +1,31 @@
FROM ubuntu:bionic

ENV PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}"

RUN sed -i s,http://archive.ubuntu.com/ubuntu/,mirror://mirrors.ubuntu.com/mirrors.txt, /etc/apt/sources.list \
&& apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -qy perl ca-certificates make libxslt1.1 libxslt-dev libxml2 libxml2-dev gcc wget curl git unzip cpanminus --no-install-recommends --no-install-suggests \
&& export PATH="/tmp/texlive/bin/x86_64-linux:$PATH" \
&& REMOTE="http://mirror.ctan.org/systems/texlive/tlnet" \
&& INSTALL="/tmp/install-texlive" \
&& mkdir -p $INSTALL \
&& echo "export PATH=$PATH:/usr/local/texlive/2018/bin" >> /etc/environment \
&& curl -sSL $REMOTE/install-tl-unx.tar.gz | tar -xzv -C $INSTALL --strip-components=1 \
&& echo selected_scheme scheme-basic > texlive.profile \
&& echo TEXDIR /usr/local/texlive/ >> texlive.profile \
&& echo TEXMFLOCAL /usr/local/texmf-local >> texlive.profile \
&& echo TEXMFSYSCONFIG /usr/local/texmf-config >> texlive.profile \
&& echo TEXMFSYSVAR /usr/local/texmf-var >> texlive.profile \
&& echo tlpdbopt_autobackup 0 >> texlive.profile \
&& echo tlpdbopt_install_docfiles 0 >> texlive.profile \
&& echo tlpdbopt_install_srcfiles 0 >> texlive.profile \
&& $INSTALL/install-tl --profile texlive.profile \
&& rm texlive.profile \
&& tlmgr update --self --all --reinstall-forcibly-removed \
&& tlmgr install latexmk listings xcolor float multirow tocloft parskip etoolbox \
&& cpanm JSON \
&& cpanm --notest https://github.com/HansOlsson/LaTeXML.git@UseLabel \
&& apt-get autoremove -qy make gcc curl wget git cpanminus libxml2-dev libxslt-dev \
&& latexmk --version \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/ /root/.cpanm/work*
3 changes: 3 additions & 0 deletions .CI/markdown/Dockerfile
@@ -0,0 +1,3 @@
FROM alpine:3.9

RUN apk add -U --no-cache py3-pip py3-lxml && pip3 install py-gfm
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -146,3 +146,8 @@ sympy-plots-for-*.tex/
*.xml

MLS\.pdf

LaTeXML.css
MLS.tar.gz
ltx-listings.css
ltx-report.css
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .travis_install.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .travis_texlive.profile

This file was deleted.

11 changes: 11 additions & 0 deletions MLS.tex
Expand Up @@ -7,6 +7,17 @@
\begin{document}
% Title
\maketitle
% Add new Modelica Language logotype
% The header ruler looks odd as Modelica Language define a natural line that is further up
% We also need to fill the vertical space on the right
% Not using page numbers in right-header, since we usually refer to sections.
%
% Using nouppercase since it is seems more normal for the sections, and is also
% needed for over-determined connectors (as it would otherwise overflow)
\pagestyle{fancy}
\rhead{Modelica Language Specification 3.5-dev\\ \nouppercase{\rightmark} \vspace{1mm}}
\lhead{\includegraphics[scale=0.1]{image1}}
\renewcommand{\headrulewidth}{0.0pt}

% Abstract
\input{chapters/abstract}
Expand Down
13 changes: 8 additions & 5 deletions README.md
@@ -1,4 +1,4 @@
# ModelicaSpecification
# ModelicaSpecification
This repository contains the Modelica Language Specification, hosted at https://github.com/modelica/ModelicaSpecification.

## Build status
Expand All @@ -12,8 +12,8 @@ Modelica® https://modelica.org is a non-proprietary, object-oriented, equation

Version | Link | Published |
------- | ----------------------------------------------------------------- | --------|
3.5-dev | [Master branch](https://github.com/modelica/ModelicaSpecification)| not yet |
3.4 | [PDF](https://modelica.org/documents/ModelicaSpec34.pdf) | 2017 |
3.5-dev | [Master branch](https://github.com/modelica/ModelicaSpecification/tree/master) [HTML](https://specification.modelica.org/master/MLS.html) [PDF](https://specification.modelica.org/master/MLS.pdf)| not yet |
3.4 | [Tagged release](https://github.com/modelica/ModelicaSpecification/releases/tag/v3.4) [HTML](https://specification.modelica.org/v3.4/MLS.html) [PDF](https://modelica.org/documents/ModelicaSpec34.pdf) | 2017 |
3.3rev1 | [PDF](https://modelica.org/documents/ModelicaSpec33Revision1.pdf) | 2014 |
3.2rev2 | [PDF](https://modelica.org/documents/ModelicaSpec32Revision2.pdf) | 2013 |
3.2rev1 | [PDF](https://modelica.org/documents/ModelicaSpec32Revision1.pdf) | 2012 |
Expand Down Expand Up @@ -41,9 +41,12 @@ CLA: Contributor's license agreement. (Details to follow.)

How to edit and generate final documents
* For online editing you can use www.overleaf.com (details to follow)
* The pdf-documents are generated with pdflatex, which is part of most LaTeX installations, we used http://miktex.org/download
* The pdf-documents are generated with pdflatex, which is part of most LaTeX installations, we used http://miktex.org/download
* The HTML-documents are generated with LaTeXML. That is more complicated to install - and can optionally be skipped:
1. First you need perl, we used http://strawberryperl.com/
2. And then ideally the official LaTeXML package: http://dlmf.nist.gov/LaTeXML/get.html#SS4.SSS0.Px1 or https://github.com/brucemiller/LaTeXML
2. And then ideally the official LaTeXML package: http://dlmf.nist.gov/LaTeXML/get.html#SS4.SSS0.Px1 or https://github.com/brucemiller/LaTeXML
3. Except that awaiting one correction we use https://github.com/HansOlsson/LaTeXML/tree/UseLabel
4. The exact commands are in the Makefile

It is also possible to get a preview in the pull request.
There will be a link to the [status check](https://test.openmodelica.org/jenkins/job/ModelicaAssociation/job/ModelicaSpecification/view/change-requests/), which checks that the documents can be generated and gives you an option to download them.

0 comments on commit d2a06ed

Please sign in to comment.