Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kuanyui/org-ioslide into …
Browse files Browse the repository at this point in the history
…kuanyui-master
  • Loading branch information
coldnew committed Oct 18, 2015
2 parents 8492011 + 0371499 commit a44c7f5
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 1,574 deletions.
1 change: 1 addition & 0 deletions .projectile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-/theme/css
8 changes: 4 additions & 4 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ <h3></h3>
<b>(--make-sign (function (lambda (string)
(replace-regexp-in-string
"^ *\\(&amp;#x201[34];\\)\\(.+\\)\\(&lt;br */&gt;\\|\n\\)"
"&lt;span class='alignright'&gt;\\1\\2&lt;/span&gt;\\3" string))))</b>)
"&lt;span class='float-right'&gt;\\1\\2&lt;/span&gt;\\3" string))))</b>)
(if (and slide-prop (string-match "segue" slide-prop))
(format "&lt;q&gt;\n%s&lt;/q&gt;"
<b>(funcall --make-sign contents)</b>)
Expand Down Expand Up @@ -433,7 +433,7 @@ <h3></h3>
</p>

<p>
<span class='alignright'>&#x2013; 柯文哲 Wen Jei, Ko. (2014)</span><br />
<span class='float-right'>&#x2013; 柯文哲 Wen Jei, Ko. (2014)</span><br />
</p>
</blockquote>

Expand Down Expand Up @@ -474,7 +474,7 @@ <h3></h3>
驀然回首<br />
那人卻在<br />
燈火闌珊處<br />
<span class='alignright'>&#x2013; 辛棄疾〈青玉案〉</span><br />
<span class='float-right'>&#x2013; 辛棄疾〈青玉案〉</span><br />
</p>

<div class="org-src-container">
Expand Down Expand Up @@ -826,7 +826,7 @@ <h3></h3>
This is what a normal QUOTE block looks like, which under a segue slide.
<br>
The second paragraph.
<span class='alignright'>&#x2013; Name Sign</span>
<span class='float-right'>&#x2013; Name Sign</span>

</q>

Expand Down
2 changes: 1 addition & 1 deletion example/index.org
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ A source block looks like this:
<b>(--make-sign (function (lambda (string)
(replace-regexp-in-string
"^ *\\(&#x201[34];\\)\\(.+\\)\\(<br */>\\|\n\\)"
"<span class='alignright'>\\1\\2</span>\\3" string))))</b>)
"<span class='float-right'>\\1\\2</span>\\3" string))))</b>)
(if (and slide-prop (string-match "segue" slide-prop))
(format "<q>\n%s</q>"
<b>(funcall --make-sign contents)</b>)
Expand Down
48 changes: 29 additions & 19 deletions ox-ioslide-helper.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,31 @@
("b" "Build List" ioslide/build-list)
("f" "Build + Fade List" ioslide/build-fade-list))
("Image"
("w" "Width" ioslide/image-width))
("Block"
("n" "Speaker Note" ioslide/speaker-note)
)))
(ioslide-property
(description "[Property] Apply on a single page.")
(actions
("w" "Width" ioslide/image-width)
("f" "Floating (Right/Left)" ioslide/image-float)
("t" "Move to Top (z-index)" ioslide/image-move-to-top))
("Block"
("n" "Speaker Note" ioslide/speaker-note)
)))
(ioslide-property
(description "[Property] Apply on a single page.")
(actions
("Font Size"
("m" "Smaller Font" ioslide/smaller)
("l" "Larger Font" ioslide/larger)
("L" "Large Font" ioslide/large))
("Set Page As..."
("s" "Segue" ioslide/segue)
("f" "Fill Image" ioslide/fill-image)
("t" "Thank-you-slide" ioslide/thank-you-slide))))
(ioslide-option
(description "[Option] Apply on the whole slode file")
(actions
("Insert"
("o" "Insert options template" ioslide/insert-options-template)
("m" "Remove MathJax from this slide file to save space" ioslide/remove-mathjax))
))
)
("Set Page As..."
("s" "Segue" ioslide/segue)
("f" "Fill Image" ioslide/fill-image)
("t" "Thank-you-slide" ioslide/thank-you-slide))))
(ioslide-option
(description "[Option] Apply on the whole slode file")
(actions
("Insert"
("o" "Insert options template" ioslide/insert-options-template)
("m" "Remove MathJax from this slide file to save space" ioslide/remove-mathjax))
))
)
)
(makey-initialize-key-groups ioslide-helper-menus)

Expand Down Expand Up @@ -129,6 +131,14 @@ The ugly-looking indentation mechanism is for build list."
(format ":width %s"
(read-from-minibuffer
"Width (recommended using px instead of %): ")))
(ioslide--define-attribute-inserter "image-float"
(format ":class float-%s"
(completing-read
"Float to (right/left): " '("right" "left") nil t)))

(ioslide--define-attribute-inserter "image-move-to-top" ":class z-index-999")


(ioslide--define-attribute-inserter "speaker-note"
":class note\n#+BEGIN_QUOTE\n\n#+END_QUOTE\n"
(previous-line 2))
Expand Down
24 changes: 17 additions & 7 deletions ox-ioslide.el
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ vertical slides."
:type 'integer)

(defvar org-ioslide--current-footnote-list nil)
(defvar org-ioslide--footnote-count-in-slide 0)

;;; Define Back-End

Expand Down Expand Up @@ -321,7 +322,7 @@ holding contextual information."
(lambda (string)
(replace-regexp-in-string
"^ *\\(&#x201[34];\\)\\(.+\\)\\(<br */>\\|\n\\)"
"<span class='alignright'>\\1\\2</span>\\3" string)))))
"<span class='float-right'>\\1\\2</span>\\3" string)))))
(if (and class (string-match "notes?" class))
(format "<aside class=\"note\">
<section>
Expand Down Expand Up @@ -356,7 +357,7 @@ CONTENTS is verse block contents. INFO is a plist holding
contextual information."
;; Align "-- Name" to right side.
(replace-regexp-in-string "^ *&#xa0;\\(?:&#xa0;\\)+\\(&#x201[34];\\)\\(.+?\\)\\(<br */>\\|\n\\)"
"<span class='alignright'>\\1\\2</span>\\3"
"<span class='float-right'>\\1\\2</span>\\3"
(org-html-verse-block verse-block contents info)))

;;;; Paragraph
Expand Down Expand Up @@ -631,14 +632,16 @@ holding contextual information."
;; Footnotes

(defun org-ioslide--footer-from-footnote ()
""
"Generate <footer> for footnotes in a single slide page."
(if org-ioslide--current-footnote-list
(prog1 (concat
"<footer class=\"source\">\n"
(mapconcat #'identity (reverse org-ioslide--current-footnote-list) "\n")
"\n</footer>")
;; clean list
(setq org-ioslide--current-footnote-list nil))
;; clean list & footnote count
(setq org-ioslide--current-footnote-list nil)
(setq org-ioslide--footnote-count-in-slide 0)
)
""))

(defun org-ioslide-footnote-reference (footnote-reference contents info)
Expand All @@ -658,12 +661,19 @@ CONTENTS is nil. INFO is a plist holding contextual information."
;; Otherwise, add it into org-ioslide--current-footnote-list
(t
(let ((def (org-export-get-footnote-definition footnote-reference info)))
(incf org-ioslide--footnote-count-in-slide)
(push
(format "%s" (org-trim (org-export-data def info)))
;; [FIXME] `replace-regexp' as ugly workaround because I don't
;; know how to redefine the back-end for footnote-definition
(replace-regexp-in-string "<p class=\"footpara\">"
(format "<p class=\"footpara\">%s. " org-ioslide--footnote-count-in-slide)
(org-trim (org-export-data def info)))
org-ioslide--current-footnote-list)
""
;; Add number as <sup>
(format "<sup>%s</sup>" org-ioslide--footnote-count-in-slide)
)))))


(defun org-ioslide-inner-template (contents info)
"Return body of document string after HTML conversion.
CONTENTS is the transcoded contents string. INFO is a plist
Expand Down
Loading

0 comments on commit a44c7f5

Please sign in to comment.