-
Notifications
You must be signed in to change notification settings - Fork 2
/
org-slidy-slides.js
37 lines (33 loc) · 1.29 KB
/
org-slidy-slides.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function formatSlideTitle(i) {
var a = $('<h1 />').append($('<span />').append($(this).contents()));
$(this).replaceWith(a);
}
const tagTranslator = {
"Incremental": "incremental",
"ShowFirst": "show-first",
};
function interpretTags() {
$("h1 span.tag span").each(function(){
$(this).parent().parent().parent()
.siblings().children("ul")
.addClass(tagTranslator[$(this).text()]);
});
$("li span.tag span").each(function(){
$(this).parent()
.siblings("ul")
.addClass(tagTranslator[$(this).text()]);
});
$("span.tag").remove();
}
function rewriteExternalLinks() {
$("a").each(function(){
if ($(this).attr("href").match("^http://"))
$(this).attr("rel", "external");
});
}
$(document).ready(function () {
$("div.outline-2").addClass("slide");
$("div.slide h2").each(formatSlideTitle);
interpretTags();
rewriteExternalLinks();
});