Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
dbc158eb
Commit
dbc158eb
authored
May 19, 2012
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Math expressions in hints are pretty printed using MathJax.
parent
65c425db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
1 deletion
+10
-1
src/frontend/css/editor.css
src/frontend/css/editor.css
+4
-0
src/frontend/js/editor.js
src/frontend/js/editor.js
+1
-0
src/parser.py
src/parser.py
+1
-1
src/possibilities.py
src/possibilities.py
+4
-0
No files found.
src/frontend/css/editor.css
View file @
dbc158eb
...
...
@@ -77,6 +77,10 @@ body {
line-height
:
20px
;
}
#math
.hint
.MathJax
{
color
:
#000
;
}
#control-buttons
{
height
:
21px
;
left
:
2%
;
...
...
src/frontend/js/editor.js
View file @
dbc158eb
...
...
@@ -134,6 +134,7 @@
var
elem
=
$
(
'
<div class=hint/>
'
);
elem
.
text
(
hint
);
$
(
'
#math
'
).
append
(
elem
);
QUEUE
.
Push
([
'
Typeset
'
,
MathJax
.
Hub
,
elem
[
0
]]);
};
window
.
append_input
=
function
(
input
)
{
...
...
src/parser.py
View file @
dbc158eb
...
...
@@ -262,7 +262,7 @@ class Parser(BisonParser):
hint = self.give_hint()
if hint:
print
hint
print
str(hint).replace('
`
', '')
else:
print '
No
further
reduction
is
possible
.
'
...
...
src/possibilities.py
View file @
dbc158eb
from
node
import
TYPE_OPERATOR
import
re
# Each rule will append its hint message to the following dictionary. The
...
...
@@ -18,6 +19,9 @@ class Possibility(object):
if
self
.
handler
in
MESSAGES
:
msg
=
MESSAGES
[
self
.
handler
]
# Surround math notation with backticks
msg
=
re
.
sub
(
'({[^ ]+)'
,
r'`\1`'
,
msg
)
if
callable
(
msg
):
msg
=
msg
(
self
.
root
,
self
.
args
)
...
...
Write
Preview
Markdown
is supported
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