emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Including file from a macro?
@ 2018-06-27  7:57 Diego Zamboni
  2018-06-27  8:01 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Diego Zamboni @ 2018-06-27  7:57 UTC (permalink / raw)
  To: Org-mode

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

Hi,

Is it possible to use "#+include" from within a macro?

I have the following two files:

t1.org:
-----
#+MACRO: newline    (eval "\n")
#+MACRO: module-summary ** $1 {{{newline}}}{{{newline}}}#+include:
"./$1.org::file-summary"

{{{module-summary(t2)}}}
-----

t2.org:
-----
* t2 file

#+name: file-summary
This is the file summary
-----

This is another paragraph

If I export t1.org to org-mode, I get the following, which, if exported to
any other format (I have tested HTML and Markdown), correctly includes the
"file-summary" paragraph:

t1.org.org:
-----
# Created 2018-06-27 Wed 09:26
#+TITLE:
#+AUTHOR: Zamboni Diego
#+macro: newline    (eval "\n")
#+macro: module-summary ** $1 {{{newline}}}{{{newline}}}#+include:
"./$1.org::file-summary"

* t2

#+include: "./t2.org::file-summary"
-----

However, if I export t1.org directly to HTML or Markdown, I get only the
heading "* t2", but no included contents, as if the #+include line is not
being processed correctly.

Any ideas if this is possible?

Thanks,
--Diego

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

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

end of thread, other threads:[~2018-06-27 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-27  7:57 Including file from a macro? Diego Zamboni
2018-06-27  8:01 ` Nicolas Goaziou
2018-06-27  9:28   ` Diego Zamboni
2018-06-27 16:42     ` Berry, Charles

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).