mirror of https://github.com/yjwen/org-reveal.git
Merge branch 'master' of https://github.com/yjwen/org-reveal
This commit is contained in:
commit
9f26bcca27
104
Makefile
104
Makefile
|
@ -12,11 +12,14 @@ default: help all
|
||||||
|
|
||||||
srcs?=$(wildcard *.org | sort)
|
srcs?=$(wildcard *.org | sort)
|
||||||
objs?=${srcs:.org=.html}
|
objs?=${srcs:.org=.html}
|
||||||
target?=$(shell echo ${srcs:.org=} | head -n1)
|
target?=$(shell echo ${srcs:.org=} | tr ' ' '\n' | head -n1)
|
||||||
reveal_url?=https://github.com/hakimel/reveal.js/
|
reveal_url?=https://github.com/hakimel/reveal.js/
|
||||||
reveal_zip_url?=https://github.com/hakimel/reveal.js/archive/master.zip
|
reveal_zip_url?=https://github.com/hakimel/reveal.js/archive/master.zip
|
||||||
reveal_dir?=./reveal.js
|
reveal_dir?=./reveal.js
|
||||||
sudo?=sudo
|
sudo?=sudo
|
||||||
|
deploy_branch?=gh-pages
|
||||||
|
cache_dir?=./cache/url
|
||||||
|
make?=make -f ${CURDIR}/Makefile
|
||||||
|
|
||||||
|
|
||||||
help:
|
help:
|
||||||
|
@ -26,6 +29,8 @@ help:
|
||||||
@echo "# make all # Build html"
|
@echo "# make all # Build html"
|
||||||
@echo "# make start # View HTML in Web browser"
|
@echo "# make start # View HTML in Web browser"
|
||||||
@echo "# make download # Download deps"
|
@echo "# make download # Download deps"
|
||||||
|
@echo "# make offline # Cache inlined resources and generate cached pages"
|
||||||
|
@echo "# make upload # to build and publish"
|
||||||
@echo "# make setup/debian setup download start # ..."
|
@echo "# make setup/debian setup download start # ..."
|
||||||
@echo "# Config:"
|
@echo "# Config:"
|
||||||
@echo "# srcs=${srcs}"
|
@echo "# srcs=${srcs}"
|
||||||
|
@ -36,6 +41,7 @@ all: ${objs}
|
||||||
ls $^
|
ls $^
|
||||||
|
|
||||||
download: ${reveal_dir}
|
download: ${reveal_dir}
|
||||||
|
ls $^
|
||||||
|
|
||||||
start: ${target}.html
|
start: ${target}.html
|
||||||
x-www-browser $<
|
x-www-browser $<
|
||||||
|
@ -94,8 +100,8 @@ html: ${target}.html
|
||||||
|
|
||||||
all/%: ${srcs}
|
all/%: ${srcs}
|
||||||
for src in $^ ; do \
|
for src in $^ ; do \
|
||||||
dir=$$(dirname -- "$${src}") ; \
|
target=$$(echo "$${src}" | sed -e 's|\.org$$||g') ; \
|
||||||
make target="$${dir}/index" ${@F} \
|
make target="$${target}" "${@F}" \
|
||||||
|| exit $$? ; \
|
|| exit $$? ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -104,4 +110,94 @@ ${reveal_dir}:
|
||||||
wget -O- ${reveal_zip_url} > reveal.js.zip
|
wget -O- ${reveal_zip_url} > reveal.js.zip
|
||||||
unzip reveal.js.zip
|
unzip reveal.js.zip
|
||||||
mv reveal.js-master ${@}
|
mv reveal.js-master ${@}
|
||||||
@rm -f tmp.zip
|
@rm -f reveal.js.zip
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
-git commit -sam "WIP: About to deploy ${target}"
|
||||||
|
git checkout ${deploy_branch} \
|
||||||
|
|| git checkout -b ${deploy_branch} master
|
||||||
|
make html
|
||||||
|
git add -f ${target}.html
|
||||||
|
-git commit -am "WIP: Generated html ${target}"
|
||||||
|
git checkout master
|
||||||
|
|
||||||
|
upload:
|
||||||
|
git checkout master
|
||||||
|
-git branch -D ${deploy_branch}
|
||||||
|
git checkout -b ${deploy_branch}
|
||||||
|
-git commit -sam "WIP: About to download"
|
||||||
|
make download
|
||||||
|
git add -f "${reveal_dir}"
|
||||||
|
-git commit -sam "WIP: Add ${reveal_dir}"
|
||||||
|
${MAKE} all/deploy
|
||||||
|
git checkout ${deploy_branch}
|
||||||
|
echo "# About to push to origin in 5 secs ?"
|
||||||
|
sleep 5 ; git push -f origin HEAD:gh-pages
|
||||||
|
git checkout master
|
||||||
|
|
||||||
|
%.lst: %.org Makefile
|
||||||
|
echo "" > "$@"
|
||||||
|
-grep -o -e 'https\?://[^]"]*' -- "$<" \
|
||||||
|
| grep -E ".**\.(gif|png|svg|jpg|jpeg|webm|mp4)"\
|
||||||
|
| sort -u >> "$@.tmp"
|
||||||
|
mv "$@.tmp" "$@"
|
||||||
|
|
||||||
|
|
||||||
|
%/curl:
|
||||||
|
@mkdir -p http https
|
||||||
|
@ln -fs http http:
|
||||||
|
@ln -fs https https:
|
||||||
|
ls "${@D}" > /dev/null 2>&1 \
|
||||||
|
|| curl --create-dirs -o "./${@D}" -- "${@D}"
|
||||||
|
find . -iname "*#*" | while read file; do \
|
||||||
|
basename=$$(basename -- "$${file}"); \
|
||||||
|
dirname=$$(dirname -- "$${file}"); \
|
||||||
|
dstname=$$(echo "$${basename}" | sed -e 's|#.|%23.|g'); \
|
||||||
|
ln -fs "$${basename}" "$${dirname}/$${dstname}"; \
|
||||||
|
dstname=$$(echo "$${basename}" | sed -e 's|#.||g'); \
|
||||||
|
ln -fs "$${basename}" "$${dirname}/$${dstname}"; \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: cache
|
||||||
|
cache: ${target}.lst Makefile
|
||||||
|
@mkdir -p "${<D}/${cache_dir}"
|
||||||
|
cd "${<D}/${cache_dir}" && \
|
||||||
|
cat "${CURDIR}/$<" | while read url ; do \
|
||||||
|
${make} $${url}/curl || exit $$? ; \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
${target}._cache.org: ${target}.lst ${target}.org cache reveal.js
|
||||||
|
sed -e 's|^#+REVEAL_ROOT:.*|#+REVEAL_ROOT: ${CURDIR}/reveal.js|g' \
|
||||||
|
< ${target}.org > $@.tmp
|
||||||
|
sort -u $< | while read url; do \
|
||||||
|
sed -e "s|$${url}|${cache_dir}/$${url}|g" \
|
||||||
|
-e "s|${cache_dir}/http://|${cache_dir}/http/|g" \
|
||||||
|
-e "s|${cache_dir}/https://|${cache_dir}/https/|g" \
|
||||||
|
-i "${@}.tmp" ; \
|
||||||
|
done
|
||||||
|
mv "${@}.tmp" "$@"
|
||||||
|
|
||||||
|
html-cache: ${target}.org ${target}._cache.org
|
||||||
|
make html target="${target}._cache"
|
||||||
|
sed -e "s|#./|/./|g" -i "${target}._cache.html"
|
||||||
|
|
||||||
|
offline: all/cache all/html-cache
|
||||||
|
sync
|
||||||
|
|
||||||
|
offline/start: offline
|
||||||
|
${MAKE} ${@F} target="${target}._cache"
|
||||||
|
|
||||||
|
commit/offline:
|
||||||
|
-git branch -D ${@F}/master
|
||||||
|
git checkout -b ${@F}/master
|
||||||
|
${MAKE} download
|
||||||
|
-git add -f .
|
||||||
|
-git commit -am 'deploy: Cache downloaded files'
|
||||||
|
${MAKE} cache
|
||||||
|
-git add -f .
|
||||||
|
-git commit -am 'deploy: Cache downloaded files, see lst file for sources'
|
||||||
|
${MAKE} ${@F}
|
||||||
|
-git add -f .
|
||||||
|
-git commit -am 'deploy: Render cached files'
|
||||||
|
|
25
Readme.org
25
Readme.org
|
@ -12,7 +12,7 @@
|
||||||
#+REVEAL_EXTRA_CSS: ./local.css
|
#+REVEAL_EXTRA_CSS: ./local.css
|
||||||
|
|
||||||
[[http://melpa.org/#/ox-reveal][file:http://melpa.org/packages/ox-reveal-badge.svg]]
|
[[http://melpa.org/#/ox-reveal][file:http://melpa.org/packages/ox-reveal-badge.svg]]
|
||||||
[[http://www.gnu.org/licenses/gpl-3.0.html][http://img.shields.io/:license-gpl3-blue.svg]]
|
[[http://www.gnu.org/licenses/gpl-3.0.html][file:https://img.shields.io/:license-gpl3-blue.svg]]
|
||||||
|
|
||||||
* Table of Contents
|
* Table of Contents
|
||||||
Title links are for viewing within org-mode buffer only. *Github
|
Title links are for viewing within org-mode buffer only. *Github
|
||||||
|
@ -42,6 +42,7 @@
|
||||||
- [[Single Image Background][Single Image Background]]([[https://github.com/yjwen/org-reveal#single-image-background][gh]])
|
- [[Single Image Background][Single Image Background]]([[https://github.com/yjwen/org-reveal#single-image-background][gh]])
|
||||||
- [[Repeating Image Background][Repeating Image Background]]([[https://github.com/yjwen/org-reveal#repeating-image-background][gh]])
|
- [[Repeating Image Background][Repeating Image Background]]([[https://github.com/yjwen/org-reveal#repeating-image-background][gh]])
|
||||||
- [[Title Slide Background Image][Title Slide Background Image]]([[https://github.com/yjwen/org-reveal#title-slide-background-image][gh]])
|
- [[Title Slide Background Image][Title Slide Background Image]]([[https://github.com/yjwen/org-reveal#title-slide-background-image][gh]])
|
||||||
|
- [[Table of Contents Slide Background Image][Table of Contents Slide Background Image]]([[https://github.com/yjwen/org-reveal#table-of-contents-slide-background-image][gh]])
|
||||||
- [[Background for all slides][Background for all slides]]([[https://github.com/yjwen/org-reveal#background-for-all-slides][gh]])
|
- [[Background for all slides][Background for all slides]]([[https://github.com/yjwen/org-reveal#background-for-all-slides][gh]])
|
||||||
#+REVEAL: split:t
|
#+REVEAL: split:t
|
||||||
- [[Slide Size][Slide Size]]([[https://github.com/yjwen/org-reveal#slide-size][gh]])
|
- [[Slide Size][Slide Size]]([[https://github.com/yjwen/org-reveal#slide-size][gh]])
|
||||||
|
@ -387,6 +388,15 @@ Available transitions are: default|cube|page|concave|zoom|linear|fade|none.
|
||||||
* =REVEAL_TITLE_SLIDE_BACKGROUND_SIZE=: HTML size specification, e.g. ~200px~.
|
* =REVEAL_TITLE_SLIDE_BACKGROUND_SIZE=: HTML size specification, e.g. ~200px~.
|
||||||
* =REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT=: Set to ~repeat~ to repeat the image.
|
* =REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT=: Set to ~repeat~ to repeat the image.
|
||||||
* =REVEAL_TITLE_SLIDE_BACKGROUND_OPACITY=: Set the background opacity.
|
* =REVEAL_TITLE_SLIDE_BACKGROUND_OPACITY=: Set the background opacity.
|
||||||
|
*** Table of Contents Slide Background Image
|
||||||
|
|
||||||
|
To set the (automatically generated) table of contents slide's background
|
||||||
|
image, please specify the following options:
|
||||||
|
|
||||||
|
* =REVEAL_TOC_SLIDE_BACKGROUND=: A URL to the background image.
|
||||||
|
* =REVEAL_TOC_SLIDE_BACKGROUND_SIZE=: HTML size specification, e.g. ~200px~.
|
||||||
|
* =REVEAL_TOC_SLIDE_BACKGROUND_REPEAT=: Set to ~repeat~ to repeat the image.
|
||||||
|
* =REVEAL_TOC_SLIDE_BACKGROUND_OPACITY=: Set the background opacity.
|
||||||
*** Background for all slides
|
*** Background for all slides
|
||||||
|
|
||||||
You can also configure the background for all slides in the presentation with:
|
You can also configure the background for all slides in the presentation with:
|
||||||
|
@ -609,6 +619,19 @@ can have one optional ~%s~ to be replaced by ~reveal-root~.
|
||||||
The "%r" in the given CSS file name will be replaced by Reveal.js'
|
The "%r" in the given CSS file name will be replaced by Reveal.js'
|
||||||
URL.
|
URL.
|
||||||
|
|
||||||
|
Reveal.js supports to enable line numbers and highlighting on
|
||||||
|
given line numbers. Please use ~:code_attribs~ to pass [[https://github.com/hakimel/reveal.js#line-numbers--highlights][the proper
|
||||||
|
attributes]] to the source code block . Below is an example.
|
||||||
|
#+BEGIN_SRC org
|
||||||
|
,#+ATTR_REVEAL: :code_attribs data-line-numbers='1|3'
|
||||||
|
,#+BEGIN_SRC c++
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
cout << "Hello" << endl;
|
||||||
|
}
|
||||||
|
,#+END_SRC
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** Editable Source Code
|
** Editable Source Code
|
||||||
It is now possible to embed code blocks in a codemirror instance in order to edit code during a presentation. At present, this capacity is turned on or off at time export using these defcustoms:
|
It is now possible to embed code blocks in a codemirror instance in order to edit code during a presentation. At present, this capacity is turned on or off at time export using these defcustoms:
|
||||||
- ~org-reveal-klipsify-src~
|
- ~org-reveal-klipsify-src~
|
||||||
|
|
29
ox-reveal.el
29
ox-reveal.el
|
@ -73,6 +73,12 @@
|
||||||
(:reveal-title-slide-background-repeat "REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT" nil nil t)
|
(:reveal-title-slide-background-repeat "REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT" nil nil t)
|
||||||
(:reveal-title-slide-background-transition "REVEAL_TITLE_SLIDE_BACKGROUND_TRANSITION" nil nil t)
|
(:reveal-title-slide-background-transition "REVEAL_TITLE_SLIDE_BACKGROUND_TRANSITION" nil nil t)
|
||||||
(:reveal-title-slide-background-opacity "REVEAL_TITLE_SLIDE_BACKGROUND_OPACITY" nil nil t)
|
(:reveal-title-slide-background-opacity "REVEAL_TITLE_SLIDE_BACKGROUND_OPACITY" nil nil t)
|
||||||
|
(:reveal-toc-slide-background "REVEAL_TOC_SLIDE_BACKGROUND" nil nil t)
|
||||||
|
(:reveal-toc-slide-background-size "REVEAL_TOC_SLIDE_BACKGROUND_SIZE" nil nil t)
|
||||||
|
(:reveal-toc-slide-background-position "REVEAL_TOC_SLIDE_BACKGROUND_POSITION" nil nil t)
|
||||||
|
(:reveal-toc-slide-background-repeat "REVEAL_TOC_SLIDE_BACKGROUND_REPEAT" nil nil t)
|
||||||
|
(:reveal-toc-slide-background-transition "REVEAL_TOC_SLIDE_BACKGROUND_TRANSITION" nil nil t)
|
||||||
|
(:reveal-toc-slide-background-opacity "REVEAL_TOC_SLIDE_BACKGROUND_OPACITY" nil nil t)
|
||||||
(:reveal-default-slide-background "REVEAL_DEFAULT_SLIDE_BACKGROUND" nil nil t)
|
(:reveal-default-slide-background "REVEAL_DEFAULT_SLIDE_BACKGROUND" nil nil t)
|
||||||
(:reveal-default-slide-background-size "REVEAL_DEFAULT_SLIDE_BACKGROUND_SIZE" nil nil t)
|
(:reveal-default-slide-background-size "REVEAL_DEFAULT_SLIDE_BACKGROUND_SIZE" nil nil t)
|
||||||
(:reveal-default-slide-background-position "REVEAL_DEFAULT_SLIDE_BACKGROUND_POSITION" nil nil t)
|
(:reveal-default-slide-background-position "REVEAL_DEFAULT_SLIDE_BACKGROUND_POSITION" nil nil t)
|
||||||
|
@ -683,9 +689,28 @@ dependencies: [
|
||||||
"Build a slide of table of contents."
|
"Build a slide of table of contents."
|
||||||
(let ((toc (org-html-toc depth info)))
|
(let ((toc (org-html-toc depth info)))
|
||||||
(when toc
|
(when toc
|
||||||
(let ((toc-slide-with-header (plist-get info :reveal-slide-global-header))
|
(let ((toc-slide-background (plist-get info :reveal-toc-slide-background))
|
||||||
|
(toc-slide-background-size (plist-get info :reveal-toc-slide-background-size))
|
||||||
|
(toc-slide-background-position (plist-get info :reveal-toc-slide-background-position))
|
||||||
|
(toc-slide-background-repeat (plist-get info :reveal-toc-slide-background-repeat))
|
||||||
|
(toc-slide-background-transition (plist-get info :reveal-toc-slide-background-transition))
|
||||||
|
(toc-slide-background-opacity (plist-get info :reveal-toc-slide-background-opacity))
|
||||||
|
(toc-slide-with-header (plist-get info :reveal-slide-global-header))
|
||||||
(toc-slide-with-footer (plist-get info :reveal-slide-global-footer)))
|
(toc-slide-with-footer (plist-get info :reveal-slide-global-footer)))
|
||||||
(concat "<section id=\"table-of-contents\">\n"
|
(concat "<section id=\"table-of-contents\""
|
||||||
|
(when toc-slide-background
|
||||||
|
(concat " data-background=\"" toc-slide-background "\""))
|
||||||
|
(when toc-slide-background-size
|
||||||
|
(concat " data-background-size=\"" toc-slide-background-size "\""))
|
||||||
|
(when toc-slide-background-position
|
||||||
|
(concat " data-background-position=\"" toc-slide-background-position "\""))
|
||||||
|
(when toc-slide-background-repeat
|
||||||
|
(concat " data-background-repeat=\"" toc-slide-background-repeat "\""))
|
||||||
|
(when toc-slide-background-transition
|
||||||
|
(concat " data-background-transition=\"" toc-slide-background-transition "\""))
|
||||||
|
(when toc-slide-background-opacity
|
||||||
|
(concat " data-background-opacity=\"" toc-slide-background-opacity "\""))
|
||||||
|
">"
|
||||||
(when toc-slide-with-header
|
(when toc-slide-with-header
|
||||||
(let ((header (plist-get info :reveal-slide-header)))
|
(let ((header (plist-get info :reveal-slide-header)))
|
||||||
(when header (format "<div class=\"slide-header\">%s</div>\n" header))))
|
(when header (format "<div class=\"slide-header\">%s</div>\n" header))))
|
||||||
|
|
Loading…
Reference in New Issue