# -*- mode: org; coding: utf-8; ispell-local-dictionary: "german8"; -*- * DONE lazyblorg: Syntax-tests of the Currently Supported Org mode Syntax Elements from the Parser and HTMLizer :hidden:publicvoit:lazyblorg:MixedCaseTag:blog: CLOSED: [2014-01-30 Thu 13:01] :LOGBOOK: - State "DONE" from "DONE" [2014-02-01 Sat 15:03] - State "DONE" from "" [2014-01-30 Thu 14:02] :END: :PROPERTIES: :CREATED: [2014-01-28 Tue 12:00] :ID: 2014-01-27-full-syntax-test :END: This is a test entry for testing all currently implemented Org mode syntax elements. Please do learn about the supported Org mode elements [[https://github.com/novoid/lazyblorg/wiki/Orgmode-Elements][on this wiki page]]. You can find following files online in order to be able to compare the Org mode source with the generated files from the result: - [[https://github.com/novoid/lazyblorg/blob/master/testdata/end_to_end_test/orgfiles/currently_supported_orgmode_syntax.org][Org mode source]] - [[https://github.com/novoid/lazyblorg/tree/master/testdata/end_to_end_test/comparison/2014/01/30/full-syntax-test][Result directory]] containing [[https://github.com/novoid/lazyblorg/blob/master/testdata/end_to_end_test/comparison/2014/01/30/full-syntax-test/index.html][HTML page]] and attached images ** Implicit Org mode Elements in This File :PROPERTIES: :CREATED: [2014-02-02 Sun 14:24] :END: - headings - article tags - paragraphs ** Drawers and Time-Stamps Note: the time-stamps in the LOGBOOK and PROPERTIES drawers above are set to different days so that it is possible to check which time-stamp is used for what blog elements. #+NAME: A copy of the header #+BEGIN_VERSE CLOSED: [2014-01-30 Thu 13:01] :LOGBOOK: - State "DONE" from "DONE" [2014-02-01 Sat 15:03] - State "DONE" from "" [2014-01-30 Thu 14:02] :END: :PROPERTIES: :CREATED: [2014-01-28 Tue 12:00] :ID: 2014-01-27-full-syntax-test :END: #+END_VERSE ** Basic Text Formatting :PROPERTIES: :CREATED: [2014-01-30 Thu 16:33] :END: This is *bold* and *bold case*. And this is ~teletype style~. =And= this is inline =verbatim= text also on the end of a =line= Examples with line-breaks in between: *This is a bold sentence which has a line break*. yqrashawn has implemented support for +strike-through+. Thank you +very+ & +very+ much. Even at the +end of the line+ *** not yet implemented :noexport: and /italic/ and _underlined_ : This is a verbose statement. : With a second line. : ... and a third one http://heise.de *not bold* foobar ** Comment Lines Starting With Hashes :PROPERTIES: :CREATED: [2015-05-25 Mon 13:56] :END: According to [[http://orgmode.org/manual/Comment-lines.html][the org-mode manual]], lines starting with the character '#' should be ignored. # This is not part of the output # This is not part of the output ## This is part of the output ** URLs Without brackets: http://heise.de With brackets and no description: [[http://heise.de]] With brackets and a description: [[http://heise.de][heise]] URLs with line breaks within: this is a very tough example of [[https://github.com/novoid/lazyblorg][an url like this which is very long]]. Multiple URLs in one line: http://heise.de [[http://heise.de]] [[http://heise.de][heise]] ** Links to IDs :PROPERTIES: :CREATED: [2014-03-02 Sun 19:22] :END: You'll need a blog article =PROPERTY= drawer with an =:ID:= property set to a value like the following: #+BEGIN_VERSE :PROPERTIES: :CREATED: [2014-01-28 Tue 12:00] :ID: 2014-01-27-full-syntax-test :END: #+END_VERSE Now you are able to link to this article and lazyblorg creates a HTML link to the resulting article page: simple links: [[id:2014-01-27-full-syntax-test]] with description: [[id:2014-01-27-full-syntax-test][this is the description text]] with formatted description: [[id:2014-01-27-full-syntax-test][this is a *formatted* ~description~ text]] ** Deprecated HTML-blocks :PROPERTIES: :CREATED: [2014-01-30 Thu 15:09] :END: Previous to Org mode version 8, HTML blocks could be defined like: #+BEGIN_HTML

This is without any title

#+END_HTML #+NAME: Example HTML snippet #+BEGIN_HTML This is with a title #+END_HTML ** HTML-blocks :PROPERTIES: :CREATED: [2016-11-06 Sun 14:42] :END: #+BEGIN_EXPORT HTML

This is without any title

#+END_EXPORT #+NAME: Example HTML snippet #+BEGIN_EXPORT HTML This is with a title #+END_EXPORT #+BEGIN_export html

Lower-case example. This is without any title

#+END_export ** EXAMPLE-blocks :PROPERTIES: :CREATED: [2014-02-02 Sun 14:21] :END: #+BEGIN_EXAMPLE UPPER-case example without name indented line another indented line This is *bold* and ~teletype~ with an URL https://github.com/novoid/lazyblorg and such. Last line. This is a multi-line paragraph to demonstrate the behavior of line break and so on. As you can see, the line breaks are now different from Org mode source or not. #+END_EXAMPLE #+begin_example lower-case example without name #+end_example #+NAME: a name #+BEGIN_EXAMPLE UPPER-case example with name #+END_EXAMPLE #+NAME: Another name #+begin_example lower-case example with name #+end_example ** COLON-blocks :PROPERTIES: :CREATED: [2014-08-10 Sun 18:10] :END: This is how a colon-block looks like in Org mode: #+BEGIN_EXAMPLE : This is an example colon-block as shown in Org mode : : It can consist of multiple lines. : This is *bold* and ~teletype~ with an URL https://github.com/novoid/lazyblorg and such. : explicit URL [[http://Karl-Voit.at]] : : However, the current parser needs at least one empty line following a colon block. #+END_EXAMPLE This is what lazyblorg does with it: : This is an example colon-block as shown in Org mode : : It can consist of multiple lines. : This is *bold* and ~teletype~ with an URL https://github.com/novoid/lazyblorg and such. : explicit URL [[http://Karl-Voit.at]] and : a non-existent internal id reference [[id:ignoreme-not-existing]] : also with some description [[id:ignoreme-not-existing][this is a description]] : : However, the current parser needs at least one empty line following a colon block. ** QUOTE-blocks :PROPERTIES: :CREATED: [2014-02-02 Sun 16:47] :END: #+BEGIN_QUOTE UPPER-case quote without name indented line another indented line This is *bold* and ~teletype~ with an URL https://github.com/novoid/lazyblorg and such. Last line. This is a multi-line paragraph to demonstrate the behavior of line break and so on. As you can see, the line breaks are now different from Org mode source or not. #+END_QUOTE #+begin_quote lower-case quote without name #+end_quote #+NAME: a name #+BEGIN_QUOTE UPPER-case quote with name #+END_QUOTE #+NAME: Another name #+begin_quote lower-case quote with name #+end_quote ** VERSE-blocks :PROPERTIES: :CREATED: [2014-02-02 Sun 16:47] :END: #+BEGIN_VERSE UPPER-case verse without name indented line another indented line This is *bold* and ~teletype~ with an URL https://github.com/novoid/lazyblorg and such. Last line. This is a multi-line paragraph to demonstrate the behavior of line break and so on. As you can see, the line breaks are now different from Org mode source or not. #+END_VERSE #+begin_verse lower-case verse without name #+end_verse #+NAME: a name #+BEGIN_VERSE UPPER-case verse with name #+END_VERSE #+NAME: Another name #+begin_verse lower-case verse with name #+end_verse ** SRC-blocks :PROPERTIES: :CREATED: [2014-02-02 Sun 16:47] :END: #+BEGIN_SRC UPPER-case src without name indented line another indented line This is *bold* and ~teletype~ with an URL https://github.com/novoid/lazyblorg and such. Last line. This is a multi-line paragraph to demonstrate the behavior of line break and so on. As you can see, the line breaks are now different from Org mode source or not. #+END_SRC #+begin_src lower-case src without name #+end_src #+NAME: a name #+BEGIN_SRC UPPER-case src with name #+END_SRC #+NAME: Another name #+begin_src lower-case src with name #+end_src #+BEGIN_SRC python test = 42; print "Hello Python world!" if test == 42: print "yes, it is 42" else: print "there is something phishy around here." #+END_SRC ** LaTeX-blocks :PROPERTIES: :CREATED: [2016-11-06 Sun 14:43] :END: #+BEGIN_EXPORT LaTeX This is a mixed case \LaTeX{} block without a name. Indented line. Another paragraph. Mathematical expression: $42 * 7 = \frac{c}{45x}$ \begin{table} \centering \begin{tabular}{lcr} This is the first column & This is the second & This is the third \\ foo & bar & baz \\ 1 & 2 & 3 \end{tabular} \caption{This is the caption} \label{tab:mylatextable} \end{table} \begin{itemize} \item First item \item Second item \begin{enumerate} \item First enumerate \item Second enumerate \end{enumerate} \item Last \end{itemize} \begin{verbatim} This is verbatim. Second line. Third line. \end{verbatim} \begin{verse} This is verse. Second line. Third line. \end{verse} \begin{quote} This is qote. Second line. Third line. \end{quote} \begin{eqnarray} \label{eq:my-eqn-array} x^2_\text{eff} = \frac{\text{result}}{42*23/7} \end{eqnarray} #+END_EXPORT #+BEGIN_EXPORT LATEX This is an UPPER case \LaTeX{} block without a name. #+END_EXPORT #+begin_export latex This is a lower case \LaTeX{} block without a name. #+end_export ** noexport-tags in headings *** ignored heading with lower-case tag :noexport: **** ignored sub-heading of a noexport heading *** ignored heading with upper-case tag :NOEXPORT: **** ignored sub-heading of a noexport heading *** not ignored because it got no :noexport: tag set This is somewhat tricky because it contains a tag surrounded by colons. *** not ignored because it got no :NOEXPORT: tag set This is somewhat tricky because it contains a tag surrounded by colons. ** Hidden blog entries :PROPERTIES: :CREATED: [2014-04-18 Fri 16:52] :END: If you tag an lazyblorg-blog-entry with "hidden" (~TAG_FOR_HIDDEN~), the blog article will be generated. However, there will be no link in the Atom feeds, no link from the entry page, and no link on the navigation pages. ** Horizontal Rule :PROPERTIES: :CREATED: [2014-02-02 Sun 14:25] :END: Horizontal rules end up only in a wider vertical space. Between this and the previous paragraph, there is no horizontal rule. --------- Between this and the previous paragraph, there was an horizontal rule. ** Lists :PROPERTIES: :CREATED: [2014-01-30 Thu 16:20] :END: Simple lists: - first line - second line - another list in a list - don't get confused - even more lists - bah! - back to first list Ordered lists with multi-line items: 1. first line 2. second line 1. another list in a list with very long lines that are too long for one line; in fact, [[http://example.org/testlink][this list item]] spans over a couple of lines - more than even two of them 2. don't get confused 1. even more lists 2. bah! 3. back to first list Mixed lists: 1. first line 2. second line - another list in a list - don't get confused 1. even more lists 2. bah! 3. back to first list ** Tables :PROPERTIES: :CREATED: [2014-01-30 Thu 20:14] :END: A basic table: | Season | Sports | | Winter | Skiing | | Summer | Bathing | | Season | Light | |--------+-------| | Winter | low | | Summer | much | | *Header1* | *a wide column is here* | *Something else* | |-----------+----------------------------------------------------------------------------------------------+------------------| | foo bar | This is a really, really, really, extra wide column as well to show how wide tables are done | 23 | | Hänsel | und Gretel | 42.77 | |-----------+----------------------------------------------------------------------------------------------+------------------| | | | 65.77 | #+TBLFM: @>$3=vsum(@I$3..@II$3) Complex table: #+NAME: My-table-name | *What* | *€* | *Amount* | *Sum* | *Notes* | |----------------------+-------+----------+--------+---------------------| | [[https://roses.example.com/myroses.html][My Roses]] | 42.23 | 12 | 506.76 | *best* roses ~evar~ | | [[id:2014-01-27-full-syntax-test][internal *link* test]] | 10 | 2 | 20 | Umlaut test: öÄß | #+TBLFM: $4=$2*$3 ** Customized Link Images Because lazyblorg is using multiple clever ways of including image files, I will one more link you to [[https://github.com/novoid/lazyblorg/wiki/Images][the corresponding wiki page]] that explains everything in detail. These are some beautiful photographs I want to include here: [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] [[tsfile:2017-03-11T18.29.21%20Sterne%20im%20Baum%20--%20mytag%20publicvoit.jpg][2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] [[tsfile:2017-03-11T18.29.21%20Sterne%20im%20Baum%20--%20mytag%20publicvoit.jpg][A completely different description here]] And now we do test images with captions and attributes. Here is an image with a caption and attributes for =alt=, =title= (ignored), =align=, and =width=: #+CAPTION: Some beautiful stars in a tree #+ATTR_HTML: :alt Stars in a Tree :title Some Stars :align right :width 300 [[tsfile:2017-03-11T18.29.21%20Sterne%20im%20Baum%20--%20mytag%20publicvoit.jpg][2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] If you define multiple caption lines, only the last one is used in the result: #+CAPTION: Multiple captions do not hurt but the last one wins #+CAPTION: This is the only caption for this image. #+ATTR_HTML: :alt An alternative description image :title This is my title! :align right :width 300 [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] Of course, you can use multiple =ATTR_HTML= lines to define multiple parameters in multiple lines. Following example consists of three lines. First: =alt=. Second: =title= (still ignored). Third: =align= and =width=. Notice when there is a =CAPTION=, the description of the Org mode link gets ignored. I do think that if you invest effort to define an extra line for it, it should replace the Org mode description. Usually, you're not going to use both. #+CAPTION: This caption will be overwritten by follow-up ones #+CAPTION: This is going to be the caption #+ATTR_HTML: :alt This is going to be the alt parameter of the img tag #+ATTR_HTML: :title The title is ignored #+ATTR_HTML: :align right :width 300 [[tsfile:2017-03-11T18.29.21%20Sterne%20im%20Baum%20--%20mytag%20publicvoit.jpg][If there is an CAPTION, this title gets ignored]] This is a real-world example: An Org mode link with its description (used for caption) with attributes for =alt=, =align=, and =width=: #+ATTR_HTML: :alt This is going to be the alt parameter of the img tag #+ATTR_HTML: :title The title is ignored #+ATTR_HTML: :align right :width 300 [[tsfile:2017-03-11T18.29.21%20Sterne%20im%20Baum%20--%20mytag%20publicvoit.jpg][This is the caption of the image]] If you want to justify the images, you can do it with =:align left= like in the following example: #+CAPTION: Test for left-justified image with 300px width #+ATTR_HTML: :alt left-justified stars #+ATTR_HTML: :align left :width 300 [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] Same example but with =:align center=: #+CAPTION: Test for center-justified image with 300px width #+ATTR_HTML: :alt center-justified stars #+ATTR_HTML: :align center :width 300 [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] And of course, there is the =:align right= example as well: #+CAPTION: Test for right-justified image with 300px width #+ATTR_HTML: :alt right-justified stars #+ATTR_HTML: :align right :width 300 [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] Following example is a really smart one. Above file names were =2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg=. This time, I am using =2017-03-11T18.29.21.jpg= which matches the very same time-stamp of the other image file. The rest of it differs: missing =Sterne im Baum -- mytag=. In case an image file (containing a time-stamp) is not found, lazyblorg tries to locate the same time-stamp within a different file-name. If the result is unique, it is used instead of the other filename. You get a warning in the log output. Unfortunately, I had to disable this on 2021-11-21 because somehow the time-stamp was not unique any more. The file is re-used for many purposes which may cause the index to contain it more than once. : #+CAPTION: Test with image file whose name only matches the ISO timestamp (partial comparison) : #+ATTR_HTML: :align center :width 300 : [[tsfile:2017-03-11T18.29.21.jpg]] Small images are really sexy when the text is floating around. Try the =:align float-right= attribute: #+CAPTION: Image float right #+ATTR_HTML: :align float-right :width 100 [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. And here is an example with =float-left= attribute: #+CAPTION: Image float left #+ATTR_HTML: :align float-left :width 100 [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. This is an example text. *** Linked image versions With https://github.com/novoid/lazyblorg/issues/17 lazyblorg added support for linked images and defining its width. : #+ATTR_HTML: :linked-image-width [none|original|] The =none= option causes no linked-image being generated. =original= links an image that has the same dimensions than the original one. Any == defines the new width of the linked image. #+CAPTION: Test image without linking a larger version because I chose attribute value "none". #+ATTR_HTML: :alt An alternative description image :title This is my title! :align right :width 300 #+ATTR_HTML: :linked-image-width none [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg]] Original of =2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg= has 800x600 pixel. Original of =2019-07-29T19.57.10 This is my Life -- sign specialL cliparts publicvoit.jpg= has 1000x750 pixel. #+CAPTION: Let's link the full size original image here. Width should be 1000 pixel. #+ATTR_HTML: :alt This is an alternative text. #+ATTR_HTML: :linked-image-width original :align center :width 350 [[tsfile:2019-07-29T19.57.10 This is my Life -- sign specialL cliparts publicvoit.jpg][2019-07-29T19.57.10 This is my Life -- sign specialL cliparts publicvoit.jpg]] Original of =2019-07-26T11.44.35 Shinjuku - Skyline -- specialP publicvoit.jpg= has 1000x1333 pixel. The following commands integrates the image with a height of 200 into the blog article. However, the linked larger version gets scaled to a height of 750 pixel and exif tags gets removed as well. #+CAPTION: With this image, lazyblorg is going to scale it to 750 pixel width. #+ATTR_HTML: :alt alternative-text for the image #+ATTR_HTML: :align right :width 200 #+ATTR_HTML: :linked-image-width 750 [[tsfile:2019-07-26T11.44.35 Shinjuku - Skyline -- specialP publicvoit.jpg][2019-07-26T11.44.35 Shinjuku - Skyline -- specialP publicvoit.jpg]] *** URLs in image descriptions Image link descriptions can contain URLs. Those URLs get used as a href link for the whole image. : [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg][https://karl-voit.at]] For obvious reasons, this must not be used with =:linked-image-width= other than =none=. #+CAPTION: Test image with URL description. #+ATTR_HTML: :alt An alternative description image :title This is my title! :align right :width 300 #+ATTR_HTML: :linked-image-width none [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg][https://karl-voit.at]] The following snippet would result in an error if it was not just a comment: "image with URL as description ("https://karl-voit.at"; which will result in a href link) used an linked-image-width parameter value which is not none ("345") which would also result in a href link. Please do remove one of them." : #+CAPTION: Test image with URL description. : #+ATTR_HTML: :alt An alternative description image :title This is my title! :align right :width 300 : #+ATTR_HTML: :linked-image-width 345 : [[tsfile:2017-03-11T18.29.21 Sterne im Baum -- mytag publicvoit.jpg][https://karl-voit.at]] * local vars en_US | de_AT # Local Variables: # mode: auto-fill # mode: flyspell # End: