[git] gnupg-doc - branch, master, updated. e033305a5b7c3cc79d35af8f4baff9c1346bb48f

by Werner Koch cvs at cvs.gnupg.org
Wed Apr 11 10:33:20 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GnuPG website and other docs".

The branch, master has been updated
       via  e033305a5b7c3cc79d35af8f4baff9c1346bb48f (commit)
      from  a739fddfe19ab96e9681dd11353bffc52082d9ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e033305a5b7c3cc79d35af8f4baff9c1346bb48f
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Apr 11 10:25:56 2018 +0200

    ox-gpgweb: Implement virtual headlines and HTML_CLASS property.
    
    This also chnanges how HTML_CONTAINER_CLASS is used.  That is not a
    problem here becuase we are cot yet using that property.  With these
    changes the following markup is possible (example):
    
      * Top header
        :PROPERTIES:
        :HTML_CLASS: centered
        :END:
    
      ** <div class="pure-g">                    :html:virtual:
    
      ** Foo
         :PROPERTIES:
         :HTML_CONTAINER_CLASS: pure-u-1 pure-u-lg-1-3
         :END:
    
        Foo is about bar.
    
      ** </div><!-- end pure-g -->               :html:virtual:
    
    The HTML_CLASS property puts a class="centered" into the <h> tag.
    
    The HTML_CONTAINER_CLASS property encloses its <h> section with
    another div:
    
      <div class="pure-u-1 pure-u-lg-1-3">
      <h3>Foo</h3>
      <div class="outline-text-1" id="text-1-2">
      <p>Foo is about bar.</p>
      </div>
      </div>
    
    The "html" tag (the "virtual" is right now only informational) inserts
    the given HTML directly at this place into the output.  Note that this
    can't be done with #+HTML: because that would distrub the sectioning.

diff --git a/web/share/ox-gpgweb.el b/web/share/ox-gpgweb.el
index a48985c..7d84d1a 100644
--- a/web/share/ox-gpgweb.el
+++ b/web/share/ox-gpgweb.el
@@ -1222,6 +1222,9 @@ holding contextual information."
 			     todo todo-type priority text tags info))
 	 (contents (or contents "")))
     (cond
+     ;; Case 0: virtual headline: Just print the raw value.
+     ((member "html" (org-export-get-tags headline info))
+      (format "%s\n" (org-element-property :raw-value headline)))
      ;; Case 1: This is a footnote section: ignore it.
      ((org-element-property :footnote-section-p headline) nil)
      ;; Case 2: This is a deep sub-tree: export it as a list item.
@@ -1247,11 +1250,16 @@ holding contextual information."
 			      (org-element-property :ID headline))))
 	     (preferred-id (car ids))
 	     (extra-ids (cdr ids))
-	     (extra-class (org-element-property :HTML_CONTAINER_CLASS headline))
+	     (outer-class (org-element-property :HTML_CONTAINER_CLASS headline))
+	     (header-class (org-element-property :HTML_CLASS headline))
 	     (first-content (car (org-element-contents headline))))
-	(format "<h%d id=\"%s\">%s%s</h%d>\n%s\n"
+	(format "%s<h%d%s id=\"%s\">%s%s</h%d>\n%s%s\n"
+                ; div class?
+                (if outer-class (concat "<div class=\"" outer-class "\">\n") "")
 		; h?
 		level
+                ; header-class?
+                (if header-class (concat " class=\"" header-class "\"") "")
 		; id=?
 		preferred-id
 		; insert anchors
@@ -1273,7 +1281,9 @@ holding contextual information."
 		; /h?
 		level
 		; the content of the section
-		contents))))))
+		contents
+                (if outer-class "</div>" "")
+                ))))))
 
 (defun org-gpgweb-format-headline-function
   (todo todo-type priority text tags info)

-----------------------------------------------------------------------

Summary of changes:
 web/share/ox-gpgweb.el | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The GnuPG website and other docs
http://git.gnupg.org




More information about the Gnupg-commits mailing list