From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Question about using #+call to insert Org mode snippet with different noweb refs Date: Fri, 10 May 2019 13:32:51 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f0307c05888bf6bd" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:59797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP9Om-0001AK-Qy for emacs-orgmode@gnu.org; Fri, 10 May 2019 13:33:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hP9Ol-0007NM-Cf for emacs-orgmode@gnu.org; Fri, 10 May 2019 13:33:32 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:45639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hP9Ol-0007Mh-43 for emacs-orgmode@gnu.org; Fri, 10 May 2019 13:33:31 -0400 Received: by mail-lj1-x22c.google.com with SMTP id r76so5735147lja.12 for ; Fri, 10 May 2019 10:33:30 -0700 (PDT) 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: emacs-org list --000000000000f0307c05888bf6bd Content-Type: text/plain; charset="UTF-8" Hello, I recently came across this awesome tool call wavedrom and was taking my notes as I was following its tutorial: https://wavedrom.com/tutorial.html. In order to prevent copy/pasting the same "wavedrom snippet" in the src text block and the begin_export html block, I did the below. It works.. but I wonder if this can be made more concise by using #+call. If it's possible, what would be "called" org source block look like so that I can pass it the noweb reference string? Or .. what would be a concise way to write the below? Thanks! ===== *** Step {{{n(,1)}}}. The Signal #+begin_src text :noweb-ref wavedrom-eg-1 { signal: [{ name: "Alfa", wave: "01.zx=ud.23.45" }] } #+end_src #+begin_src org :noweb yes :exports results :results output replace ,#+begin_export html ,#+end_export #+end_src #+RESULTS: #+begin_export html #+end_export *** Step {{{n}}}. Adding Clock #+begin_src text :noweb-ref wavedrom-eg-2 { signal: [ { name: "pclk", wave: 'p.......' }, { name: "Pclk", wave: 'P.......' }, { name: "nclk", wave: 'n.......' }, { name: "Nclk", wave: 'N.......' }, {}, { name: 'clk0', wave: 'phnlPHNL' }, { name: 'clk1', wave: 'xhlhLHl.' }, { name: 'clk2', wave: 'hpHplnLn' }, { name: 'clk3', wave: 'nhNhplPl' }, { name: 'clk4', wave: 'xlh.L.Hx' }, ]} #+end_src #+begin_src org :noweb yes :exports results :results output replace ,#+begin_export html ,#+end_export #+end_src #+RESULTS: #+begin_export html #+end_export ===== -- Kaushal Modi --000000000000f0307c05888bf6bd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
He= llo,

I recently came across this awesome tool call= wavedrom and was taking my notes as I was following its tutorial: https://wavedrom.com/tutorial.html<= /a>.




=

=3D=3D=3D=3D=3D

*** Step {{{n(,1)}}}. The Signal
#+begin_src text :noweb-ref wavedrom-eg-1
{ signal: = [{ name: "Alfa", wave: "01.zx=3Dud.23.45" }] }
#+end= _src
#+begin_src org :noweb yes :exports results :results output replace=
,#+begin_export html
<script type=3D"WaveDrom">
&= lt;<wavedrom-eg-1>>
</script>
,#+end_export
#+end_s= rc

#+RESULTS:
#+begin_export html
<script type=3D"Wave= Drom">
{ signal: [{ name: "Alfa", wave: "01.zx=3D= ud.23.45" }] }
</script>
#+end_export

*** Step {{{n= }}}. Adding Clock
#+begin_src text :noweb-ref wavedrom-eg-2
{ signal:= [
=C2=A0 { name: "pclk", wave: 'p.......' },
=C2= =A0 { name: "Pclk", wave: 'P.......' },
=C2=A0 { name:= "nclk", wave: 'n.......' },
=C2=A0 { name: "Nclk= ", wave: 'N.......' },
=C2=A0 {},
=C2=A0 { name: 'cl= k0', wave: 'phnlPHNL' },
=C2=A0 { name: 'clk1', wave= : 'xhlhLHl.' },
=C2=A0 { name: 'clk2', wave: 'hpHpln= Ln' },
=C2=A0 { name: 'clk3', wave: 'nhNhplPl' },=C2=A0 { name: 'clk4', wave: 'xlh.L.Hx' },
]}
#+end_= src
#+begin_src org :noweb yes :exports results :results output replace<= br>,#+begin_export html
<script type=3D"WaveDrom">
&l= t;<wavedrom-eg-2>>
</script>
,#+end_export
#+end_sr= c

#+RESULTS:
#+begin_export html
<script type=3D"WaveD= rom">
{ signal: [
=C2=A0 { name: "pclk", wave: '= ;p.......' },
=C2=A0 { name: "Pclk", wave: 'P.......&#= 39; },
=C2=A0 { name: "nclk", wave: 'n.......' },
= =C2=A0 { name: "Nclk", wave: 'N.......' },
=C2=A0 {},<= br>=C2=A0 { name: 'clk0', wave: 'phnlPHNL' },
=C2=A0 { n= ame: 'clk1', wave: 'xhlhLHl.' },
=C2=A0 { name: 'clk= 2', wave: 'hpHplnLn' },
=C2=A0 { name: 'clk3', wave:= 'nhNhplPl' },
=C2=A0 { name: 'clk4', wave: 'xlh.L.H= x' },
]}
</script>
#+end_export
=3D=3D=3D=3D=3D

--
Kaushal Modi
--000000000000f0307c05888bf6bd--