Browse Source

Revert "Update documentation wrt export-block type removal"

This reverts commit 24faa3f2de0fdcd3e84e1416b435a909d4a494e6.

Conflicts:
	dev/org-export-reference.org
	exporters/filter-markup.org
Nicolas Goaziou 5 years ago
parent
commit
5068bf690e
4 changed files with 15 additions and 29 deletions
  1. 7 0
      dev/org-element-api.org
  2. 1 29
      dev/org-export-reference.org
  3. 3 0
      dev/org-syntax.org
  4. 4 0
      exporters/filter-markup.org

+ 7 - 0
dev/org-element-api.org

@@ -318,6 +318,13 @@ properties attached to it.  An exhaustive list is given in section
                       line number (boolean).
    - ~:value~ :: Contents (string).
 
+** Export Block
+
+   Element.
+
+   - ~:type~ :: Related back-end's name (string).
+   - ~:value~ :: Contents (string).
+
 ** Export Snippet
 
    Object.

+ 1 - 29
dev/org-export-reference.org

@@ -561,6 +561,7 @@ document.
   - ~:filter-dynamic-block~
   - ~:filter-entity~
   - ~:filter-example-block~
+  - ~:filter-export-block~
   - ~:filter-export-snippet~
   - ~:filter-final-output~
   - ~:filter-fixed-width~
@@ -1199,35 +1200,6 @@ document.
 
    See also: [[#get-headline-number][~org-export-get-headline-number~]].
 
-** ~org-export-raw-special-block-p~
-   :PROPERTIES:
-   :CUSTOM_ID: raw-special-block-p
-   :END:
-
-   Non nil when a given special block should be inserted as-is in the
-   final output.
-
-   This fuction should be used as a first check in a special block
-   translator, in order to know if contents are to be processed or
-   not. In the latter case, one can extract raw contents through
-   ~:raw-value~ property, as shown in the following excerpt from
-   ~latex~ back-end:
-
-   #+BEGIN_SRC emacs-lisp
-   (defun org-latex-special-block (special-block contents info)
-     "Transcode a SPECIAL-BLOCK element from Org to LaTeX.
-   CONTENTS holds the contents of the block.  INFO is a plist
-   holding contextual information."
-     (if (org-export-raw-special-block-p special-block info)
-         (org-remove-indentation (org-element-property :raw-value special-block))
-       (let ((type (downcase (org-element-property :type special-block)))
-             (opt (org-export-read-attribute :attr_latex special-block :options)))
-         (concat (format "\\begin{%s}%s\n" type (or opt ""))
-                 (org-latex--caption/label-string special-block info)
-                 contents
-                 (format "\\end{%s}" type)))))
-   #+END_SRC
-
 ** ~org-export-read-attribute~
    :PROPERTIES:
    :CUSTOM_ID: read-attribute

+ 3 - 0
dev/org-syntax.org

@@ -385,6 +385,9 @@ Unless specified otherwise, case is not significant.
    "EXAMPLE", it will be an "example block".  If it is "SRC", it will
    be a "source block".  If it is "VERSE", it will be a "verse block".
 
+   If NAME is a string matching the name of any export back-end
+   loaded, the block will be an "export block".
+
    DATA can contain any character but a new line.  It can be ommitted,
    unless the block is a "source block".  In this case, it must follow
    the pattern "LANGUAGE SWITCHES ARGUMENTS", where SWITCHES and

+ 4 - 0
exporters/filter-markup.org

@@ -101,6 +101,9 @@ Here is a complete set of filter functions to provide markup tags.
 (defun ox-mrkup-filter-example-block
   (text back-end info)
   (format "<exm>%s</exm>" text))
+(defun ox-mrkup-filter-export-block
+  (text back-end info)
+  (format "<exprt-b>%s</exprt-b>" text))
 (defun ox-mrkup-filter-export-snippet
   (text back-end info)
   (format "<exprt-s>%s</exprt-s>" text))
@@ -257,6 +260,7 @@ could be edited to leave only those filters that are wanted.
     (:filter-dynamic-block . ox-mrkup-filter-dynamic-block)
     (:filter-entity . ox-mrkup-filter-entity)
     (:filter-example-block . ox-mrkup-filter-example-block)
+    (:filter-export-block . ox-mrkup-filter-export-block)
     (:filter-export-snippet . ox-mrkup-filter-export-snippet)
     (:filter-final-output . ox-mrkup-filter-final-output)
     (:filter-fixed-width . ox-mrkup-filter-fixed-width)