Browse Source

Macros in macros.org

org-tutorials/images-and-xhtml-export.org uses those macros now.
Images in macros use absolute web path, to make them work anywhere.
Sebastian Rose, Hannover, Germany 10 years ago
parent
commit
83ff69b7e0
3 changed files with 52 additions and 27 deletions
  1. 8 0
      macros.org
  2. 17 24
      org-tutorials/images-and-xhtml-export.org
  3. 27 3
      worg-editing.org

+ 8 - 0
macros.org

@@ -0,0 +1,8 @@
+#+MACRO: BeginMiniPage @<div style="border:1px solid #aaaaaa;padding:10px;width:780px;margin-left:auto;margin-right:auto;">
+#+MACRO: EndMiniPage @</div>
+#+MACRO: BeginInfoBox @<div class="org-info-box">@<img src="/worg/images/icons/info.png" alt="NOTE" />@<p>
+#+MACRO: EndInfoBox @</p>@<br style="clear:left;height:1px;" />@</div>@<br />
+#+MACRO: BeginWarningBox @<div class="org-info-box">@<img src="/worg/images/icons/warning.png" alt="NOTE" />@<p>
+#+MACRO: EndWarningBox @</p>@<br style="clear:left;height:1px;" />@</div>@<br />
+#+MACRO: BeginBlindText @<span style="color:#aaaaaa;">
+#+MACRO: EndBlindText  @</span>

+ 17 - 24
org-tutorials/images-and-xhtml-export.org

@@ -7,15 +7,8 @@
 #+EMAIL:      sebastian_rose gmx de
 #+LANGUAGE:   en
 #+CATEGORY:   worg-tutorial
+#+SETUPFILE:  ../macros.org
 #+MACRO: imageurl /img/org-mode-unicorn.png
-#+MACRO: BeginMiniPage @<div style="border:1px solid #aaaaaa;padding:10px;width:780px;margin-left:auto;margin-right:auto;">
-#+MACRO: EndMiniPage @</div>
-#+MACRO: blindtextstart @<span style="color:#aaaaaa;">
-#+MACRO: blindtextend  @</span>
-#+MACRO: BeginInfoBox @<div class="org-info-box">@<img src="../images/icons/info.png" alt="NOTE" />@<p>
-#+MACRO: EndInfoBox @</p>@<br style="clear:left;height:1px;" />@</div>@<br />
-#+MACRO: BeginWarningBox @<div class="org-info-box">@<img src="../images/icons/warning.png" alt="NOTE" />@<p>
-#+MACRO: EndWarningBox @</p>@<br style="clear:left;height:1px;" />@</div>@<br />
 
 
 [[file:../index.org][{Back to Worg's index}]]
@@ -65,7 +58,7 @@
 
   {{{BeginMiniPage}}}
 
-  {{{blindtextstart}}}
+  {{{BeginBlindText}}}
   Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
   nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi
   enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis
@@ -73,9 +66,9 @@
   hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu
   feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui
   blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
-  facilisi.{{{blindtextend}}}
+  facilisi.{{{EndBlindText}}}
   [[{{{imageurl}}}]]
-  {{{blindtextstart}}}
+  {{{BeginBlindText}}}
   Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
   nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi
   enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis
@@ -83,7 +76,7 @@
   hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu
   feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui
   blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
-  facilisi.{{{blindtextend}}}
+  facilisi.{{{EndBlindText}}}
 
   {{{EndMiniPage}}}
 
@@ -157,7 +150,7 @@
   [[{{{imageurl}}}]]
   This text is directly succeeds the first image, which is right
   aligned. Because of the alignment, placing the image after the first few
-  lines would make no difference.{{{blindtextstart}}}
+  lines would make no difference.{{{BeginBlindText}}}
   Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
   nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi
   enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis
@@ -167,7 +160,7 @@
   blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
   facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
   nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
-  volutpat.{{{blindtextend}}} Text before the second image ends here.<
+  volutpat.{{{EndBlindText}}} Text before the second image ends here.<
   #+ATTR_HTML: style="float:left;margin:20px 20px 20px 0px;"
   [[{{{imageurl}}}]]
   >This text is directly following the second image. No empty lines are added.
@@ -175,14 +168,14 @@
   two images. Note, that browsers will place this second image where ever they
   see fit. Browsers will not interrupt the text flow, just to place the image
   add the exact point between two words.
-  {{{blindtextstart}}}Lorem ipsum dolor sit amet,
+  {{{BeginBlindText}}}Lorem ipsum dolor sit amet,
   consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
   laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis
   nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea
   commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate
   velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at
   vero et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril
-  delenit augue duis dolore te feugait nulla facilisi.{{{blindtextend}}}
+  delenit augue duis dolore te feugait nulla facilisi.{{{EndBlindText}}}
 
   {{{EndMiniPage}}}
 
@@ -253,9 +246,9 @@
   #+CAPTION: Monocerus Glaucus
   #+ATTR_HTML: alt="Monocerus Glaucus"
   [[{{{imageurl}}}]]
-  {{{blindtextstart}}}Lorem ipsum dolor sit amet, consectetuer
+  {{{BeginBlindText}}}Lorem ipsum dolor sit amet, consectetuer
   adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore
-  magna aliquam erat volutpat.{{{blindtextend}}}
+  magna aliquam erat volutpat.{{{EndBlindText}}}
 
   {{{EndMiniPage}}}
 
@@ -306,11 +299,11 @@
 
    {{{BeginMiniPage}}}
 
-   {{{blindtextstart}}}
+   {{{BeginBlindText}}}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
    nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi
    enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis
-   nisl ut aliquip ex ea commodo consequat.{{{blindtextend}}} This text
+   nisl ut aliquip ex ea commodo consequat.{{{EndBlindText}}} This text
    directly preceeds the image and ends here.<
     #+begin_html
 <div class="figure" style="float:left;">
@@ -319,7 +312,7 @@
 </div>
    #+end_html
    >This text directly follows the image. No empty are inserted before or after
-   the image. Note, that a new paragraph has started nonetheless.{{{blindtextstart}}}
+   the image. Note, that a new paragraph has started nonetheless.{{{BeginBlindText}}}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
    nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi
    enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis
@@ -341,7 +334,7 @@
    facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
    nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
    volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper
-   suscipit lobortis nisl ut aliquip ex ea commodo...{{{blindtextend}}}
+   suscipit lobortis nisl ut aliquip ex ea commodo...{{{EndBlindText}}}
 
    {{{EndMiniPage}}}
 
@@ -457,7 +450,7 @@
     <p style="font-style:italic;">Save the unicorns</p>
     </div>
    #+end_html
-   {{{blindtextstart}}}
+   {{{BeginBlindText}}}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
    nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi
    enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis
@@ -488,7 +481,7 @@
    blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
    facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
    nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
-   volutpat.{{{blindtextend}}}
+   volutpat.{{{EndBlindText}}}
 
    {{{EndMiniPage}}}
 

+ 27 - 3
worg-editing.org

@@ -1,6 +1,6 @@
 #+STARTUP:    align fold nodlcheck hidestars oddeven lognotestate
 #+SEQ_TODO:   TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
-#+TAGS:       Write(w) Update(u) Fix(f) Check(c) 
+#+TAGS:       Write(w) Update(u) Fix(f) Check(c)
 #+EMAIL:      bzg AT altern DOT org
 #+TITLE:      How to edit Worg files?
 #+AUTHOR:     Worg people
@@ -33,7 +33,7 @@ changes.
 
 ** Tags
 
-: Write(w) Update(u) Fix(f) Check(c) 
+: Write(w) Update(u) Fix(f) Check(c)
 
 ** Encoding
 ** Properties
@@ -59,9 +59,33 @@ If you are using dynamic blocks in Worg, please don't forget to add the
 relevant code in the =elisp/worg.el= file.  See for example the dynamic
 block for the timestamp in the [[file:index.org][index]] page.
 
+* What about macros
+
+If you are using macros, please add them to =macros.org=.
+
+** COMMENT Defined macros explained
+
+*** Environments
+
+    - BeginMiniPage ... EndMiniPage :: creates a mini page with a border. Used to
+         demonstrate layouts (see: [[file:./org-tutorials/images-and-xhtml-export.org]] for
+         an example).
+
+    - BeginInfoBox ... EndInfoBox :: inserts a box with a little info icon on the
+         left. The text inside flows around the icon. Both, info and warning boxes,
+         use the styles for =.org-info-box= in [[file:worg.css::org-info-box][worg.css]].
+
+    - BeginWarningBox ... EndWarningBox :: Like =BeginInfoBox= and =EndInfoBox=. The
+         icon used is different.
+
+    - BeginBlindText ... EndBlindText :: creates a =<span></span>= element, that
+         greys out the text. Used for text, that is just there to fill paragraphs
+         to demonstrate text flow (see:
+         [[file:./org-tutorials/images-and-xhtml-export.org]] for an example).
+
 * COMMENT How do I rename a file?
 * COMMENT Can I create a directory?
 * COMMENT What about non-org files in the repository?
 
 .el files ?
-.pdf files 
+.pdf files