From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: included text Date: Mon, 4 Nov 2019 07:40:30 -0500 Message-ID: References: <875zk1axmn.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000abad250596849f1f" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:43970) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRbf4-0003Al-Hv for emacs-orgmode@gnu.org; Mon, 04 Nov 2019 07:40:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRbf2-0004f8-Qz for emacs-orgmode@gnu.org; Mon, 04 Nov 2019 07:40:46 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:38627) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iRbf2-0004eN-CB for emacs-orgmode@gnu.org; Mon, 04 Nov 2019 07:40:44 -0500 Received: by mail-wm1-x330.google.com with SMTP id z19so11734859wmk.3 for ; Mon, 04 Nov 2019 04:40:43 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "Fraga, Eric" Cc: "emacs-orgmode@gnu.org" --000000000000abad250596849f1f Content-Type: text/plain; charset="UTF-8" Along the lines of what Eric suggested, you can put inline calls to src-blocks in the text. Here are some ways you could get something like what you describe I think. * text to be included :noexport: #+name: block-1 #+BEGIN_SRC python :results value :var a="a" b="b" return f"<<{a} {b} c>>" #+END_SRC #+name: lorem #+BEGIN_EXAMPLE Aliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non orci commodo lobortis. Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus. Sed diam. Praesent fermentum tempor tellus. Nullam tempus. Mauris ac felis vel velit tristique imperdiet. Donec at pede. Etiam vel neque nec dui dignissim bibendum. Vivamus id enim. Phasellus neque orci, porta a, aliquet quis, semper a, massa. Phasellus purus. Pellentesque tristique imperdiet tortor. Nam euismod tellus id erat. #+END_EXAMPLE #+name: lorem-2 #+BEGIN_EXAMPLE Pellentesque dapibus suscipit ligula. #+END_EXAMPLE #+name: block-2 #+BEGIN_SRC sh :results output :var content=lorem echo $content #+END_SRC * blog post 1 twinkle star call_block-1() {{{results(=<>=)}}} Later call_block-1(a=1) {{{results(=<<1 b c>>=)}}} or call_block-1(a=5, b=7) {{{results(=<<5 7 c>>=)}}} call_block-2(lorem) {{{results(=Aliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non orci commodo lobortis. Proin neque massa\, cursus ut\, gravida ut\, lobortis eget\, lacus. Sed diam. Praesent fermentum tempor tellus. Nullam tempus. Mauris ac felis vel velit tristique imperdiet. Donec at pede. Etiam vel neque nec dui dignissim bibendum. Vivamus id enim. Phasellus neque orci\, porta a\, aliquet quis\, semper a\, massa. Phasellus purus. Pellentesque tristique imperdiet tortor. Nam euismod tellus id erat.=)}}} call_block-2(lorem-2) {{{results(=Pellentesque dapibus suscipit ligula.=)}}} John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Mon, Nov 4, 2019 at 3:42 AM Fraga, Eric wrote: > On Sunday, 3 Nov 2019 at 12:37, Samuel Wales wrote: > > ah, or do you mean you refer the reader to the text by a regular link > > instaed of including? that's not what i am lokoing for here as these > > are separate posts. > > Yes, this is what I meant, in case the adjusted use case were of some > use. But it would seem that it won't help you in this case. Therefore, > I would suggest macros for short amounts of text or #+include for larger > text blocks. Mind you, an alternative could be #+CALL-ing a src block > that generates the text as output? > > -- > : Professor Eric S Fraga, http://www.homepages.ucl.ac.uk/~ucecesf > : PGP/GPG key: 8F5C 279D 3907 E14A 5C29 570D C891 93D8 FFFC F67D > : Use plain text email when possible: https://useplaintext.email/ > > --000000000000abad250596849f1f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Along the lines of what Eric suggested, you can put i= nline calls to src-blocks in the text. Here are some ways you could get som= ething like what you describe I think.

* text to b= e included =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0:noexport:

#+name: block-1
#+BEGIN_SRC py= thon :results value :var a=3D"a" b=3D"b"
return f&qu= ot;<<{a} {b} c>>"
#+END_SRC

#+name: lorem
#+B= EGIN_EXAMPLE
Aliquam erat volutpat.=C2=A0 Nunc eleifend leo vitae magna.= =C2=A0 In id erat non orci commodo lobortis.=C2=A0 Proin neque massa, cursu= s ut, gravida ut, lobortis eget, lacus.=C2=A0 Sed diam.=C2=A0 Praesent ferm= entum tempor tellus.=C2=A0 Nullam tempus.=C2=A0 Mauris ac felis vel velit t= ristique imperdiet.=C2=A0 Donec at pede.=C2=A0 Etiam vel neque nec dui dign= issim bibendum.=C2=A0 Vivamus id enim.=C2=A0 Phasellus neque orci, porta a,= aliquet quis, semper a, massa.=C2=A0 Phasellus purus.=C2=A0 Pellentesque t= ristique imperdiet tortor.=C2=A0 Nam euismod tellus id erat.
#+END_EXAMP= LE

#+name: lorem-2
#+BEGIN_EXAMPLE
Pellentesque dapibus suscip= it ligula. =C2=A0
#+END_EXAMPLE


#+name: block-2
#+BEGIN_SR= C sh :results output :var content=3Dlorem
echo $content
#+END_SRC
=

* blog post 1

twinkle star call_block-1() {{{results(=3D<= <a b c>>=3D)}}}

Later call_block-1(a=3D1) {{{results(=3D<= ;<1 b c>>=3D)}}}

or call_block-1(a=3D5, b=3D7) {{{results(= =3D<<5 7 c>>=3D)}}}


call_block-2(lorem) {{{results(= =3DAliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non orc= i commodo lobortis. Proin neque massa\, cursus ut\, gravida ut\, lobortis e= get\, lacus. Sed diam. Praesent fermentum tempor tellus. Nullam tempus. Mau= ris ac felis vel velit tristique imperdiet. Donec at pede. Etiam vel neque = nec dui dignissim bibendum. Vivamus id enim. Phasellus neque orci\, porta a= \, aliquet quis\, semper a\, massa. Phasellus purus. Pellentesque tristique= imperdiet tortor. Nam euismod tellus id erat.=3D)}}}

call_block-2(l= orem-2) {{{results(=3DPellentesque dapibus suscipit ligula.=3D)}}}







On Mon, Nov 4, 2019= at 3:42 AM Fraga, Eric <e.fraga@uc= l.ac.uk> wrote:
On Sunday,=C2=A0 3 Nov 2019 at 12:37, Samuel Wales wrote:
> ah, or do you mean you refer the reader to the text by a regular link<= br> > instaed of including?=C2=A0 that's not what i am lokoing for here = as these
> are separate posts.

Yes, this is what I meant, in case the adjusted use case were of some
use.=C2=A0 But it would seem that it won't help you in this case.=C2=A0= Therefore,
I would suggest macros for short amounts of text or #+include for larger text blocks.=C2=A0 Mind you, an alternative could be #+CALL-ing a src block=
that generates the text as output?

--
: Professor Eric S Fraga, http://www.homepages.ucl.ac.uk/~uce= cesf
: PGP/GPG key: 8F5C 279D 3907 E14A 5C29=C2=A0 570D C891 93D8 FFFC F67D
: Use plain text email when possible: https://useplaintext.email/

--000000000000abad250596849f1f--