From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre de Buyl Subject: Re: [Orgmode] S5 export Date: Fri, 3 Jun 2011 07:38:35 -0400 Message-ID: <853CA2B4-BD3A-4CB6-953E-775CEEDBBCDA@ulb.ac.be> References: <28A74B24-4011-4F2D-AA51-7E18C4765669@chem.utoronto.ca> <87oc6tf2x3.fsf@gnu.org> <4F2BA09B-8330-4A94-923D-3E9A98F2F32B@ulb.ac.be> <87d3ixfa3x.fsf@gmail.com> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: multipart/mixed; boundary=Apple-Mail-23-228917173 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSSiE-0005Xf-0M for emacs-orgmode@gnu.org; Fri, 03 Jun 2011 07:38:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QSSiB-0000Db-S5 for emacs-orgmode@gnu.org; Fri, 03 Jun 2011 07:38:45 -0400 Received: from mxin.ulb.ac.be ([164.15.128.112]:52030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSSiB-0000D7-5M for emacs-orgmode@gnu.org; Fri, 03 Jun 2011 07:38:43 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --Apple-Mail-23-228917173 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hello Eric, This is amazing, actual emacs lisp code from my explanations, thanks a lot! If welcomed, I have a few comments related to how I currently use this function (I have a talk coming soon :-) ) - If all "star" headlines become slides, it quickly leads to awkward layouts with empty slides below one star headings. I made a modification to the code to choose only one star headings as slides. This way, level 2 headings can be used as "in slide" headings. I used an (if (looking-at "^\\* ") XXX) in the preprocess hook for that. - An actual "title page" seems more appropriate, so I added one with "title author date" as h1,h2 and h3 headings. The css need to be tweaked a little bit to get nice results. My modified org-export-as-s5 function is attached. --Apple-Mail-23-228917173 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name=org-export-as-s5.el Content-Disposition: attachment; filename=org-export-as-s5.el (defun org-export-as-s5 (arg &optional hidden ext-plist to-buffer body-only pub-dir) "Wrap `org-export-as-html' in setting for S5 export." (interactive "P") (flet ((join (lst) (mapconcat #'identity lst "\n")) (sheet (href media id) (org-fill-template (concat "") `(("href" . ,href) ("media" . ,media) ("id" . ,id))))) (let ((org-export-html-style-extra (join `("" "" "" "" ,(sheet "ui/default/slides.css" "projection" "slideProj") ,(sheet "ui/default/outline.css" "screen" "outlineStyle") ,(sheet "ui/default/print.css" "print" "slidePrint") ,(sheet "ui/default/opera.css" "projection" "operaFix") "" ,(concat "")))) (org-export-html-toplevel-hlevel 1) (org-export-headline-levels 2) (org-export-preprocess-hook (list (lambda () (let ((class "slide")) (org-map-entries (lambda () (save-excursion ;; from `org-export-remember-html-container-classes' (org-back-to-heading t) (if (looking-at "^\\* ") (put-text-property (point-at-bol) (point-at-eol) 'html-container-class class)))))) ))) (org-export-html-final-hook (list (lambda () (save-excursion (replace-regexp (regexp-quote "
") (mapconcat #'identity `("
" "
" "
" "
" "
" ,(format "

%s - %s

" author title) "
" "
" "" "
" "
" ,(format "

%s

%s

%s

" title author date) "
") "\n")))) (lambda () (save-excursion (replace-regexp (regexp-quote "
") "
")))))) (org-export-as-html arg hidden ext-plist to-buffer body-only pub-dir)))) --Apple-Mail-23-228917173 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed I also posted an example online. It it exported from the file s5-=20 test.org with the function defined in the attached file. The css is =20 very slightly modified. The "scientific content" of the talk is incomplete, this is normal :-/ http://homepages.ulb.ac.be/~pdebuyl/lectures/s5-test.html http://homepages.ulb.ac.be/~pdebuyl/lectures/s5-test.org For those reading, I'll mention that using the html export, as done =20 here, allows to include syntax-highlighted code and LaTeX equations =20 very easily. Regards, Pierre Le 1 juin 11 =E0 18:41, Eric Schulte a =E9crit : > Hi Pierre, > > I've taken your very thorough S5 instructions and converted them =20 > into a > single `org-export-as-s5' function. The attached archive file =20 > holds an > s5.org Org-mode file which defines this function, as well as the ui > directory required for S5, and an html file which results from calling > the `org-export-as-s5' function in the s5.org file. > > For now the results are also posted up at > http://cs.unm.edu/~eschulte/notes/s5/s5.org > http://cs.unm.edu/~eschulte/notes/s5/s5.html > > Thanks for the clear explanation which lead to such an easy =20 > translation > into elisp. Please let me know if you think this should be =20 > augmented in > any way, or if the defined function throws any errors on your system. > > Best -- Eric > > > Pierre de Buyl writes: > >> Hello, >> >> After a lot a reading of org-exp.el and org-html.el I finally figured >> out the >> existence of the "HTML_CONTAINER_CLASS" property. >> >> I could then figure a minimal way to make a s5 presentation. >> Minimal in the sens of minimum difference with the html exporter. >> >> After setting a few STYLE and OPTIONS lines in an org file, >> three steps are needed: >> 1. Set the HTML_CONTAINER_CLASS to "slide" on level 1 headings >> 2. Set org-export-html-toplevel-hlevel to "1", so that slide titles >> behave properly >> 3. Replace in the html output >>
>> by >>
>>
>>
>>
>>
>>

Interactive Python plotting

>>
>>
>> >>
>> >> You need the "ui" directory from the S5 archive to make it work >> indeed, http://meyerweb.com/eric/tools/s5/ . >> I attach an example org file and the resulting html (which was =20 >> tweaked >> according to step 3). >> >> Pierre >> >> >> >> >> >> Le 3 f=E9vr. 11 =E0 12:23, Bastien a =E9crit : >> >>> Hi Pierre, >>> >>> Pierre de Buyl writes: >>> >>>> S5 allows one to present a slideshow in a web browser, even full >>>> screen for >>>> some browsers. >>>> I know that the topic has come here already, but I actually hacked >>>> the >>>> excellent org-html.el export file to produde a S5 slideshow with =20= >>>> org. >>> >>> This looks useful. >>> >>> By reading your code, I see org-export-as-s5 is a variation over >>> org-export-as-html. >>> >>> I would welcome an approach where we factor out some elements of >>> org-export-as-html, so that exporting to s5 would just require the >>> user to customize those elements. >>> >>> Does that seem reasonable to you? Would you volunteer to make >>> org-export-as-html a bit more general? Even a precise comparison >>> of org-export-as-s5 against org-export-as-html would be helpful at >>> this point. >>> >>> Thanks! >>> >>> --=20 >>> Bastien >> > > --=20 > Eric Schulte > http://cs.unm.edu/~eschulte/ --Apple-Mail-23-228917173--