ox: Change meaning of `org-export-with-\(table\|fixed-width\)

* lisp/ox.el (org-export-with-fixed-width, org-export-with-tables):
  Change docstring to reflect new meaning.
(org-export--skip-p): Completely ignore tables and fixed-width areas
if appropriate option is nil.
* testing/lisp/test-ox.el (test-org-export/handle-options): Add tests.
This commit is contained in:
Nicolas Goaziou 2014-01-05 01:13:54 +01:00
parent e4a013fcf3
commit d361f465e9
2 changed files with 33 additions and 21 deletions

View File

@ -457,19 +457,12 @@ This option can also be set with the EXCLUDE_TAGS keyword."
:type '(repeat (string :tag "Tag"))) :type '(repeat (string :tag "Tag")))
(defcustom org-export-with-fixed-width t (defcustom org-export-with-fixed-width t
"Non-nil means lines starting with \":\" will be in fixed width font. "Non-nil means export lines starting with \":\".
This can be used to have pre-formatted text, fragments of code
etc. For example:
: ;; Some Lisp examples
: (while (defc cnt)
: (ding))
will be looking just like this in also HTML. See also the QUOTE
keyword. Not all export backends support this.
This option can also be set with the OPTIONS keyword, This option can also be set with the OPTIONS keyword,
e.g. \"::nil\"." e.g. \"::nil\"."
:group 'org-export-general :group 'org-export-general
:version "24.4"
:package-version '(Org . "8.0")
:type 'boolean) :type 'boolean)
(defcustom org-export-with-footnotes t (defcustom org-export-with-footnotes t
@ -703,16 +696,12 @@ e.g. \"toc:nil\" or \"toc:3\"."
(integer :tag "TOC to level"))) (integer :tag "TOC to level")))
(defcustom org-export-with-tables t (defcustom org-export-with-tables t
"If non-nil, lines starting with \"|\" define a table. "Non-nil means export tables.
For example:
| Name | Address | Birthday |
|-------------+----------+-----------|
| Arthur Dent | England | 29.2.2100 |
This option can also be set with the OPTIONS keyword, This option can also be set with the OPTIONS keyword,
e.g. \"|:nil\"." e.g. \"|:nil\"."
:group 'org-export-general :group 'org-export-general
:version "24.4"
:package-version '(Org . "8.0")
:type 'boolean) :type 'boolean)
(defcustom org-export-with-tags t (defcustom org-export-with-tags t
@ -1440,7 +1429,7 @@ The back-end could then be called with, for example:
;; - category :: option ;; - category :: option
;; - type :: symbol (nil, t) ;; - type :: symbol (nil, t)
;; ;;
;; + `:with-fixed-width' :: Non-nil if transcoder should interpret ;; + `:with-fixed-width' :: Non-nil if transcoder should export
;; strings starting with a colon as a fixed-with (verbatim) area. ;; strings starting with a colon as a fixed-with (verbatim) area.
;; - category :: option ;; - category :: option
;; - type :: symbol (nil, t) ;; - type :: symbol (nil, t)
@ -1482,8 +1471,7 @@ The back-end could then be called with, for example:
;; - category :: option ;; - category :: option
;; - type :: symbol (nil, {}, t) ;; - type :: symbol (nil, {}, t)
;; ;;
;; + `:with-tables' :: Non-nil means transcoding should interpret ;; + `:with-tables' :: Non-nil means transcoding should export tables.
;; tables.
;; - category :: option ;; - category :: option
;; - type :: symbol (nil, t) ;; - type :: symbol (nil, t)
;; ;;
@ -2091,6 +2079,7 @@ a tree with a select tag."
(if (eq (car with-drawers-p) 'not) (if (eq (car with-drawers-p) 'not)
(member-ignore-case name (cdr with-drawers-p)) (member-ignore-case name (cdr with-drawers-p))
(not (member-ignore-case name with-drawers-p)))))))) (not (member-ignore-case name with-drawers-p))))))))
(fixed-width (not (plist-get options :with-fixed-width)))
((footnote-definition footnote-reference) ((footnote-definition footnote-reference)
(not (plist-get options :with-footnotes))) (not (plist-get options :with-footnotes)))
((headline inlinetask) ((headline inlinetask)
@ -2128,6 +2117,7 @@ a tree with a select tag."
(planning (not (plist-get options :with-planning))) (planning (not (plist-get options :with-planning)))
(property-drawer (not (plist-get options :with-properties))) (property-drawer (not (plist-get options :with-properties)))
(statistics-cookie (not (plist-get options :with-statistics-cookies))) (statistics-cookie (not (plist-get options :with-statistics-cookies)))
(table (not (plist-get options :with-tables)))
(table-cell (table-cell
(and (org-export-table-has-special-column-p (and (org-export-table-has-special-column-p
(org-export-get-parent-table blob)) (org-export-get-parent-table blob))

View File

@ -430,6 +430,17 @@ Paragraph"
(org-test-with-temp-text ":FOO:\nkeep\n:END:\n:BAR:\nremove\n:END:" (org-test-with-temp-text ":FOO:\nkeep\n:END:\n:BAR:\nremove\n:END:"
(org-export-as (org-test-default-backend) (org-export-as (org-test-default-backend)
nil nil nil '(:with-drawers (not "BAR")))))) nil nil nil '(:with-drawers (not "BAR"))))))
;; Fixed-width.
(should
(equal ": A\n"
(org-test-with-temp-text ": A"
(org-export-as (org-test-default-backend) nil nil nil
'(:with-fixed-width t)))))
(should
(equal ""
(org-test-with-temp-text ": A"
(org-export-as (org-test-default-backend) nil nil nil
'(:with-fixed-width nil)))))
;; Footnotes. ;; Footnotes.
(should (should
(equal "Footnote?" (equal "Footnote?"
@ -498,7 +509,18 @@ Paragraph"
(equal "" (equal ""
(org-test-with-temp-text "[0/0]" (org-test-with-temp-text "[0/0]"
(org-export-as (org-test-default-backend) (org-export-as (org-test-default-backend)
nil nil nil '(:with-statistics-cookies nil)))))) nil nil nil '(:with-statistics-cookies nil)))))
;; Tables.
(should
(equal "| A |\n"
(org-test-with-temp-text "| A |"
(org-export-as (org-test-default-backend) nil nil nil
'(:with-tables t)))))
(should
(equal ""
(org-test-with-temp-text "| A |"
(org-export-as (org-test-default-backend) nil nil nil
'(:with-tables nil))))))
(ert-deftest test-org-export/with-timestamps () (ert-deftest test-org-export/with-timestamps ()
"Test `org-export-with-timestamps' specifications." "Test `org-export-with-timestamps' specifications."