emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles R (Charlie) Martin" <chasrmartin@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: can't get org-mode noweb tangle to work
Date: Fri, 24 Nov 2017 17:52:10 -0700	[thread overview]
Message-ID: <CABd2k02PSirQo19SmFTJY4tcTGnp1c+m+X+GHXyQHXQOadEwJg@mail.gmail.com> (raw)
In-Reply-To: <m2fu93p5iq.fsf@tsdye.com>

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

Grumble. Okay, this is sorted/ There are amazing numbers of not-quite-right
examples on the web.

Thanks, Tom, I now have the below, which works.

#+TITLE: Console Tic Tac Toe
#+SUBTITLE: A Literate Program in EMACS Org-Mode
#+AUTHOR: Charlie Martin
#+STARTUP: showall

#+BEGIN_SRC python :tangle yes :noweb yes
  import sys
  import os

  def main(args):
      <<initialize-the-game-board>>

  if __name__ == "__main__":
      main(sys.argv)
#+END_SRC

#+NAME: initialize-the-game-board
#+BEGIN_SRC python
  board = [[-1 for x in range(3)] for y in range(3)]
#+END_SRC




On Fri, Nov 24, 2017 at 5:26 PM, Thomas S. Dye <tsd@tsdye.com> wrote:

> Aloha Charlie,
>
> Charles R (Charlie) Martin writes:
>
> > I'm trying to get literate programming with `:noweb` syntax working in
> > org-mode. I think I'm down to about the minimum case:
> >
> >         #+TITLE: Console Tic Tac Toe
> >     #+SUBTITLE: A Literate Program in EMACS Org-Mode
> >     #+AUTHOR: Charlie Martin
> >     #+STARTUP: showall
> >
> >     #+BEGIN_SRC python :tangle yes :noweb
> >       import sys
> >       import os
> >
> >       def main(args):
> >           <<initialize-the-game-board>>
> >
> >       if __name__ == "__main__":
> >           main(sys.argv)
> >     #+END_SRC
> >
> >     #+NAME: initialize-the-game-board
> >     #+BEGIN_SRC python :tangle yes :noweb
> >       board = [[-1 for x in range(3)] for y in range(3)]
> >     #+END_SRC
> >
> > but when I tangle it I get:
> >
> >     import sys
> >     import os
> >
> >     def main(args):
> >         <<initialize-the-game-board>>
> >
> >     if __name__ == "__main__":
> >         main(sys.argv)
> >
> >     board = [[-1 for x in range(3)] for y in range(3)]
> >
> > I've tried permuting the argument, flags, and so on to no avail.
> >
> > EMACS version is 25.3.1 MacOS, org-mode 9.1.3
>
> I think it should be :noweb yes
>
> hth,
> Tom
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>

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

  reply	other threads:[~2017-11-25  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-25  0:10 can't get org-mode noweb tangle to work Charles R (Charlie) Martin
2017-11-25  0:26 ` Thomas S. Dye
2017-11-25  0:52   ` Charles R (Charlie) Martin [this message]
2017-11-25  5:38     ` Martin Alsinet
2017-12-01  4:08       ` Grant Rettke

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=CABd2k02PSirQo19SmFTJY4tcTGnp1c+m+X+GHXyQHXQOadEwJg@mail.gmail.com \
    --to=chasrmartin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /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).