emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: reza <reza@housseini.me>
To: "Ihor Radchenko" <yantar92@posteo.net>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Cannot expand macros through included org file
Date: Fri, 17 Feb 2023 13:05:45 +0000	[thread overview]
Message-ID: <010201865f7b0dfd-bd66b8bf-2a40-4f18-9fd4-dee5e9b43387-000000@eu-west-1.amazonses.com> (raw)
In-Reply-To: <87bklsbg2j.fsf@localhost>

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

> report_2019.org:
> 
> #+TITLE: Report 2019
> #+property: header-args :var year=2019
> 
> #+INCLUDE: "template.org" :lines "2-"
> 
> template.org:
> 
> #+TITLE: Report
> 
> * My headline
> 
> #+begin_src emacs-lisp :exports both :results value :eval yes
> year
> #+end_src
> 
> #+BEGIN_SRC bash
> ./get_log_file --start=$year-01-01 --end=$year-12-31
> #+END_SRC
> 
> #+BEGIN_SRC python
> log = pd.read_csv(f"log_{year}.csv")
> #+END_SRC

Thank you, I got it to work by only using

report_2019.org:

#+TITLE: Report 2019
#+property: header-args :var year=2019

#+INCLUDE: "template.org" :lines "2-"

template.org:

#+TITLE: Report

* My headline

#+BEGIN_SRC bash
./get_log_file --start=$year-01-01 --end=$year-12-31
#+END_SRC

#+BEGIN_SRC python
log = pd.read_csv(f"log_{year}.csv")
#+END_SRC

[-- Attachment #2: OpenPGP_0xC375C6AF05125C52.asc --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #3: OpenPGP_signature --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

  parent reply	other threads:[~2023-02-17 13:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7d032f82-9d16-edff-b548-3c01f6ea68cb@housseini.me>
2023-02-15 20:34 ` Cannot expand macros through included org file reza
2023-02-15 20:44   ` Ihor Radchenko
     [not found]     ` <ecd7d8ae-81de-5bb8-f66f-6bfc2152480b@housseini.me>
2023-02-15 20:53       ` reza
2023-02-15 21:10         ` Ihor Radchenko
     [not found]           ` <2b6f1944-66e1-c491-40f5-420018411312@housseini.me>
2023-02-15 21:26             ` reza
2023-02-17 13:02               ` Ihor Radchenko
     [not found]                 ` <fc618f97-e272-5773-7143-4a1381f242e6@housseini.me>
2023-02-17 13:05                   ` reza [this message]
2023-02-15 21:51         ` Nick Dokos

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=010201865f7b0dfd-bd66b8bf-2a40-4f18-9fd4-dee5e9b43387-000000@eu-west-1.amazonses.com \
    --to=reza@housseini.me \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).