Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JUNCA24 RevealJS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PGI15-Teaching
JUNCA24 RevealJS
Commits
19852772
Commit
19852772
authored
12 years ago
by
Hakim El Hattab
Browse files
Options
Downloads
Patches
Plain Diff
support for data-markdown (#15)
parent
dc05ce15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
index.html
+18
-4
18 additions, 4 deletions
index.html
js/reveal.js
+1
-1
1 addition, 1 deletion
js/reveal.js
lib/js/data-markdown.js
+19
-0
19 additions, 0 deletions
lib/js/data-markdown.js
lib/js/showdown.js
+1341
-0
1341 additions, 0 deletions
lib/js/showdown.js
with
1379 additions
and
5 deletions
index.html
+
18
−
4
View file @
19852772
...
...
@@ -259,9 +259,23 @@ function linkify( selector ) {
<script
src=
"lib/js/head.min.js"
></script>
<script>
// Load reveal.js as well as a classList polyfill if needed
head
.
js
(
!
document
.
body
.
classList
?
'
lib/js/classList.js
'
:
null
)
.
js
(
'
js/reveal.js
'
,
function
()
{
// All scripts that should be loaded before initializing
var
scripts
=
[];
// If the browser doesn't support classList, load a polyfill
if
(
!
document
.
body
.
classList
)
{
scripts
.
push
(
'
lib/js/classList.js
'
);
}
// Load markdown parser if there are slides defined using markdown
if
(
document
.
querySelector
(
'
[data-markdown]
'
)
)
{
scripts
.
push
(
'
lib/js/showdown.js
'
);
scripts
.
push
(
'
lib/js/data-markdown.js
'
);
}
scripts
.
push
(
'
js/reveal.js
'
);
head
.
js
.
apply
(
null
,
scripts
.
concat
([
function
()
{
// Parse the query string into a key/value object
var
query
=
{};
...
...
@@ -290,7 +304,7 @@ function linkify( selector ) {
transition
:
query
.
transition
||
'
default
'
// default/cube/page/concave/linear(2d)
});
}
);
}
])
);
// Load highlight.js for syntax highlighting of code samples
head
.
js
(
'
lib/js/highlight.js
'
,
function
()
{
...
...
This diff is collapsed.
Click to expand it.
js/reveal.js
+
1
−
1
View file @
19852772
/*!
* reveal.js 1.5 r
3
* reveal.js 1.5 r
4
* http://lab.hakim.se/reveal-js
* MIT licensed
*
...
...
This diff is collapsed.
Click to expand it.
lib/js/data-markdown.js
0 → 100644
+
19
−
0
View file @
19852772
// From https://gist.github.com/1343518, modified to not load showdown
(
function
boom
(){
[].
forEach
.
call
(
document
.
querySelectorAll
(
'
[data-markdown]
'
),
function
fn
(
elem
){
// strip leading whitespace so it isn't evaluated as code
var
text
=
elem
.
innerHTML
.
replace
(
/
\n\s
*
\n
/g
,
'
\n
'
),
// set indentation level so your markdown can be indented within your HTML
leadingws
=
text
.
match
(
/^
\n?(\s
*
)
/
)[
1
].
length
,
regex
=
new
RegExp
(
'
\\
n?
\\
s{
'
+
leadingws
+
'
}
'
,
'
g
'
),
md
=
text
.
replace
(
regex
,
'
\n
'
),
html
=
(
new
Showdown
.
converter
()).
makeHtml
(
md
);
// here, have sum HTML
elem
.
innerHTML
=
html
;
});
}());
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/js/showdown.js
0 → 100644
+
1341
−
0
View file @
19852772
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment