Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
MathPrettyPrinter
Commits
1450d7c7
Commit
1450d7c7
authored
Jun 28, 2018
by
0xJMR
Browse files
Merge branch 'master' into tex
parents
70805e1e
3fd45662
Pipeline
#58732
failed with stages
in 18 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
1450d7c7
stages
:
#
- windows
-
windows
-
linux
-
gh-pages
...
...
@@ -11,12 +11,12 @@ masterJobLinux:
only
:
-
master
#
masterJobWindows:
#
stage: windows
#
script:
#
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml
#
tags:
#
- Windows10
masterJobWindows
:
stage
:
windows
script
:
-
mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml
tags
:
-
Windows10
BranchJobLinux
:
stage
:
linux
...
...
src/main/java/de/monticore/lang/monticar/mpp/core/generator/GeneratorHelper.java
View file @
1450d7c7
...
...
@@ -65,11 +65,10 @@ public class GeneratorHelper {
return
this
.
texPrinter
.
prettyPrint
(
ast
);
}
public
int
getLines
Count
(
ASTMathCompilationUnit
ast
)
{
public
String
[]
getLines
(
ASTMathCompilationUnit
ast
)
{
String
printedHTML
=
this
.
printHTML
(
ast
);
String
[]
lines
=
printedHTML
.
split
(
"\n"
);
return
lines
.
length
;
return
printedHTML
.
split
(
"\n"
)
;
}
...
...
src/main/resources/templates/script.ftl
View file @
1450d7c7
...
...
@@ -8,14 +8,13 @@
@import
url("https://fonts.googleapis.com/css?family=Roboto")
;
html
,
body
{
height
:
100%
;
margin
:
0
;
padding
:
0
;
}
body
{
background-color
:
#
303130
;
background-color
:
#
252525
;
color
:
#cecece
;
margin
:
0
;
padding
:
0
;
}
ul
{
...
...
@@ -26,28 +25,35 @@
}
li
{
float
:
left
;
padding
:
0
40px
0
20px
;
margin
:
20px
;
background-color
:
#252525
;
font-family
:
"Roboto"
,
sans-serif
;
font-size
:
14px
;
overflow-x
:
auto
;
max-width
:
calc
(
100%
-
100px
);
position
:
fixed
;
top
:
calc
(
50%
-
20px
);
left
:
calc
(
50%
-
20px
);
transform
:
translate
(
-50%
,
-50%
);
}
@media
screen
{
li
{
font-size
:
14px
;
}
}
@media
handheld
{
li
{
font-size
:
1.8vw
;
}
}
.keyword
{
color
:
#009fff
!important
;
}
pre
.line-numbers
{
float
:
left
;
pre
{
margin
:
0
;
}
td
.line-number
{
user-select
:
none
;
text-align
:
right
;
margin-right
:
10px
;
padding-right
:
10px
;
-moz-user-select
:
none
;
-webkit-user-select
:
none
;
}
img
{
...
...
@@ -59,12 +65,14 @@
<body>
<ul>
<li>
<pre
class=
"line-numbers"
>
<
#list
1..
helper.getLinesCount
(
ast
)
as
lineNumber
>
${lineNumber}
</
#
list>
</pre>
<pre>
${helper.printHTML(ast)}
</pre>
<table>
<
#list
helper.getLines
(
ast
)
as
line
>
<tr>
<td
class=
"line-number"
>
${1 + line?index}
</td>
<td><pre><
#if
line
?
length =
=
0
>
<
#else
>
${line}
</
#
if></pre></td>
</tr>
</
#
list>
</table>
</li>
<li>
<pre
class=
"line-numbers"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment