[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] how to quote "#+end_src" string in a Babel block?
From: |
Nicolas Goaziou |
Subject: |
Re: [O] how to quote "#+end_src" string in a Babel block? |
Date: |
Wed, 24 Jul 2013 09:24:52 +0200 |
Hello,
asenal <address@hidden> writes:
> My problem is How can I safely quote "#+XXX" inside a Babel-block?
> I found org-mode mismatch the outter "#+begin_src" with the first
> "#+end_src" inside the block hence gives me a wrong parse.
>
> Here's an example:
> #+headers: :var varlist=top_iv
> #+begin_src python :return iv_template(varlist)
> def iv_template(varlist,db,table):
> for var in varlist:
> babel_template='''
> #+name: var
> #+begin_src sqlite :db mydb
> SELECT colName,cnt,suc,fal,iv FROM mytable WHERE colName == %s';
> #+end_src # org mode stop here!
> ''' % (var,var)
>
> print babel_template
> #+end_src
Within a source block, you must prepend a comma to every line starting
with "*" or "#+". C-c ' will do that for you.
Regards,
--
Nicolas Goaziou