Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
7cec55ab
Commit
7cec55ab
authored
Mar 06, 2018
by
scoder
Committed by
GitHub
Mar 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2124 from tdamsma/togglediv-jupyterlab-workaround
Inline toggleDiv
parents
bab4d4b8
5f087c81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
Cython/Compiler/Annotate.py
Cython/Compiler/Annotate.py
+7
-13
No files found.
Cython/Compiler/Annotate.py
View file @
7cec55ab
...
...
@@ -79,14 +79,6 @@ class AnnotationCCodeWriter(CCodeWriter):
css
.
append
(
HtmlFormatter
().
get_style_defs
(
'.cython'
))
return
'
\
n
'
.
join
(
css
)
_js
=
"""
function toggleDiv(id) {
theDiv = id.nextElementSibling
if (theDiv.style.display != 'block') theDiv.style.display = 'block';
else theDiv.style.display = 'none';
}
"""
.
strip
()
_css_template
=
textwrap
.
dedent
(
"""
body.cython { font-family: courier; font-size: 12; }
...
...
@@ -141,9 +133,6 @@ class AnnotationCCodeWriter(CCodeWriter):
<style type="text/css">
{css}
</style>
<script>
{js}
</script>
</head>
<body class="cython">
<p><span style="border-bottom: solid 1px grey;">Generated by Cython {watermark}</span>{more_info}</p>
...
...
@@ -151,7 +140,7 @@ class AnnotationCCodeWriter(CCodeWriter):
<span style="background-color: #FFFF00">Yellow lines</span> hint at Python interaction.<br />
Click on a line that starts with a "<code>+</code>" to see the C code that Cython generated for it.
</p>
'''
).
format
(
css
=
self
.
_css
(),
js
=
self
.
_js
,
watermark
=
Version
.
watermark
,
'''
).
format
(
css
=
self
.
_css
(),
watermark
=
Version
.
watermark
,
filename
=
os
.
path
.
basename
(
source_filename
)
if
source_filename
else
''
,
more_info
=
coverage_info
)
]
...
...
@@ -253,7 +242,12 @@ class AnnotationCCodeWriter(CCodeWriter):
calls
[
'py_macro_api'
]
+
calls
[
'pyx_macro_api'
])
if
c_code
:
onclick
=
" onclick='toggleDiv(this)'"
onclick
=
textwrap
.
dedent
(
'''
onclick="
this.nextElementSibling.style.display != 'block' ?
this.nextElementSibling.style.display = 'block' :
this.nextElementSibling.style.display = 'none'
"'''
).
replace
(
'
\
n
'
,
''
)
expandsymbol
=
'+'
else
:
onclick
=
''
...
...
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