emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Feature Request] Make property-drawers exportable
@ 2013-06-17  9:53 Thorsten Jolitz
  2013-06-17 14:33 ` Nicolas Goaziou
  0 siblings, 1 reply; 24+ messages in thread
From: Thorsten Jolitz @ 2013-06-17  9:53 UTC (permalink / raw)
  To: emacs-orgmode


Hi List,

for me property-drawers are a very useful feature of Org-mode, since
the need to store meta-data for a document is so frequent and
property-drawers are human- and machine-readable, easy to handle
interactively and programmatically, and avoid all that nasty redundancy
and accidental variation of giving meta-data as free text.

However, property-drawers are not exported except separating blank
lines. This is a real pity in my eyes, since parts of an Org-mode
document that can't be exported are visible only to the author of the
document and a few fellows that use the raw Org document too. This might
make sense in some cases, but in others the property information should
be visible in the exported docs too.

I don't really consider the export options (#+TITLE, #+AUTHOR etc) as a
replacement for property drawers, in some situations I would like to use
property drawers and see them exported.

So here is my feature request, at least for the most important backends
ASCII, HTML and LATEX: add a function for property drawer export and an
export option to turn on/off this export.

PS
the status-quo of property-drawer export at the moment:

1. backends that (seem to) deal with property drawers:
,---------------------------------------------------------------------------
| 3 matches for "property-drawer" in buffer: ox-html.el
|      83:    (property-drawer . org-html-property-drawer)
|    2893:(defun org-html-property-drawer (property-drawer contents info)
|    2894:  "Transcode a PROPERTY-DRAWER element from Org to HTML.
|
| 3 matches for "property-drawer" in buffer: ox-odt.el
|      66:    (property-drawer . org-odt-property-drawer)
|    3017:(defun org-odt-property-drawer (property-drawer contents info)
|    3018:  "Transcode a PROPERTY-DRAWER element from Org to ODT.
|
| 1 match for "property-drawer" in buffer: ox-org.el
|      91:    (property-drawer . org-org-identity)
|
| 3 matches for "property-drawer" in buffer: ox-texinfo.el
|      96:    (property-drawer . org-texinfo-property-drawer)
|    1399:(defun org-texinfo-property-drawer (property-drawer contents info)
|    1400:  "Transcode a PROPERTY-DRAWER element from Org to Texinfo.
`---------------------------------------------------------------------------

but in all cases (except ox-org.el) the function looks like this:

,---------------------------------------------------------------------
| (defun org-html-property-drawer (property-drawer contents info)
|   "Transcode a PROPERTY-DRAWER element from Org to HTML.
| CONTENTS is nil.  INFO is a plist holding contextual
| information."
|   ;; The property drawer isn't exported but we want separating blank
|   ;; lines nonetheless.
|   "")
`---------------------------------------------------------------------

2. backends that don't (really) deal with property drawers:
,---------------------------------------------------------
| 1 match for "property-drawer" in buffer: ox-man.el
|      83:    (property-drawer . (lambda (&rest args) ""))
|
| 1 match for "property-drawer" in buffer: ox-latex.el
|      70:    (property-drawer . (lambda (&rest args) ""))
|
| ox-ascii.el: not found
| ox-icalendar.el: not found
| ox-md.el: not found
`---------------------------------------------------------

--
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Feature Request] Make property-drawers exportable
  2013-06-17  9:53 [Feature Request] Make property-drawers exportable Thorsten Jolitz
@ 2013-06-17 14:33 ` Nicolas Goaziou
  2013-06-17 15:48   ` Thorsten Jolitz
  0 siblings, 1 reply; 24+ messages in thread
From: Nicolas Goaziou @ 2013-06-17 14:33 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Hello,

Thorsten Jolitz <tjolitz@gmail.com> writes:

> for me property-drawers are a very useful feature of Org-mode, since
> the need to store meta-data for a document is so frequent and
> property-drawers are human- and machine-readable, easy to handle
> interactively and programmatically, and avoid all that nasty redundancy
> and accidental variation of giving meta-data as free text.
>
> However, property-drawers are not exported except separating blank
> lines. This is a real pity in my eyes, since parts of an Org-mode
> document that can't be exported are visible only to the author of the
> document and a few fellows that use the raw Org document too. This might
> make sense in some cases, but in others the property information should
> be visible in the exported docs too.

This has been requested before. Property drawers are Org meta data, they
are not for user's cosumption. Though you can export some properties
with macros (see {{{property{NAME}}}} macros).

You can also create a derived back-end that will handle these elements
just fine.

AFAIK all backends (excepted "org", for obvious reasons) ignore property
drawers, as they should.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Feature Request] Make property-drawers exportable
  2013-06-17 14:33 ` Nicolas Goaziou
@ 2013-06-17 15:48   ` Thorsten Jolitz
  2013-06-17 18:54     ` Marcin Borkowski
  2013-06-17 19:04     ` Nicolas Goaziou
  0 siblings, 2 replies; 24+ messages in thread
From: Thorsten Jolitz @ 2013-06-17 15:48 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> for me property-drawers are a very useful feature of Org-mode, since
>> the need to store meta-data for a document is so frequent and
>> property-drawers are human- and machine-readable, easy to handle
>> interactively and programmatically, and avoid all that nasty redundancy
>> and accidental variation of giving meta-data as free text.
>>
>> However, property-drawers are not exported except separating blank
>> lines. This is a real pity in my eyes, since parts of an Org-mode
>> document that can't be exported are visible only to the author of the
>> document and a few fellows that use the raw Org document too. This might
>> make sense in some cases, but in others the property information should
>> be visible in the exported docs too.
>
> This has been requested before.

I know, because I missed that feature before, and I remember others did
ask for it too.

> Property drawers are Org meta data, they are not for user's
> cosumption. Though you can export some properties with macros (see
> {{{property{NAME}}}} macros).

I don't really agree. Property drawers are for meta data used by
Org-mode too, obviously, but they are perfectly suited for meta-data
about the document, as well as those simple data-base features described
in the manual. Why deny Org users the full benefit of these other uses
for property-drawers by denying them the possibility to export their
document meta-data or data-bases?

I mean, everything else in Org-mode is more or less configurable, why
hardcode in this case that export is (by default) impossible?

Whats wrong e.g. with

,-------------------------------
| * My Source-file
|     :PROPERTIES:
|     :github-repo: <<repo-url>>
|     :licence:  <<licence>>
|     :END:
`-------------------------------

?

This is not Org meta-data, its meaningless to Org-mode, but its
meta-data about the document, easily stored and accessed, readable, and
stays in the background during visibility cycling. And its for user
consumption, thus there should be a way to export this.

And whats wrong with a simple CD collection database implemented with
property-drawers, as described in the manual? Why shouldn't people be
allowed to export their CD database to some text-formatting backend?

IMO there should be transoder functions for property-drawers just like
for other elements in the main backend libs, not in some derived
backend. If by default they are not exported, nothing changes, but at
least the user has a choice.

--
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Feature Request] Make property-drawers exportable
  2013-06-17 15:48   ` Thorsten Jolitz
@ 2013-06-17 18:54     ` Marcin Borkowski
  2013-06-17 19:04     ` Nicolas Goaziou
  1 sibling, 0 replies; 24+ messages in thread
From: Marcin Borkowski @ 2013-06-17 18:54 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-06-17, o godz. 17:48:49
Thorsten Jolitz <tjolitz@gmail.com> napisał(a):

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
> 
> > Hello,
> >
> > Thorsten Jolitz <tjolitz@gmail.com> writes:
> >
> >> for me property-drawers are a very useful feature of Org-mode,
> >> since the need to store meta-data for a document is so frequent and
> >> property-drawers are human- and machine-readable, easy to handle
> >> interactively and programmatically, and avoid all that nasty
> >> redundancy and accidental variation of giving meta-data as free
> >> text.
> >>
> >> However, property-drawers are not exported except separating blank
> >> lines. This is a real pity in my eyes, since parts of an Org-mode
> >> document that can't be exported are visible only to the author of
> >> the document and a few fellows that use the raw Org document too.
> >> This might make sense in some cases, but in others the property
> >> information should be visible in the exported docs too.
> >
> > This has been requested before.
> 
> I know, because I missed that feature before, and I remember others
> did ask for it too.
> 
> > Property drawers are Org meta data, they are not for user's
> > cosumption. Though you can export some properties with macros (see
> > {{{property{NAME}}}} macros).
> 
> I don't really agree.

Neither do I!

> Property drawers are for meta data used by
> Org-mode too, obviously, but they are perfectly suited for meta-data
> about the document, as well as those simple data-base features
> described in the manual. Why deny Org users the full benefit of these
> other uses for property-drawers by denying them the possibility to
> export their document meta-data or data-bases?
> 
> I mean, everything else in Org-mode is more or less configurable, why
> hardcode in this case that export is (by default) impossible?
> 
> Whats wrong e.g. with
> 
> ,-------------------------------
> | * My Source-file
> |     :PROPERTIES:
> |     :github-repo: <<repo-url>>
> |     :licence:  <<licence>>
> |     :END:
> `-------------------------------
> 
> ?
> 
> This is not Org meta-data, its meaningless to Org-mode, but its
> meta-data about the document, easily stored and accessed, readable,
> and stays in the background during visibility cycling. And its for
> user consumption, thus there should be a way to export this.
> 
> And whats wrong with a simple CD collection database implemented with
> property-drawers, as described in the manual? Why shouldn't people be
> allowed to export their CD database to some text-formatting backend?
> 
> IMO there should be transoder functions for property-drawers just like
> for other elements in the main backend libs, not in some derived
> backend. If by default they are not exported, nothing changes, but at
> least the user has a choice.

Another use-case: properties might be used as the source of data in
tables/spreadsheets.  Now I *really* would like to export my spreadsheet
to LaTeX, together with the "source data".  (As I wrote on the list
some time ago, I used spreadsheets to prepare solutions to problems for
a course I'm teaching.  Exporting the solutions w/o the givens is
stupid.  Of course, I could put them also in the table, but this seems
artificial for me.

Another use case: assume I prepare a test, with each (sub)node a
problem.  It would be natural to put the maximum mark for each problem
in properties, and (obviously) I'd like to be able to export them
(mapped to some LaTeX command, maybe even something like
\orgproperty{name}{value} - I could deal with the formatting on the
LaTeX side then.).

> cheers,
> Thorsten

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Feature Request] Make property-drawers exportable
  2013-06-17 15:48   ` Thorsten Jolitz
  2013-06-17 18:54     ` Marcin Borkowski
@ 2013-06-17 19:04     ` Nicolas Goaziou
  2013-06-17 20:03       ` Thorsten Jolitz
  2013-09-25  9:31       ` Carsten Dominik
  1 sibling, 2 replies; 24+ messages in thread
From: Nicolas Goaziou @ 2013-06-17 19:04 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> Property drawers are Org meta data, they are not for user's
>> cosumption. Though you can export some properties with macros (see
>> {{{property{NAME}}}} macros).
>
> I don't really agree. Property drawers are for meta data used by
> Org-mode too, obviously, but they are perfectly suited for meta-data
> about the document, as well as those simple data-base features described
> in the manual.

It seems I wasn't clear enough. More on this below.

> Why deny Org users the full benefit of these other uses for
> property-drawers by denying them the possibility to export their
> document meta-data or data-bases?

I don't deny anyone the right code this:

  (defun my-latex-property-drawer (drawer contents info)
    (concat "\\begin{example}\n"
            (org-element-interpret-data drawer)
            "\\end{example}"))

  (org-export-define-derived-backend 'my-latex 'latex
    :translate-alist '((property-drawer . my-latex-property-drawer)))

[...]

> And whats wrong with a simple CD collection database implemented with
> property-drawers, as described in the manual? Why shouldn't people be
> allowed to export their CD database to some text-formatting backend?

Database example is interesting. My point is that you will never want to
dump the whole database in your exported document because Org may fill
it with its own meta-data, making the output look like garbage. Also,
some backends (ox-icalendar, at least) create properties during export,
so you would even get new properties in your output.

It's perfectly fine to export the part of a database you're interested
in, like your whole CD collection, but it requires to filter out Org
meta-data, and to properly format your own properties. This depends so
much on the contents of your database that it is impossible to provide
good defaults for it.

Therefore, default export doesn't even try. Instead, tools are provided
to access values from your own database (again, macro
{{{property(...)}}}) so they can be exported. If you have special needs
for your database, just code them and plug them in.

You have a choice.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Feature Request] Make property-drawers exportable
  2013-06-17 19:04     ` Nicolas Goaziou
@ 2013-06-17 20:03       ` Thorsten Jolitz
  2013-09-25  9:31       ` Carsten Dominik
  1 sibling, 0 replies; 24+ messages in thread
From: Thorsten Jolitz @ 2013-06-17 20:03 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>>> Property drawers are Org meta data, they are not for user's
>>> cosumption. Though you can export some properties with macros (see
>>> {{{property{NAME}}}} macros).
>>
>> I don't really agree. Property drawers are for meta data used by
>> Org-mode too, obviously, but they are perfectly suited for meta-data
>> about the document, as well as those simple data-base features described
>> in the manual.
>
> It seems I wasn't clear enough. More on this below.
>
>> Why deny Org users the full benefit of these other uses for
>> property-drawers by denying them the possibility to export their
>> document meta-data or data-bases?
>
> I don't deny anyone the right code this:
>
>   (defun my-latex-property-drawer (drawer contents info)
>     (concat "\\begin{example}\n"
>             (org-element-interpret-data drawer)
>             "\\end{example}"))
>
>   (org-export-define-derived-backend 'my-latex 'latex
>     :translate-alist '((property-drawer . my-latex-property-drawer)))
>
> [...]

I'm sure you don't, but what if I write some library that should be used
by others that can't be assumed to have installed 'my-latex.el'?
Then I can't base that library on the use of property drawers, what I
really would like to do, since its a feature I like very much, and IMO
one of the best supported features in Org-mode both for interactive and
programmatical use. 

>> And whats wrong with a simple CD collection database implemented with
>> property-drawers, as described in the manual? Why shouldn't people be
>> allowed to export their CD database to some text-formatting backend?
>
> Database example is interesting. My point is that you will never want to
> dump the whole database in your exported document because Org may fill
> it with its own meta-data, making the output look like garbage. Also,
> some backends (ox-icalendar, at least) create properties during export,
> so you would even get new properties in your output.

may be in the database example, but not in my application example -
there, all meta-info in property drawers is suitable for export, and no
other (Org-specific) meta info is added. 

> It's perfectly fine to export the part of a database you're interested
> in, like your whole CD collection, but it requires to filter out Org
> meta-data, and to properly format your own properties. This depends so
> much on the contents of your database that it is impossible to provide
> good defaults for it.
>
> Therefore, default export doesn't even try. Instead, tools are provided
> to access values from your own database (again, macro
> {{{property(...)}}}) so they can be exported. If you have special needs
> for your database, just code them and plug them in.
>
> You have a choice.

Ok, these are arguments that are easily understood. I'll have to take a
second look at those macros, they definitely look ugly, but maybe they
are usefull..

Thanks so far. 

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Feature Request] Make property-drawers exportable
  2013-06-17 19:04     ` Nicolas Goaziou
  2013-06-17 20:03       ` Thorsten Jolitz
@ 2013-09-25  9:31       ` Carsten Dominik
  2013-09-25  9:34         ` Carsten Dominik
  1 sibling, 1 reply; 24+ messages in thread
From: Carsten Dominik @ 2013-09-25  9:31 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Thorsten Jolitz

[-- Attachment #1: Type: text/plain, Size: 4188 bytes --]

Hi everyone,

I would like to come back to this issue.

While I can follow the argumentation that drawers are meta data and that it is really hard for a backend to do something general and correct with them, I am still wondering if it wouldn't be good to have some default way to export them anyway.  I'd be perfectly content to have is such that drawers can be exported as an @example block.  I also think that the export of drawers should definitely be OFF by default.

Having the default backends allow export of drawers as examples opens the door to use filters to modify it.  This has the advantage that a new backend does not have to be defined.  I am experimenting right now with defining filters with Babel in buffers, and I am finding this a powerful way to tweak the export of an individual file.

The reason why I am bringing this up is the following:

I am reviving the Org Issues file, see the other thread on the mailing list.  I would like to be able to export the LOOGBOOK state changes, and these are naturally located in a drawer.

The problem here is that the export is happening on worg, in an automatic way.  So it is not really an easy option to define a new backend that will be used for just this file, because publishing on Worg uses org-to-html.

Now, being the person with the keys, I *could*, of course go and define a special backend on Worg that does what I want - but I do also understand the wish expressed by a couple of people in this thread.

We still have the variable org-export-with-drawers in ox.el.  My proposal would be to set the default to nil, plain and simple, and use a t value to make drawers export as @example.  Safe enough, and easy enough.

Regards

- Carsten

On 17.6.2013, at 21:04, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Thorsten Jolitz <tjolitz@gmail.com> writes:
> 
>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
> 
>>> Property drawers are Org meta data, they are not for user's
>>> cosumption. Though you can export some properties with macros (see
>>> {{{property{NAME}}}} macros).
>> 
>> I don't really agree. Property drawers are for meta data used by
>> Org-mode too, obviously, but they are perfectly suited for meta-data
>> about the document, as well as those simple data-base features described
>> in the manual.
> 
> It seems I wasn't clear enough. More on this below.
> 
>> Why deny Org users the full benefit of these other uses for
>> property-drawers by denying them the possibility to export their
>> document meta-data or data-bases?
> 
> I don't deny anyone the right code this:
> 
>  (defun my-latex-property-drawer (drawer contents info)
>    (concat "\\begin{example}\n"
>            (org-element-interpret-data drawer)
>            "\\end{example}"))
> 
>  (org-export-define-derived-backend 'my-latex 'latex
>    :translate-alist '((property-drawer . my-latex-property-drawer)))
> 
> [...]
> 
>> And whats wrong with a simple CD collection database implemented with
>> property-drawers, as described in the manual? Why shouldn't people be
>> allowed to export their CD database to some text-formatting backend?
> 
> Database example is interesting. My point is that you will never want to
> dump the whole database in your exported document because Org may fill
> it with its own meta-data, making the output look like garbage. Also,
> some backends (ox-icalendar, at least) create properties during export,
> so you would even get new properties in your output.
> 
> It's perfectly fine to export the part of a database you're interested
> in, like your whole CD collection, but it requires to filter out Org
> meta-data, and to properly format your own properties. This depends so
> much on the contents of your database that it is impossible to provide
> good defaults for it.
> 
> Therefore, default export doesn't even try. Instead, tools are provided
> to access values from your own database (again, macro
> {{{property(...)}}}) so they can be exported. If you have special needs
> for your database, just code them and plug them in.
> 
> You have a choice.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou
> 


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Feature Request] Make property-drawers exportable
  2013-09-25  9:31       ` Carsten Dominik
@ 2013-09-25  9:34         ` Carsten Dominik
  2013-09-25 10:33           ` SUMMARY: " Carsten Dominik
  0 siblings, 1 reply; 24+ messages in thread
From: Carsten Dominik @ 2013-09-25  9:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Thorsten Jolitz

[-- Attachment #1: Type: text/plain, Size: 4567 bytes --]


On 25.9.2013, at 11:31, Carsten Dominik <carsten.dominik@gmail.com> wrote:

> Hi everyone,
> 
> I would like to come back to this issue.
> 
> While I can follow the argumentation that drawers are meta data and that it is really hard for a backend to do something general and correct with them, I am still wondering if it wouldn't be good to have some default way to export them anyway.  I'd be perfectly content to have is such that drawers can be exported as an @example block.  I also think that the export of drawers should definitely be OFF by default.
> 
> Having the default backends allow export of drawers as examples opens the door to use filters to modify it.  This has the advantage that a new backend does not have to be defined.  I am experimenting right now with defining filters with Babel in buffers, and I am finding this a powerful way to tweak the export of an individual file.

P.S. of course there is also the possibility that I could use Babel to define or temporarily modify an export backend on the fly - but I have not figured out how this might work......



> 
> The reason why I am bringing this up is the following:
> 
> I am reviving the Org Issues file, see the other thread on the mailing list.  I would like to be able to export the LOOGBOOK state changes, and these are naturally located in a drawer.
> 
> The problem here is that the export is happening on worg, in an automatic way.  So it is not really an easy option to define a new backend that will be used for just this file, because publishing on Worg uses org-to-html.
> 
> Now, being the person with the keys, I *could*, of course go and define a special backend on Worg that does what I want - but I do also understand the wish expressed by a couple of people in this thread.
> 
> We still have the variable org-export-with-drawers in ox.el.  My proposal would be to set the default to nil, plain and simple, and use a t value to make drawers export as @example.  Safe enough, and easy enough.
> 
> Regards
> 
> - Carsten
> 
> On 17.6.2013, at 21:04, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> 
>> Thorsten Jolitz <tjolitz@gmail.com> writes:
>> 
>>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>> 
>>>> Property drawers are Org meta data, they are not for user's
>>>> cosumption. Though you can export some properties with macros (see
>>>> {{{property{NAME}}}} macros).
>>> 
>>> I don't really agree. Property drawers are for meta data used by
>>> Org-mode too, obviously, but they are perfectly suited for meta-data
>>> about the document, as well as those simple data-base features described
>>> in the manual.
>> 
>> It seems I wasn't clear enough. More on this below.
>> 
>>> Why deny Org users the full benefit of these other uses for
>>> property-drawers by denying them the possibility to export their
>>> document meta-data or data-bases?
>> 
>> I don't deny anyone the right code this:
>> 
>> (defun my-latex-property-drawer (drawer contents info)
>>   (concat "\\begin{example}\n"
>>           (org-element-interpret-data drawer)
>>           "\\end{example}"))
>> 
>> (org-export-define-derived-backend 'my-latex 'latex
>>   :translate-alist '((property-drawer . my-latex-property-drawer)))
>> 
>> [...]
>> 
>>> And whats wrong with a simple CD collection database implemented with
>>> property-drawers, as described in the manual? Why shouldn't people be
>>> allowed to export their CD database to some text-formatting backend?
>> 
>> Database example is interesting. My point is that you will never want to
>> dump the whole database in your exported document because Org may fill
>> it with its own meta-data, making the output look like garbage. Also,
>> some backends (ox-icalendar, at least) create properties during export,
>> so you would even get new properties in your output.
>> 
>> It's perfectly fine to export the part of a database you're interested
>> in, like your whole CD collection, but it requires to filter out Org
>> meta-data, and to properly format your own properties. This depends so
>> much on the contents of your database that it is impossible to provide
>> good defaults for it.
>> 
>> Therefore, default export doesn't even try. Instead, tools are provided
>> to access values from your own database (again, macro
>> {{{property(...)}}}) so they can be exported. If you have special needs
>> for your database, just code them and plug them in.
>> 
>> You have a choice.
>> 
>> 
>> Regards,
>> 
>> -- 
>> Nicolas Goaziou
>> 
> 


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25  9:34         ` Carsten Dominik
@ 2013-09-25 10:33           ` Carsten Dominik
  2013-09-25 10:53             ` Thorsten Jolitz
  2013-09-25 11:51             ` Nicolas Goaziou
  0 siblings, 2 replies; 24+ messages in thread
From: Carsten Dominik @ 2013-09-25 10:33 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Thorsten Jolitz

[-- Attachment #1: Type: text/plain, Size: 6187 bytes --]

OK,

now that I have made a fool out of myself, I think I understand now how
things work, and what I did not understand correctly in the
discussion so far.

1. I misunderstood that drawers could not be exported in
   general with the new exporter.   This is wrong, drawers are
   exported just fine as long as org-export-with-drawers
   is t or contains a list of drawer names that should be
   exported.  The reason why I misunderstood was a bug in my test
   file where I have #+OPTIONS: d:(LOGBOOK) instead of d:("LOGBOOK")

2. If a drawer is selected for export, it will be exported as if it
   was part of the Org file.

3. The only exception to this rule are property drawers, which will
   currently not be exported by any of the backends.  Nicolas
   proposed to define a derived backend that does export the property
   drawer, or he proposed to use macros to extract specific properties
   to include into the exported file.  Both are viable options.

I think this is all well and fine and very well argued.

One possible remaining option would be to introduce user variables
org-BACKEND-format-property-drawer-function in analogy
org-BACKEND-format-drawer-function.  This would provide an easy way
to configure export of the property drawer as a whole, in a way
that could be file-local.

I would like to have this option.  Nicolas, would you agree to a patch
in this direction?

- Carsten



On 25.9.2013, at 11:34, Carsten Dominik <carsten.dominik@gmail.com> wrote:

> 
> On 25.9.2013, at 11:31, Carsten Dominik <carsten.dominik@gmail.com> wrote:
> 
>> Hi everyone,
>> 
>> I would like to come back to this issue.
>> 
>> While I can follow the argumentation that drawers are meta data and that it is really hard for a backend to do something general and correct with them, I am still wondering if it wouldn't be good to have some default way to export them anyway.  I'd be perfectly content to have is such that drawers can be exported as an @example block.  I also think that the export of drawers should definitely be OFF by default.
>> 
>> Having the default backends allow export of drawers as examples opens the door to use filters to modify it.  This has the advantage that a new backend does not have to be defined.  I am experimenting right now with defining filters with Babel in buffers, and I am finding this a powerful way to tweak the export of an individual file.
> 
> P.S. of course there is also the possibility that I could use Babel to define or temporarily modify an export backend on the fly - but I have not figured out how this might work......
> 
> 
> 
>> 
>> The reason why I am bringing this up is the following:
>> 
>> I am reviving the Org Issues file, see the other thread on the mailing list.  I would like to be able to export the LOOGBOOK state changes, and these are naturally located in a drawer.
>> 
>> The problem here is that the export is happening on worg, in an automatic way.  So it is not really an easy option to define a new backend that will be used for just this file, because publishing on Worg uses org-to-html.
>> 
>> Now, being the person with the keys, I *could*, of course go and define a special backend on Worg that does what I want - but I do also understand the wish expressed by a couple of people in this thread.
>> 
>> We still have the variable org-export-with-drawers in ox.el.  My proposal would be to set the default to nil, plain and simple, and use a t value to make drawers export as @example.  Safe enough, and easy enough.
>> 
>> Regards
>> 
>> - Carsten
>> 
>> On 17.6.2013, at 21:04, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>> 
>>> Thorsten Jolitz <tjolitz@gmail.com> writes:
>>> 
>>>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>>> 
>>>>> Property drawers are Org meta data, they are not for user's
>>>>> cosumption. Though you can export some properties with macros (see
>>>>> {{{property{NAME}}}} macros).
>>>> 
>>>> I don't really agree. Property drawers are for meta data used by
>>>> Org-mode too, obviously, but they are perfectly suited for meta-data
>>>> about the document, as well as those simple data-base features described
>>>> in the manual.
>>> 
>>> It seems I wasn't clear enough. More on this below.
>>> 
>>>> Why deny Org users the full benefit of these other uses for
>>>> property-drawers by denying them the possibility to export their
>>>> document meta-data or data-bases?
>>> 
>>> I don't deny anyone the right code this:
>>> 
>>> (defun my-latex-property-drawer (drawer contents info)
>>>  (concat "\\begin{example}\n"
>>>          (org-element-interpret-data drawer)
>>>          "\\end{example}"))
>>> 
>>> (org-export-define-derived-backend 'my-latex 'latex
>>>  :translate-alist '((property-drawer . my-latex-property-drawer)))
>>> 
>>> [...]
>>> 
>>>> And whats wrong with a simple CD collection database implemented with
>>>> property-drawers, as described in the manual? Why shouldn't people be
>>>> allowed to export their CD database to some text-formatting backend?
>>> 
>>> Database example is interesting. My point is that you will never want to
>>> dump the whole database in your exported document because Org may fill
>>> it with its own meta-data, making the output look like garbage. Also,
>>> some backends (ox-icalendar, at least) create properties during export,
>>> so you would even get new properties in your output.
>>> 
>>> It's perfectly fine to export the part of a database you're interested
>>> in, like your whole CD collection, but it requires to filter out Org
>>> meta-data, and to properly format your own properties. This depends so
>>> much on the contents of your database that it is impossible to provide
>>> good defaults for it.
>>> 
>>> Therefore, default export doesn't even try. Instead, tools are provided
>>> to access values from your own database (again, macro
>>> {{{property(...)}}}) so they can be exported. If you have special needs
>>> for your database, just code them and plug them in.
>>> 
>>> You have a choice.
>>> 
>>> 
>>> Regards,
>>> 
>>> -- 
>>> Nicolas Goaziou
>>> 
>> 
> 


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 10:33           ` SUMMARY: " Carsten Dominik
@ 2013-09-25 10:53             ` Thorsten Jolitz
  2013-09-25 10:56               ` Carsten Dominik
  2013-09-26  8:44               ` Marcin Borkowski
  2013-09-25 11:51             ` Nicolas Goaziou
  1 sibling, 2 replies; 24+ messages in thread
From: Thorsten Jolitz @ 2013-09-25 10:53 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> 3. The only exception to this rule are property drawers, which will
>    currently not be exported by any of the backends.  Nicolas
>    proposed to define a derived backend that does export the property
>    drawer, or he proposed to use macros to extract specific properties
>    to include into the exported file.  Both are viable options.

> One possible remaining option would be to introduce user variables
> org-BACKEND-format-property-drawer-function in analogy
> org-BACKEND-format-drawer-function.  This would provide an easy way
> to configure export of the property drawer as a whole, in a way
> that could be file-local.
>
> I would like to have this option

+1

property drawers are just too useful to restrict them to Org-mode's 
internal meta-data, and anything that makes it easier to export them
when used for 'use case' related meta-data or as simple DB is welcome. 

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 10:53             ` Thorsten Jolitz
@ 2013-09-25 10:56               ` Carsten Dominik
  2013-09-26  8:44               ` Marcin Borkowski
  1 sibling, 0 replies; 24+ messages in thread
From: Carsten Dominik @ 2013-09-25 10:56 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]


On 25.9.2013, at 12:53, Thorsten Jolitz <tjolitz@gmail.com> wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> 3. The only exception to this rule are property drawers, which will
>>   currently not be exported by any of the backends.  Nicolas
>>   proposed to define a derived backend that does export the property
>>   drawer, or he proposed to use macros to extract specific properties
>>   to include into the exported file.  Both are viable options.
> 
>> One possible remaining option would be to introduce user variables
>> org-BACKEND-format-property-drawer-function in analogy
>> org-BACKEND-format-drawer-function.  This would provide an easy way
>> to configure export of the property drawer as a whole, in a way
>> that could be file-local.
>> 
>> I would like to have this option
> 
> +1
> 
> property drawers are just too useful to restrict them to Org-mode's 
> internal meta-data, and anything that makes it easier to export them
> when used for 'use case' related meta-data or as simple DB is welcome. 

To be sure:  Nicolas' argument that other functions dump data into
the property drawer is completely right, and so I also think that
one would hardly ever want to export the complete drawer.  But
through a function that selects (or deselects), it is useful.

- Carsten

> 
> -- 
> cheers,
> Thorsten
> 
> 


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 10:33           ` SUMMARY: " Carsten Dominik
  2013-09-25 10:53             ` Thorsten Jolitz
@ 2013-09-25 11:51             ` Nicolas Goaziou
  2013-09-25 12:08               ` Carsten Dominik
  2013-09-25 12:12               ` Thorsten Jolitz
  1 sibling, 2 replies; 24+ messages in thread
From: Nicolas Goaziou @ 2013-09-25 11:51 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Thorsten Jolitz, emacs-orgmode

Hello,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> One possible remaining option would be to introduce user variables
> org-BACKEND-format-property-drawer-function in analogy
> org-BACKEND-format-drawer-function.  This would provide an easy way
> to configure export of the property drawer as a whole, in a way
> that could be file-local.
>
> I would like to have this option.  Nicolas, would you agree to a patch
> in this direction?

Unfortunately, this is a bit more difficult.

Indeed, `node-property' elements are distinct from `property-drawer'
elements. I.e., if we want to export property drawers as examples, as
you suggested earlier in this thread, we need to implement two functions
in each back-end: a transcoder for `node-property' and another one for
the `property-drawer' itself. Similarly, in order to implement your
current suggestion, we need both
`org-BACKEND-format-property-drawer-function' and
`org-BACKEND-format-node-property-function'.

IMO, this is a bit much for defcustoms, which are sold as an easy way to
configure Org behaviour.

There may be a slightly different option available: we can introduce
a new defcustom, e.g., `org-export-with-node-properties' (what symbol to
use for short item in OPTIONS?), which will trigger the following
behaviour:

  - when t, export completely all property drawers as examples;

  - when nil, do not export property drawers (default value);

  - when set to a list of strings, export property drawers as examples
    but only include properties matching these strings;

In that case, we need to:

  1. patch ox.el to previous behaviour;
  2. write two transcoder functions for each back-end where property
     drawers make sense and install them in back-end definitions.

For example, in the `latex' back-end, such functions could be:

  (defun org-latex-property-drawer (property-drawer contents info)
    "Transcode a PROPERTY-DRAWER element from Org to LaTeX.
  CONTENTS is the contents of the drawer, as a string.  INFO is
  a plist holding contextual information."
    (and (org-string-nw-p contents)
         (format "\\begin{verbatim}\n%s\\end{verbatim}" contents)))

  (defun org-latex-node-property (node-property contents info)
    "Transcode a NODE-PROPERTY element from Org to LaTeX.
  CONTENTS is nil.  INFO is a plist holding contextual information."
    (format "%s:%s"
            (org-element-property :key node-property)
            (let ((value (org-element-property :value node-property)))
              (if value (concat " " value) ""))))


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 11:51             ` Nicolas Goaziou
@ 2013-09-25 12:08               ` Carsten Dominik
  2013-09-25 12:13                 ` Nicolas Goaziou
  2013-09-25 12:52                 ` Christian Moe
  2013-09-25 12:12               ` Thorsten Jolitz
  1 sibling, 2 replies; 24+ messages in thread
From: Carsten Dominik @ 2013-09-25 12:08 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Thorsten Jolitz, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2931 bytes --]


On 25.9.2013, at 13:51, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> One possible remaining option would be to introduce user variables
>> org-BACKEND-format-property-drawer-function in analogy
>> org-BACKEND-format-drawer-function.  This would provide an easy way
>> to configure export of the property drawer as a whole, in a way
>> that could be file-local.
>> 
>> I would like to have this option.  Nicolas, would you agree to a patch
>> in this direction?
> 
> Unfortunately, this is a bit more difficult.
> 
> Indeed, `node-property' elements are distinct from `property-drawer'
> elements. I.e., if we want to export property drawers as examples, as
> you suggested earlier in this thread, we need to implement two functions
> in each back-end: a transcoder for `node-property' and another one for
> the `property-drawer' itself. Similarly, in order to implement your
> current suggestion, we need both
> `org-BACKEND-format-property-drawer-function' and
> `org-BACKEND-format-node-property-function'.
> 
> IMO, this is a bit much for defcustoms, which are sold as an easy way to
> configure Org behaviour.
> 
> There may be a slightly different option available: we can introduce
> a new defcustom, e.g., `org-export-with-node-properties' (what symbol to
> use for short item in OPTIONS?), which will trigger the following
> behaviour:
> 
>  - when t, export completely all property drawers as examples;
> 
>  - when nil, do not export property drawers (default value);
> 
>  - when set to a list of strings, export property drawers as examples
>    but only include properties matching these strings;

This sounds good to me.  How about allowing also a function
as a value and that function will receive the list of properties
and do with it as it pleases.

I like it!

- Carsten

> 
> In that case, we need to:
> 
>  1. patch ox.el to previous behaviour;
>  2. write two transcoder functions for each back-end where property
>     drawers make sense and install them in back-end definitions.
> 
> For example, in the `latex' back-end, such functions could be:
> 
>  (defun org-latex-property-drawer (property-drawer contents info)
>    "Transcode a PROPERTY-DRAWER element from Org to LaTeX.
>  CONTENTS is the contents of the drawer, as a string.  INFO is
>  a plist holding contextual information."
>    (and (org-string-nw-p contents)
>         (format "\\begin{verbatim}\n%s\\end{verbatim}" contents)))
> 
>  (defun org-latex-node-property (node-property contents info)
>    "Transcode a NODE-PROPERTY element from Org to LaTeX.
>  CONTENTS is nil.  INFO is a plist holding contextual information."
>    (format "%s:%s"
>            (org-element-property :key node-property)
>            (let ((value (org-element-property :value node-property)))
>              (if value (concat " " value) ""))))
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 11:51             ` Nicolas Goaziou
  2013-09-25 12:08               ` Carsten Dominik
@ 2013-09-25 12:12               ` Thorsten Jolitz
  1 sibling, 0 replies; 24+ messages in thread
From: Thorsten Jolitz @ 2013-09-25 12:12 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

Hello,

> There may be a slightly different option available: we can introduce
> a new defcustom, e.g., `org-export-with-node-properties' (what symbol to
> use for short item in OPTIONS?), which will trigger the following
> behaviour:
>
>   - when t, export completely all property drawers as examples;
>
>   - when nil, do not export property drawers (default value);
>
>   - when set to a list of strings, export property drawers as examples
>     but only include properties matching these strings;

with the last option as "list of strings or regexp's" this would be
exactly what I would have needed in some practical use cases, and it
seems to be just natural given the dual nature of property drawers
(storage for Org-mode-internal data and storage for use-case related
data).

With 'strings or regexp's' I mean that it should be possible to match on
key-prefixes, like FOO in the following example

* My Header
  :PROPERTIES:
  :CUSTOM_ID: ABC123
  :FOO_BAR:  13
  :FOO_FOO:  bar bar
  :END:

no matter if the user actually has to give a regexp or if ox.el takes care of
bulding a regexp from a given string like 

,----------------------------------------------
| (let ((rgxp (concat strg  "[_-[:word:]]*"))))
`----------------------------------------------

or so...

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 12:08               ` Carsten Dominik
@ 2013-09-25 12:13                 ` Nicolas Goaziou
  2013-09-25 12:26                   ` Carsten Dominik
  2013-09-25 12:52                 ` Christian Moe
  1 sibling, 1 reply; 24+ messages in thread
From: Nicolas Goaziou @ 2013-09-25 12:13 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Thorsten Jolitz

Carsten Dominik <carsten.dominik@gmail.com> writes:

> This sounds good to me.  How about allowing also a function
> as a value and that function will receive the list of properties
> and do with it as it pleases.

At first I thought about it but I realized that was exactly what
a filter could do. Do we need to introduce redundancy here?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 12:13                 ` Nicolas Goaziou
@ 2013-09-25 12:26                   ` Carsten Dominik
  2013-09-25 20:57                     ` Nicolas Goaziou
  0 siblings, 1 reply; 24+ messages in thread
From: Carsten Dominik @ 2013-09-25 12:26 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Thorsten Jolitz

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]


On 25.9.2013, at 14:13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> This sounds good to me.  How about allowing also a function
>> as a value and that function will receive the list of properties
>> and do with it as it pleases.
> 
> At first I thought about it but I realized that was exactly what
> a filter could do. Do we need to introduce redundancy here?

Not really.  It would simplify processing to have the list instead
of a string, but indeed, a filter can accomplish all of it.

Regards

- Carsten

> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 12:08               ` Carsten Dominik
  2013-09-25 12:13                 ` Nicolas Goaziou
@ 2013-09-25 12:52                 ` Christian Moe
  1 sibling, 0 replies; 24+ messages in thread
From: Christian Moe @ 2013-09-25 12:52 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Thorsten Jolitz, emacs-orgmode, Nicolas Goaziou



>>  - when t, export completely all property drawers as examples;
>> 
>>  - when nil, do not export property drawers (default value);
>> 
>>  - when set to a list of strings, export property drawers as examples
>>    but only include properties matching these strings;

+1

Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 12:26                   ` Carsten Dominik
@ 2013-09-25 20:57                     ` Nicolas Goaziou
  2013-09-26 11:28                       ` Carsten Dominik
  0 siblings, 1 reply; 24+ messages in thread
From: Nicolas Goaziou @ 2013-09-25 20:57 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Thorsten Jolitz, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

Carsten Dominik <carsten.dominik@gmail.com> writes:

> Not really.  It would simplify processing to have the list instead
> of a string, but indeed, a filter can accomplish all of it.

Here is a first patch. It doesn't handle export back-ends in contrib.


Regards,

-- 
Nicolas Goaziou

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-Add-a-defcustom-to-export-properties-drawers.patch --]
[-- Type: text/x-diff, Size: 17097 bytes --]

From c48974d10e0d57b6332fcfed384a49ee530ea04a Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
Date: Wed, 25 Sep 2013 21:27:29 +0200
Subject: [PATCH] ox: Add a defcustom to export properties drawers

* lisp/ox.el (org-export-with-drawers): Improve docstring.
(org-export-with-properties): New variable
(org-export--skip-p): Handle new variable.
(org-export-options-alist): Install new variable.
* lisp/ox-ascii.el (org-ascii-node-property,
  org-ascii-property-drawer): New functions.
* lisp/ox-html.el (org-html-node-property): New function.
(org-html-property-drawer): Export property drawers as "pre" blocks.
* lisp/ox-latex.el (org-latex-property-drawer,
  org-latex-node-property): New functions.
* lisp/ox-man.el (org-man-node-property, org-man-property-drawer): New
  functions.
* lisp/ox-md.el (org-md-node-property, org-md-property-drawer): New
  functions.
* lisp/ox-odt.el (org-odt-node-property): New function.
(org-odt-property-drawer): Export property drawers as fixed width
blocks.
* lisp/ox-texinfo.el (org-texinfo-node-property): New function.
(org-texinfo-property-drawer): Export property drawers as verbatim
blocks.
* testing/lisp/test-ox.el: Add tests.
---
 lisp/ox-ascii.el        | 23 +++++++++++++++++++++++
 lisp/ox-html.el         | 21 ++++++++++++++++-----
 lisp/ox-latex.el        | 25 ++++++++++++++++++++++++-
 lisp/ox-man.el          | 19 ++++++++++++++++++-
 lisp/ox-md.el           | 24 ++++++++++++++++++++++++
 lisp/ox-odt.el          | 23 ++++++++++++++++++-----
 lisp/ox-texinfo.el      | 21 ++++++++++++++++-----
 lisp/ox.el              | 28 +++++++++++++++++++++++++---
 testing/lisp/test-ox.el | 19 +++++++++++++++++++
 9 files changed, 183 insertions(+), 20 deletions(-)

diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index 74a7c64..e0a3fa9 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -81,10 +81,12 @@
     (latex-fragment . org-ascii-latex-fragment)
     (line-break . org-ascii-line-break)
     (link . org-ascii-link)
+    (node-property . org-ascii-node-property)
     (paragraph . org-ascii-paragraph)
     (plain-list . org-ascii-plain-list)
     (plain-text . org-ascii-plain-text)
     (planning . org-ascii-planning)
+    (property-drawer . org-ascii-property-drawer)
     (quote-block . org-ascii-quote-block)
     (quote-section . org-ascii-quote-section)
     (radio-target . org-ascii-radio-target)
@@ -1440,6 +1442,18 @@ INFO is a plist holding contextual information."
 	 (unless org-ascii-links-to-notes (format " (%s)" raw-link))))))))
 
 
+;;;; Node Properties
+
+(defun org-ascii-node-property (node-property contents info)
+  "Transcode a NODE-PROPERTY element from Org to ASCII.
+CONTENTS is nil.  INFO is a plist holding contextual
+information."
+  (format "%s:%s"
+          (org-element-property :key node-property)
+          (let ((value (org-element-property :value node-property)))
+            (if value (concat " " value) ""))))
+
+
 ;;;; Paragraph
 
 (defun org-ascii-paragraph (paragraph contents info)
@@ -1509,6 +1523,15 @@ channel."
    " "))
 
 
+;;;; Property Drawer
+
+(defun org-ascii-property-drawer (property-drawer contents info)
+  "Transcode a PROPERTY-DRAWER element from Org to ASCII.
+CONTENTS holds the contents of the drawer.  INFO is a plist
+holding contextual information."
+  (org-string-nw-p contents))
+
+
 ;;;; Quote Block
 
 (defun org-ascii-quote-block (quote-block contents info)
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 14b31b2..66862bc 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -76,6 +76,7 @@
     (latex-fragment . org-html-latex-fragment)
     (line-break . org-html-line-break)
     (link . org-html-link)
+    (node-property . org-html-node-property)
     (paragraph . org-html-paragraph)
     (plain-list . org-html-plain-list)
     (plain-text . org-html-plain-text)
@@ -2782,6 +2783,17 @@ INFO is a plist holding contextual information.  See
      ;; No path, only description.  Try to do something useful.
      (t (format "<i>%s</i>" desc)))))
 
+;;;; Node Property
+
+(defun org-html-node-property (node-property contents info)
+  "Transcode a NODE-PROPERTY element from Org to HTML.
+CONTENTS is nil.  INFO is a plist holding contextual
+information."
+  (format "%s:%s"
+          (org-element-property :key node-property)
+          (let ((value (org-element-property :value node-property)))
+            (if value (concat " " value) ""))))
+
 ;;;; Paragraph
 
 (defun org-html-paragraph (paragraph contents info)
@@ -2930,11 +2942,10 @@ channel."
 
 (defun org-html-property-drawer (property-drawer contents info)
   "Transcode a PROPERTY-DRAWER element from Org to HTML.
-CONTENTS is nil.  INFO is a plist holding contextual
-information."
-  ;; The property drawer isn't exported but we want separating blank
-  ;; lines nonetheless.
-  "")
+CONTENTS holds the contents of the drawer.  INFO is a plist
+holding contextual information."
+  (and (org-string-nw-p contents)
+       (format "<pre class=\"example\">\n%s</pre>" contents)))
 
 ;;;; Quote Block
 
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index e1173ef..196e50f 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -63,11 +63,12 @@
     (latex-fragment . org-latex-latex-fragment)
     (line-break . org-latex-line-break)
     (link . org-latex-link)
+    (node-property . org-latex-node-property)
     (paragraph . org-latex-paragraph)
     (plain-list . org-latex-plain-list)
     (plain-text . org-latex-plain-text)
     (planning . org-latex-planning)
-    (property-drawer . (lambda (&rest args) ""))
+    (property-drawer . org-latex-property-drawer)
     (quote-block . org-latex-quote-block)
     (quote-section . org-latex-quote-section)
     (radio-target . org-latex-radio-target)
@@ -1837,6 +1838,18 @@ INFO is a plist holding contextual information.  See
      (t (format org-latex-link-with-unknown-path-format desc)))))
 
 
+;;;; Node Property
+
+(defun org-latex-node-property (node-property contents info)
+  "Transcode a NODE-PROPERTY element from Org to LaTeX.
+CONTENTS is nil.  INFO is a plist holding contextual
+information."
+  (format "%s:%s"
+          (org-element-property :key node-property)
+          (let ((value (org-element-property :value node-property)))
+            (if value (concat " " value) ""))))
+
+
 ;;;; Paragraph
 
 (defun org-latex-paragraph (paragraph contents info)
@@ -1961,6 +1974,16 @@ information."
    "\\\\"))
 
 
+;;;; Property Drawer
+
+(defun org-latex-property-drawer (property-drawer contents info)
+  "Transcode a PROPERTY-DRAWER element from Org to LaTeX.
+CONTENTS holds the contents of the drawer.  INFO is a plist
+holding contextual information."
+  (and (org-string-nw-p contents)
+       (format "\\begin{verbatim}\n%s\\end{verbatim}" contents)))
+
+
 ;;;; Quote Block
 
 (defun org-latex-quote-block (quote-block contents info)
diff --git a/lisp/ox-man.el b/lisp/ox-man.el
index a160e4c..760e264 100644
--- a/lisp/ox-man.el
+++ b/lisp/ox-man.el
@@ -76,11 +76,12 @@
     (keyword . org-man-keyword)
     (line-break . org-man-line-break)
     (link . org-man-link)
+    (node-property . org-man-node-property)
     (paragraph . org-man-paragraph)
     (plain-list . org-man-plain-list)
     (plain-text . org-man-plain-text)
     (planning . org-man-planning)
-    (property-drawer . (lambda (&rest args) ""))
+    (property-drawer . org-man-property-drawer)
     (quote-block . org-man-quote-block)
     (quote-section . org-man-quote-section)
     (radio-target . org-man-radio-target)
@@ -663,6 +664,16 @@ INFO is a plist holding contextual information.  See
      ;; No path, only description.  Try to do something useful.
      (t (format "\\fI%s\\fP" desc)))))
 
+;;;; Node Property
+
+(defun org-man-node-property (node-property contents info)
+  "Transcode a NODE-PROPERTY element from Org to Man.
+CONTENTS is nil.  INFO is a plist holding contextual
+information."
+  (format "%s:%s"
+          (org-element-property :key node-property)
+          (let ((value (org-element-property :value node-property)))
+            (if value (concat " " value) ""))))
 
 ;;; Paragraph
 
@@ -722,6 +733,12 @@ contextual information."
 
 ;;; Property Drawer
 
+(defun org-man-property-drawer (property-drawer contents info)
+  "Transcode a PROPERTY-DRAWER element from Org to Man.
+CONTENTS holds the contents of the drawer.  INFO is a plist
+holding contextual information."
+  (and (org-string-nw-p contents)
+       (format ".RS\n.nf\n%s\n.fi\n.RE" contents)))
 
 ;;; Quote Block
 
diff --git a/lisp/ox-md.el b/lisp/ox-md.el
index feb611c..1114c50 100644
--- a/lisp/ox-md.el
+++ b/lisp/ox-md.el
@@ -82,9 +82,11 @@ This variable can be set to either `atx' or `setext'."
 		     (item . org-md-item)
 		     (line-break . org-md-line-break)
 		     (link . org-md-link)
+		     (node-property . org-md-node-property)
 		     (paragraph . org-md-paragraph)
 		     (plain-list . org-md-plain-list)
 		     (plain-text . org-md-plain-text)
+		     (property-drawer . org-md-property-drawer)
 		     (quote-block . org-md-quote-block)
 		     (quote-section . org-md-example-block)
 		     (section . org-md-section)
@@ -334,6 +336,18 @@ a communication channel."
 		 (format "[%s](%s)" contents path)))))))
 
 
+;;;; Node Property
+
+(defun org-md-node-property (node-property contents info)
+  "Transcode a NODE-PROPERTY element into Markdown syntax.
+CONTENTS is nil.  INFO is a plist holding contextual
+information."
+  (format "%s:%s"
+          (org-element-property :key node-property)
+          (let ((value (org-element-property :value node-property)))
+            (if value (concat " " value) ""))))
+
+
 ;;;; Paragraph
 
 (defun org-md-paragraph (paragraph contents info)
@@ -382,6 +396,16 @@ contextual information."
   text)
 
 
+;;;; Property Drawer
+
+(defun org-md-property-drawer (property-drawer contents info)
+  "Transcode a PROPERTY-DRAWER element into Markdown format.
+CONTENTS holds the contents of the drawer.  INFO is a plist
+holding contextual information."
+  (and (org-string-nw-p contents)
+       (replace-regexp-in-string "^" "    " contents)))
+
+
 ;;;; Quote Block
 
 (defun org-md-quote-block (quote-block contents info)
diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index ae9e473..57a9b6e 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -59,6 +59,7 @@
     (latex-fragment . org-odt-latex-fragment)
     (line-break . org-odt-line-break)
     (link . org-odt-link)
+    (node-property . org-odt-node-property)
     (paragraph . org-odt-paragraph)
     (plain-list . org-odt-plain-list)
     (plain-text . org-odt-plain-text)
@@ -2868,6 +2869,18 @@ INFO is a plist holding contextual information.  See
 		"Emphasis" desc)))))
 
 
+;;;; Node Property
+
+(defun org-odt-node-property (node-property contents info)
+  "Transcode a NODE-PROPERTY element from Org to ODT.
+CONTENTS is nil.  INFO is a plist holding contextual
+information."
+  (org-odt--encode-plain-text
+   (format "%s:%s"
+	   (org-element-property :key node-property)
+	   (let ((value (org-element-property :value node-property)))
+	     (if value (concat " " value) "")))))
+
 ;;;; Paragraph
 
 (defun org-odt--format-paragraph (paragraph contents default center quote)
@@ -3005,11 +3018,11 @@ channel."
 
 (defun org-odt-property-drawer (property-drawer contents info)
   "Transcode a PROPERTY-DRAWER element from Org to ODT.
-CONTENTS is nil.  INFO is a plist holding contextual
-information."
-  ;; The property drawer isn't exported but we want separating blank
-  ;; lines nonetheless.
-  "")
+CONTENTS holds the contents of the drawer.  INFO is a plist
+holding contextual information."
+  (and (org-string-nw-p contents)
+       (format "<text:p text:style-name=\"OrgFixedWidthBlock\">%s</text:p>"
+	       contents)))
 
 
 ;;;; Quote Block
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index d289e60..c834087 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -89,6 +89,7 @@
     (keyword . org-texinfo-keyword)
     (line-break . org-texinfo-line-break)
     (link . org-texinfo-link)
+    (node-property . org-texinfo-node-property)
     (paragraph . org-texinfo-paragraph)
     (plain-list . org-texinfo-plain-list)
     (plain-text . org-texinfo-plain-text)
@@ -1294,6 +1295,17 @@ are generated directly."
       ;;(org-texinfo--build-detailed-menu parse top info)
       (org-texinfo--build-menu parse 1 info 'detailed)))))
 
+;;;; Node Property
+
+(defun org-texinfo-node-property (node-property contents info)
+  "Transcode a NODE-PROPERTY element from Org to Texinfo.
+CONTENTS is nil.  INFO is a plist holding contextual
+information."
+  (format "%s:%s"
+          (org-element-property :key node-property)
+          (let ((value (org-element-property :value node-property)))
+            (if value (concat " " value) ""))))
+
 ;;; Paragraph
 
 (defun org-texinfo-paragraph (paragraph contents info)
@@ -1398,11 +1410,10 @@ information."
 
 (defun org-texinfo-property-drawer (property-drawer contents info)
   "Transcode a PROPERTY-DRAWER element from Org to Texinfo.
-CONTENTS is nil.  INFO is a plist holding contextual
-information."
-  ;; The property drawer isn't exported but we want separating blank
-  ;; lines nonetheless.
-  "")
+CONTENTS holds the contents of the drawer.  INFO is a plist
+holding contextual information."
+  (and (org-string-nw-p contents)
+       (format "@verbatim\n%s@end verbatim" contents)))
 
 ;;; Quote Block
 
diff --git a/lisp/ox.el b/lisp/ox.el
index 6c59368..7e1d932 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -128,6 +128,7 @@
     (:with-latex nil "tex" org-export-with-latex)
     (:with-planning nil "p" org-export-with-planning)
     (:with-priority nil "pri" org-export-with-priority)
+    (:with-properties nil "prop" org-export-with-properties)
     (:with-smart-quotes nil "'" org-export-with-smart-quotes)
     (:with-special-strings nil "-" org-export-with-special-strings)
     (:with-statistics-cookies nil "stat" org-export-with-statistics-cookies)
@@ -396,10 +397,11 @@ This option can also be set on with the CREATOR keyword."
   "Non-nil means export contents of standard drawers.
 
 When t, all drawers are exported.  This may also be a list of
-drawer names to export.  If that list starts with `not', only
-drawers with such names will be ignored.
+drawer names to export, as strings.  If that list starts with
+`not', only drawers with such names will be ignored.
 
-This variable doesn't apply to properties drawers.
+This variable doesn't apply to properties drawers.  See
+`org-export-with-properties' instead.
 
 This option can also be set with the OPTIONS keyword,
 e.g. \"d:nil\"."
@@ -557,6 +559,19 @@ e.g. \"pri:t\"."
   :group 'org-export-general
   :type 'boolean)
 
+(defcustom org-export-with-properties nil
+  "Non-nil means export contents of properties drawers.
+
+When t, all properties are exported.  This may also be a list of
+properties to export, as strings.
+
+This option can also be set with the OPTIONS keyword,
+e.g. \"prop:t\"."
+  :group 'org-export-general
+  :version "24.4"
+  :package-version '(Org . "8.2")
+  :type 'boolean)
+
 (defcustom org-export-with-section-numbers t
   "Non-nil means add section numbers to headlines when exporting.
 
@@ -2072,7 +2087,14 @@ a tree with a select tag."
 		      (not (eq todo-type with-tasks)))
 		 (and (consp with-tasks) (not (member todo with-tasks))))))))
     ((latex-environment latex-fragment) (not (plist-get options :with-latex)))
+    (node-property
+     (let ((properties-set (plist-get options :with-properties)))
+       (cond ((null properties-set) t)
+	     ((consp properties-set)
+	      (not (member-ignore-case (org-element-property :key blob)
+				       properties-set))))))
     (planning (not (plist-get options :with-planning)))
+    (property-drawer (not (plist-get options :with-properties)))
     (statistics-cookie (not (plist-get options :with-statistics-cookies)))
     (table-cell
      (and (org-export-table-has-special-column-p
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index 54248cb..47c68d7 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -479,6 +479,25 @@ Paragraph"
 	    (org-test-with-temp-text "CLOSED: [2012-04-29 sun. 10:45]"
 	      (org-export-as (org-test-default-backend)
 			     nil nil nil '(:with-planning nil))))))
+  ;; Property Drawers.
+  (should
+   (equal "* H1\n"
+	  (org-test-with-temp-text
+	      "* H1\n  :PROPERTIES:\n  :PROP: value\n  :END:"
+	    (org-export-as (org-test-default-backend)
+			   nil nil nil '(:with-properties nil)))))
+  (should
+   (equal "* H1\n:PROPERTIES:\n:PROP:     value\n:END:\n"
+	  (org-test-with-temp-text
+	      "* H1\n  :PROPERTIES:\n  :PROP: value\n  :END:"
+	    (org-export-as (org-test-default-backend)
+			   nil nil nil '(:with-properties t)))))
+  (should
+   (equal "* H1\n:PROPERTIES:\n:B:        2\n:END:\n"
+	  (org-test-with-temp-text
+	      "* H1\n  :PROPERTIES:\n  :A: 1\n  :B: 2\n:END:"
+	    (org-export-as (org-test-default-backend)
+			   nil nil nil '(:with-properties ("B"))))))
   ;; Statistics cookies.
   (should
    (equal ""
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 10:53             ` Thorsten Jolitz
  2013-09-25 10:56               ` Carsten Dominik
@ 2013-09-26  8:44               ` Marcin Borkowski
  1 sibling, 0 replies; 24+ messages in thread
From: Marcin Borkowski @ 2013-09-26  8:44 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-09-25, o godz. 12:53:18
Thorsten Jolitz <tjolitz@gmail.com> napisał(a):

> > One possible remaining option would be to introduce user variables
> > org-BACKEND-format-property-drawer-function in analogy
> > org-BACKEND-format-drawer-function.  This would provide an easy way
> > to configure export of the property drawer as a whole, in a way
> > that could be file-local.
> >
> > I would like to have this option
> 
> +1
> 
> property drawers are just too useful to restrict them to Org-mode's 
> internal meta-data, and anything that makes it easier to export them
> when used for 'use case' related meta-data or as simple DB is
> welcome. 

I hardly ever use export, but: AFAIR, properties can be used to provide
data for the spreadsheet.  Exporting with them would be very useful for
educational material (my use case: loan payment table with data like
interest rate etc. in properties).

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-25 20:57                     ` Nicolas Goaziou
@ 2013-09-26 11:28                       ` Carsten Dominik
  2013-09-26 11:48                         ` Nicolas Goaziou
  0 siblings, 1 reply; 24+ messages in thread
From: Carsten Dominik @ 2013-09-26 11:28 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Thorsten Jolitz, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 19008 bytes --]

Hi,

this does look good to me, except that the customize type of
org-export-with-properties needs to be extended to allow for the
list of strings.

Please just go ahead and apply it to master, then I and hopefully others will test it further.

- Carsten

On 25.9.2013, at 22:57, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> Not really.  It would simplify processing to have the list instead
>> of a string, but indeed, a filter can accomplish all of it.
> 
> Here is a first patch. It doesn't handle export back-ends in contrib.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou
> From c48974d10e0d57b6332fcfed384a49ee530ea04a Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <n.goaziou@gmail.com>
> Date: Wed, 25 Sep 2013 21:27:29 +0200
> Subject: [PATCH] ox: Add a defcustom to export properties drawers
> 
> * lisp/ox.el (org-export-with-drawers): Improve docstring.
> (org-export-with-properties): New variable
> (org-export--skip-p): Handle new variable.
> (org-export-options-alist): Install new variable.
> * lisp/ox-ascii.el (org-ascii-node-property,
>  org-ascii-property-drawer): New functions.
> * lisp/ox-html.el (org-html-node-property): New function.
> (org-html-property-drawer): Export property drawers as "pre" blocks.
> * lisp/ox-latex.el (org-latex-property-drawer,
>  org-latex-node-property): New functions.
> * lisp/ox-man.el (org-man-node-property, org-man-property-drawer): New
>  functions.
> * lisp/ox-md.el (org-md-node-property, org-md-property-drawer): New
>  functions.
> * lisp/ox-odt.el (org-odt-node-property): New function.
> (org-odt-property-drawer): Export property drawers as fixed width
> blocks.
> * lisp/ox-texinfo.el (org-texinfo-node-property): New function.
> (org-texinfo-property-drawer): Export property drawers as verbatim
> blocks.
> * testing/lisp/test-ox.el: Add tests.
> ---
> lisp/ox-ascii.el        | 23 +++++++++++++++++++++++
> lisp/ox-html.el         | 21 ++++++++++++++++-----
> lisp/ox-latex.el        | 25 ++++++++++++++++++++++++-
> lisp/ox-man.el          | 19 ++++++++++++++++++-
> lisp/ox-md.el           | 24 ++++++++++++++++++++++++
> lisp/ox-odt.el          | 23 ++++++++++++++++++-----
> lisp/ox-texinfo.el      | 21 ++++++++++++++++-----
> lisp/ox.el              | 28 +++++++++++++++++++++++++---
> testing/lisp/test-ox.el | 19 +++++++++++++++++++
> 9 files changed, 183 insertions(+), 20 deletions(-)
> 
> diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
> index 74a7c64..e0a3fa9 100644
> --- a/lisp/ox-ascii.el
> +++ b/lisp/ox-ascii.el
> @@ -81,10 +81,12 @@
>     (latex-fragment . org-ascii-latex-fragment)
>     (line-break . org-ascii-line-break)
>     (link . org-ascii-link)
> +    (node-property . org-ascii-node-property)
>     (paragraph . org-ascii-paragraph)
>     (plain-list . org-ascii-plain-list)
>     (plain-text . org-ascii-plain-text)
>     (planning . org-ascii-planning)
> +    (property-drawer . org-ascii-property-drawer)
>     (quote-block . org-ascii-quote-block)
>     (quote-section . org-ascii-quote-section)
>     (radio-target . org-ascii-radio-target)
> @@ -1440,6 +1442,18 @@ INFO is a plist holding contextual information."
> 	 (unless org-ascii-links-to-notes (format " (%s)" raw-link))))))))
> 
> 
> +;;;; Node Properties
> +
> +(defun org-ascii-node-property (node-property contents info)
> +  "Transcode a NODE-PROPERTY element from Org to ASCII.
> +CONTENTS is nil.  INFO is a plist holding contextual
> +information."
> +  (format "%s:%s"
> +          (org-element-property :key node-property)
> +          (let ((value (org-element-property :value node-property)))
> +            (if value (concat " " value) ""))))
> +
> +
> ;;;; Paragraph
> 
> (defun org-ascii-paragraph (paragraph contents info)
> @@ -1509,6 +1523,15 @@ channel."
>    " "))
> 
> 
> +;;;; Property Drawer
> +
> +(defun org-ascii-property-drawer (property-drawer contents info)
> +  "Transcode a PROPERTY-DRAWER element from Org to ASCII.
> +CONTENTS holds the contents of the drawer.  INFO is a plist
> +holding contextual information."
> +  (org-string-nw-p contents))
> +
> +
> ;;;; Quote Block
> 
> (defun org-ascii-quote-block (quote-block contents info)
> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index 14b31b2..66862bc 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -76,6 +76,7 @@
>     (latex-fragment . org-html-latex-fragment)
>     (line-break . org-html-line-break)
>     (link . org-html-link)
> +    (node-property . org-html-node-property)
>     (paragraph . org-html-paragraph)
>     (plain-list . org-html-plain-list)
>     (plain-text . org-html-plain-text)
> @@ -2782,6 +2783,17 @@ INFO is a plist holding contextual information.  See
>      ;; No path, only description.  Try to do something useful.
>      (t (format "<i>%s</i>" desc)))))
> 
> +;;;; Node Property
> +
> +(defun org-html-node-property (node-property contents info)
> +  "Transcode a NODE-PROPERTY element from Org to HTML.
> +CONTENTS is nil.  INFO is a plist holding contextual
> +information."
> +  (format "%s:%s"
> +          (org-element-property :key node-property)
> +          (let ((value (org-element-property :value node-property)))
> +            (if value (concat " " value) ""))))
> +
> ;;;; Paragraph
> 
> (defun org-html-paragraph (paragraph contents info)
> @@ -2930,11 +2942,10 @@ channel."
> 
> (defun org-html-property-drawer (property-drawer contents info)
>   "Transcode a PROPERTY-DRAWER element from Org to HTML.
> -CONTENTS is nil.  INFO is a plist holding contextual
> -information."
> -  ;; The property drawer isn't exported but we want separating blank
> -  ;; lines nonetheless.
> -  "")
> +CONTENTS holds the contents of the drawer.  INFO is a plist
> +holding contextual information."
> +  (and (org-string-nw-p contents)
> +       (format "<pre class=\"example\">\n%s</pre>" contents)))
> 
> ;;;; Quote Block
> 
> diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
> index e1173ef..196e50f 100644
> --- a/lisp/ox-latex.el
> +++ b/lisp/ox-latex.el
> @@ -63,11 +63,12 @@
>     (latex-fragment . org-latex-latex-fragment)
>     (line-break . org-latex-line-break)
>     (link . org-latex-link)
> +    (node-property . org-latex-node-property)
>     (paragraph . org-latex-paragraph)
>     (plain-list . org-latex-plain-list)
>     (plain-text . org-latex-plain-text)
>     (planning . org-latex-planning)
> -    (property-drawer . (lambda (&rest args) ""))
> +    (property-drawer . org-latex-property-drawer)
>     (quote-block . org-latex-quote-block)
>     (quote-section . org-latex-quote-section)
>     (radio-target . org-latex-radio-target)
> @@ -1837,6 +1838,18 @@ INFO is a plist holding contextual information.  See
>      (t (format org-latex-link-with-unknown-path-format desc)))))
> 
> 
> +;;;; Node Property
> +
> +(defun org-latex-node-property (node-property contents info)
> +  "Transcode a NODE-PROPERTY element from Org to LaTeX.
> +CONTENTS is nil.  INFO is a plist holding contextual
> +information."
> +  (format "%s:%s"
> +          (org-element-property :key node-property)
> +          (let ((value (org-element-property :value node-property)))
> +            (if value (concat " " value) ""))))
> +
> +
> ;;;; Paragraph
> 
> (defun org-latex-paragraph (paragraph contents info)
> @@ -1961,6 +1974,16 @@ information."
>    "\\\\"))
> 
> 
> +;;;; Property Drawer
> +
> +(defun org-latex-property-drawer (property-drawer contents info)
> +  "Transcode a PROPERTY-DRAWER element from Org to LaTeX.
> +CONTENTS holds the contents of the drawer.  INFO is a plist
> +holding contextual information."
> +  (and (org-string-nw-p contents)
> +       (format "\\begin{verbatim}\n%s\\end{verbatim}" contents)))
> +
> +
> ;;;; Quote Block
> 
> (defun org-latex-quote-block (quote-block contents info)
> diff --git a/lisp/ox-man.el b/lisp/ox-man.el
> index a160e4c..760e264 100644
> --- a/lisp/ox-man.el
> +++ b/lisp/ox-man.el
> @@ -76,11 +76,12 @@
>     (keyword . org-man-keyword)
>     (line-break . org-man-line-break)
>     (link . org-man-link)
> +    (node-property . org-man-node-property)
>     (paragraph . org-man-paragraph)
>     (plain-list . org-man-plain-list)
>     (plain-text . org-man-plain-text)
>     (planning . org-man-planning)
> -    (property-drawer . (lambda (&rest args) ""))
> +    (property-drawer . org-man-property-drawer)
>     (quote-block . org-man-quote-block)
>     (quote-section . org-man-quote-section)
>     (radio-target . org-man-radio-target)
> @@ -663,6 +664,16 @@ INFO is a plist holding contextual information.  See
>      ;; No path, only description.  Try to do something useful.
>      (t (format "\\fI%s\\fP" desc)))))
> 
> +;;;; Node Property
> +
> +(defun org-man-node-property (node-property contents info)
> +  "Transcode a NODE-PROPERTY element from Org to Man.
> +CONTENTS is nil.  INFO is a plist holding contextual
> +information."
> +  (format "%s:%s"
> +          (org-element-property :key node-property)
> +          (let ((value (org-element-property :value node-property)))
> +            (if value (concat " " value) ""))))
> 
> ;;; Paragraph
> 
> @@ -722,6 +733,12 @@ contextual information."
> 
> ;;; Property Drawer
> 
> +(defun org-man-property-drawer (property-drawer contents info)
> +  "Transcode a PROPERTY-DRAWER element from Org to Man.
> +CONTENTS holds the contents of the drawer.  INFO is a plist
> +holding contextual information."
> +  (and (org-string-nw-p contents)
> +       (format ".RS\n.nf\n%s\n.fi\n.RE" contents)))
> 
> ;;; Quote Block
> 
> diff --git a/lisp/ox-md.el b/lisp/ox-md.el
> index feb611c..1114c50 100644
> --- a/lisp/ox-md.el
> +++ b/lisp/ox-md.el
> @@ -82,9 +82,11 @@ This variable can be set to either `atx' or `setext'."
> 		     (item . org-md-item)
> 		     (line-break . org-md-line-break)
> 		     (link . org-md-link)
> +		     (node-property . org-md-node-property)
> 		     (paragraph . org-md-paragraph)
> 		     (plain-list . org-md-plain-list)
> 		     (plain-text . org-md-plain-text)
> +		     (property-drawer . org-md-property-drawer)
> 		     (quote-block . org-md-quote-block)
> 		     (quote-section . org-md-example-block)
> 		     (section . org-md-section)
> @@ -334,6 +336,18 @@ a communication channel."
> 		 (format "[%s](%s)" contents path)))))))
> 
> 
> +;;;; Node Property
> +
> +(defun org-md-node-property (node-property contents info)
> +  "Transcode a NODE-PROPERTY element into Markdown syntax.
> +CONTENTS is nil.  INFO is a plist holding contextual
> +information."
> +  (format "%s:%s"
> +          (org-element-property :key node-property)
> +          (let ((value (org-element-property :value node-property)))
> +            (if value (concat " " value) ""))))
> +
> +
> ;;;; Paragraph
> 
> (defun org-md-paragraph (paragraph contents info)
> @@ -382,6 +396,16 @@ contextual information."
>   text)
> 
> 
> +;;;; Property Drawer
> +
> +(defun org-md-property-drawer (property-drawer contents info)
> +  "Transcode a PROPERTY-DRAWER element into Markdown format.
> +CONTENTS holds the contents of the drawer.  INFO is a plist
> +holding contextual information."
> +  (and (org-string-nw-p contents)
> +       (replace-regexp-in-string "^" "    " contents)))
> +
> +
> ;;;; Quote Block
> 
> (defun org-md-quote-block (quote-block contents info)
> diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
> index ae9e473..57a9b6e 100644
> --- a/lisp/ox-odt.el
> +++ b/lisp/ox-odt.el
> @@ -59,6 +59,7 @@
>     (latex-fragment . org-odt-latex-fragment)
>     (line-break . org-odt-line-break)
>     (link . org-odt-link)
> +    (node-property . org-odt-node-property)
>     (paragraph . org-odt-paragraph)
>     (plain-list . org-odt-plain-list)
>     (plain-text . org-odt-plain-text)
> @@ -2868,6 +2869,18 @@ INFO is a plist holding contextual information.  See
> 		"Emphasis" desc)))))
> 
> 
> +;;;; Node Property
> +
> +(defun org-odt-node-property (node-property contents info)
> +  "Transcode a NODE-PROPERTY element from Org to ODT.
> +CONTENTS is nil.  INFO is a plist holding contextual
> +information."
> +  (org-odt--encode-plain-text
> +   (format "%s:%s"
> +	   (org-element-property :key node-property)
> +	   (let ((value (org-element-property :value node-property)))
> +	     (if value (concat " " value) "")))))
> +
> ;;;; Paragraph
> 
> (defun org-odt--format-paragraph (paragraph contents default center quote)
> @@ -3005,11 +3018,11 @@ channel."
> 
> (defun org-odt-property-drawer (property-drawer contents info)
>   "Transcode a PROPERTY-DRAWER element from Org to ODT.
> -CONTENTS is nil.  INFO is a plist holding contextual
> -information."
> -  ;; The property drawer isn't exported but we want separating blank
> -  ;; lines nonetheless.
> -  "")
> +CONTENTS holds the contents of the drawer.  INFO is a plist
> +holding contextual information."
> +  (and (org-string-nw-p contents)
> +       (format "<text:p text:style-name=\"OrgFixedWidthBlock\">%s</text:p>"
> +	       contents)))
> 
> 
> ;;;; Quote Block
> diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
> index d289e60..c834087 100644
> --- a/lisp/ox-texinfo.el
> +++ b/lisp/ox-texinfo.el
> @@ -89,6 +89,7 @@
>     (keyword . org-texinfo-keyword)
>     (line-break . org-texinfo-line-break)
>     (link . org-texinfo-link)
> +    (node-property . org-texinfo-node-property)
>     (paragraph . org-texinfo-paragraph)
>     (plain-list . org-texinfo-plain-list)
>     (plain-text . org-texinfo-plain-text)
> @@ -1294,6 +1295,17 @@ are generated directly."
>       ;;(org-texinfo--build-detailed-menu parse top info)
>       (org-texinfo--build-menu parse 1 info 'detailed)))))
> 
> +;;;; Node Property
> +
> +(defun org-texinfo-node-property (node-property contents info)
> +  "Transcode a NODE-PROPERTY element from Org to Texinfo.
> +CONTENTS is nil.  INFO is a plist holding contextual
> +information."
> +  (format "%s:%s"
> +          (org-element-property :key node-property)
> +          (let ((value (org-element-property :value node-property)))
> +            (if value (concat " " value) ""))))
> +
> ;;; Paragraph
> 
> (defun org-texinfo-paragraph (paragraph contents info)
> @@ -1398,11 +1410,10 @@ information."
> 
> (defun org-texinfo-property-drawer (property-drawer contents info)
>   "Transcode a PROPERTY-DRAWER element from Org to Texinfo.
> -CONTENTS is nil.  INFO is a plist holding contextual
> -information."
> -  ;; The property drawer isn't exported but we want separating blank
> -  ;; lines nonetheless.
> -  "")
> +CONTENTS holds the contents of the drawer.  INFO is a plist
> +holding contextual information."
> +  (and (org-string-nw-p contents)
> +       (format "@verbatim\n%s@end verbatim" contents)))
> 
> ;;; Quote Block
> 
> diff --git a/lisp/ox.el b/lisp/ox.el
> index 6c59368..7e1d932 100644
> --- a/lisp/ox.el
> +++ b/lisp/ox.el
> @@ -128,6 +128,7 @@
>     (:with-latex nil "tex" org-export-with-latex)
>     (:with-planning nil "p" org-export-with-planning)
>     (:with-priority nil "pri" org-export-with-priority)
> +    (:with-properties nil "prop" org-export-with-properties)
>     (:with-smart-quotes nil "'" org-export-with-smart-quotes)
>     (:with-special-strings nil "-" org-export-with-special-strings)
>     (:with-statistics-cookies nil "stat" org-export-with-statistics-cookies)
> @@ -396,10 +397,11 @@ This option can also be set on with the CREATOR keyword."
>   "Non-nil means export contents of standard drawers.
> 
> When t, all drawers are exported.  This may also be a list of
> -drawer names to export.  If that list starts with `not', only
> -drawers with such names will be ignored.
> +drawer names to export, as strings.  If that list starts with
> +`not', only drawers with such names will be ignored.
> 
> -This variable doesn't apply to properties drawers.
> +This variable doesn't apply to properties drawers.  See
> +`org-export-with-properties' instead.
> 
> This option can also be set with the OPTIONS keyword,
> e.g. \"d:nil\"."
> @@ -557,6 +559,19 @@ e.g. \"pri:t\"."
>   :group 'org-export-general
>   :type 'boolean)
> 
> +(defcustom org-export-with-properties nil
> +  "Non-nil means export contents of properties drawers.
> +
> +When t, all properties are exported.  This may also be a list of
> +properties to export, as strings.
> +
> +This option can also be set with the OPTIONS keyword,
> +e.g. \"prop:t\"."
> +  :group 'org-export-general
> +  :version "24.4"
> +  :package-version '(Org . "8.2")
> +  :type 'boolean)
> +
> (defcustom org-export-with-section-numbers t
>   "Non-nil means add section numbers to headlines when exporting.
> 
> @@ -2072,7 +2087,14 @@ a tree with a select tag."
> 		      (not (eq todo-type with-tasks)))
> 		 (and (consp with-tasks) (not (member todo with-tasks))))))))
>     ((latex-environment latex-fragment) (not (plist-get options :with-latex)))
> +    (node-property
> +     (let ((properties-set (plist-get options :with-properties)))
> +       (cond ((null properties-set) t)
> +	     ((consp properties-set)
> +	      (not (member-ignore-case (org-element-property :key blob)
> +				       properties-set))))))
>     (planning (not (plist-get options :with-planning)))
> +    (property-drawer (not (plist-get options :with-properties)))
>     (statistics-cookie (not (plist-get options :with-statistics-cookies)))
>     (table-cell
>      (and (org-export-table-has-special-column-p
> diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
> index 54248cb..47c68d7 100644
> --- a/testing/lisp/test-ox.el
> +++ b/testing/lisp/test-ox.el
> @@ -479,6 +479,25 @@ Paragraph"
> 	    (org-test-with-temp-text "CLOSED: [2012-04-29 sun. 10:45]"
> 	      (org-export-as (org-test-default-backend)
> 			     nil nil nil '(:with-planning nil))))))
> +  ;; Property Drawers.
> +  (should
> +   (equal "* H1\n"
> +	  (org-test-with-temp-text
> +	      "* H1\n  :PROPERTIES:\n  :PROP: value\n  :END:"
> +	    (org-export-as (org-test-default-backend)
> +			   nil nil nil '(:with-properties nil)))))
> +  (should
> +   (equal "* H1\n:PROPERTIES:\n:PROP:     value\n:END:\n"
> +	  (org-test-with-temp-text
> +	      "* H1\n  :PROPERTIES:\n  :PROP: value\n  :END:"
> +	    (org-export-as (org-test-default-backend)
> +			   nil nil nil '(:with-properties t)))))
> +  (should
> +   (equal "* H1\n:PROPERTIES:\n:B:        2\n:END:\n"
> +	  (org-test-with-temp-text
> +	      "* H1\n  :PROPERTIES:\n  :A: 1\n  :B: 2\n:END:"
> +	    (org-export-as (org-test-default-backend)
> +			   nil nil nil '(:with-properties ("B"))))))
>   ;; Statistics cookies.
>   (should
>    (equal ""
> -- 
> 1.8.4
> 


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-26 11:28                       ` Carsten Dominik
@ 2013-09-26 11:48                         ` Nicolas Goaziou
  2013-09-26 11:51                           ` Carsten Dominik
  0 siblings, 1 reply; 24+ messages in thread
From: Nicolas Goaziou @ 2013-09-26 11:48 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Thorsten Jolitz

Hello,

Carsten Dominik <carsten.dominik@gmail.com> writes:

> this does look good to me, except that the customize type of
> org-export-with-properties needs to be extended to allow for the
> list of strings.
>
> Please just go ahead and apply it to master, then I and hopefully
> others will test it further.

Fixed and done. I added an entry in the manual.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-26 11:48                         ` Nicolas Goaziou
@ 2013-09-26 11:51                           ` Carsten Dominik
  2013-09-26 14:33                             ` Nicolas Goaziou
  0 siblings, 1 reply; 24+ messages in thread
From: Carsten Dominik @ 2013-09-26 11:51 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Thorsten Jolitz

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

Excellent, thank you for the fast solution to this issue.

Will you also work on exporters in contrib, or should I ping the respective authors to do this?

- Carsten

On 26.9.2013, at 13:48, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> this does look good to me, except that the customize type of
>> org-export-with-properties needs to be extended to allow for the
>> list of strings.
>> 
>> Please just go ahead and apply it to master, then I and hopefully
>> others will test it further.
> 
> Fixed and done. I added an entry in the manual.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-26 11:51                           ` Carsten Dominik
@ 2013-09-26 14:33                             ` Nicolas Goaziou
  2013-09-26 16:06                               ` Carsten Dominik
  0 siblings, 1 reply; 24+ messages in thread
From: Nicolas Goaziou @ 2013-09-26 14:33 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, Thorsten Jolitz

Carsten Dominik <carsten.dominik@gmail.com> writes:

> Will you also work on exporters in contrib, or should I ping the
> respective authors to do this?

This is a grunt job. Also, only ox-confluence and ox-groff have to be
updated.

I will commit the changes in a little while.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: SUMMARY: [Feature Request] Make property-drawers exportable
  2013-09-26 14:33                             ` Nicolas Goaziou
@ 2013-09-26 16:06                               ` Carsten Dominik
  0 siblings, 0 replies; 24+ messages in thread
From: Carsten Dominik @ 2013-09-26 16:06 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Thorsten Jolitz

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]


On 26.9.2013, at 16:33, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
> 
>> Will you also work on exporters in contrib, or should I ping the
>> respective authors to do this?
> 
> This is a grunt job. Also, only ox-confluence and ox-groff have to be
> updated.
> 
> I will commit the changes in a little while.

Thank you again.

- Carsten


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-09-26 16:06 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-17  9:53 [Feature Request] Make property-drawers exportable Thorsten Jolitz
2013-06-17 14:33 ` Nicolas Goaziou
2013-06-17 15:48   ` Thorsten Jolitz
2013-06-17 18:54     ` Marcin Borkowski
2013-06-17 19:04     ` Nicolas Goaziou
2013-06-17 20:03       ` Thorsten Jolitz
2013-09-25  9:31       ` Carsten Dominik
2013-09-25  9:34         ` Carsten Dominik
2013-09-25 10:33           ` SUMMARY: " Carsten Dominik
2013-09-25 10:53             ` Thorsten Jolitz
2013-09-25 10:56               ` Carsten Dominik
2013-09-26  8:44               ` Marcin Borkowski
2013-09-25 11:51             ` Nicolas Goaziou
2013-09-25 12:08               ` Carsten Dominik
2013-09-25 12:13                 ` Nicolas Goaziou
2013-09-25 12:26                   ` Carsten Dominik
2013-09-25 20:57                     ` Nicolas Goaziou
2013-09-26 11:28                       ` Carsten Dominik
2013-09-26 11:48                         ` Nicolas Goaziou
2013-09-26 11:51                           ` Carsten Dominik
2013-09-26 14:33                             ` Nicolas Goaziou
2013-09-26 16:06                               ` Carsten Dominik
2013-09-25 12:52                 ` Christian Moe
2013-09-25 12:12               ` Thorsten Jolitz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).