emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Heikki Lehvaslaiho <heikki.lehvaslaiho@gmail.com>
To: Thorsten Jolitz <tjolitz@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Controlling example block export?
Date: Tue, 1 Apr 2014 15:40:14 +0300	[thread overview]
Message-ID: <CAK=ukca7cyZEG=VTDUQNfUQ5ESkrVjPS398r230deWpDhRP=XA@mail.gmail.com> (raw)
In-Reply-To: <87k3b9mkcb.fsf@gmail.com>

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

Thanks, Torsten. Very illuminating.


The org-syntax.html says of blocks:


#+BEGIN_NAME PARAMETERS
CONTENTS
#+END_NAME

NAME can contain any non-whitespace character.
PARAMETERS can contain any character other than new line, and can be
omitted.
If NAME is "CENTER", it will be a "center block". If it is "QUOTE", it will
be a "quote block".
If the block is neither a center block, a quote block or a block
element<http://orgmode.org/worg/dev/org-syntax.html#Blocks>,
it will be a "special block".

That does not seem to be quite true as lisp/org-element.el recognises the
following blocks (perlregexp: /begin_(\w+)/i):

- CENTER
- COMMENT
- EXAMPLE
- QUOTE
- SRC
- VERSE

... in addition to any other valid block names. For these, the content is
displayed as plain text after striping the BEGIN/END lines unless the
exporter used has code for handling it differently.

Note: org-syntax.html  needs updating.

So, to implement parameters for the EXAMPLE block, relevant code has to be
added to the exporter. That's a nontrivial task to do consistently.

Incidentally, the solution to my immediate problem is the COMMENT block.
Its contents are completely ignored and not passed to exporters. If I find
myself using that a lot, a macro or a a function to toggle between these
two might come handy:


#+BEGIN_COMMENT :type EXAMPLE
 text in a  block
#+END_COMMENT

<>

#+BEGIN_ EXAMPLE
 text in a  block
#+END_EXAMPLE

Unless someone beats me to it, I'll write it one day. :)



     -Heikki

Heikki Lehvaslaiho - skype:heikki_lehvaslaiho http://about.me/heikki
cell: +966 545 595 849  office: +966 12 808 2429

Saudi Arabian weekend is now Friday and Saturday.

KAUST Supercomputing Center, Building #1, Level 0, 0203-WS23
4700 King Abdullah University of Science and Technology (KAUST)
Thuwal 23955-6900, Kingdom of Saudi Arabia


On 1 April 2014 13:10, Thorsten Jolitz <tjolitz@gmail.com> wrote:

> Heikki Lehvaslaiho <heikki.lehvaslaiho@gmail.com> writes:
>
> > I am using example blocks as inline notes where I paste snippets of
> > (pre-formatted) text. I'd like to be able to control the exporting of
> > those block individually (per document would also be useful). I do not
> > seem to be able to find documentation about anything along those
> > lines.
> >
> > Here is a mock-up:
> >
> > #+BEGIN_EXAMPLE :exports none
> > private notes...
> > #+END_EXAMPLE
>
> I don't think example blocks take arguments. You might try
>
> #+BEGIN_SRC org :exports none
>  private notes...
> #+END_SRC
>
> or collect these example blocks in subtrees with export tags/properties.
>
> > A bigger question is that while code blocks are well defined and well
> > documented, all other blocks are not. Is there somewhere a design
> > document the would give a logic of having different blocks and how
> > they are controlled? Maybe there is an other type of a block that does
> > what I want?
> > The inline documentation in ox*.el files is too low level to be
> > helpful.
>
> AFAIK export of these block types is backend specific, e.g. ox-ascii.el
> might treat example block different than ox-html.el, so thats where to
> look.
>
> ,---------------------------
> | C-h v org-export-with- TAB
> `---------------------------
>
> gives some hints too. Using drawers instead of example blocks would
> enable you to toggle export documentwise.
>
> I asked a similar 'bigger' question before, and remember that the answer
> was more or less 'the block name says it all'.
>
> However, here is a (dense) description of the org syntax:
>
> ,--------------------------------------------
> | http://orgmode.org/worg/dev/org-syntax.html
> `--------------------------------------------
>
> --
> cheers,
> Thorsten
>
>
>

[-- Attachment #2: Type: text/html, Size: 5842 bytes --]

  reply	other threads:[~2014-04-01 12:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01  9:20 Controlling example block export? Heikki Lehvaslaiho
2014-04-01 10:10 ` Thorsten Jolitz
2014-04-01 12:40   ` Heikki Lehvaslaiho [this message]
2014-04-01 14:52     ` Thorsten Jolitz
2014-04-01 15:16       ` Thorsten Jolitz
2014-04-01 15:38     ` Nicolas Goaziou
2014-04-01 15:34 ` Nicolas Goaziou
2014-04-01 16:33 ` Charles Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK=ukca7cyZEG=VTDUQNfUQ5ESkrVjPS398r230deWpDhRP=XA@mail.gmail.com' \
    --to=heikki.lehvaslaiho@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tjolitz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).