Re: DRY way to insert source code into an article?

Ron Jeffries <[email protected]>
Newsgroups gmane.comp.programming.language-of-the-year
Message-ID <[email protected]>
Hello, Daniel.  On Sunday, April 13, 2008, at 7:23:49 AM, you
wrote:

> I'm starting to write articles about programming and I'd like to
> include source code snippets into my article.  My strategy was to get
> the source code examples working, then annotate sections of code which
> should be imported into the body of the article.  The goal here was to
> avoid copy-paste problems of putting incorrect or stale source code
> examples into the document.

> How do other pragmatists approach this problem?

My articles are prepared in XML for reasons that made sense at the
time. Like you propose, I get the code working, then paste it in.
This almost always works, but sometimes I mess up. It's the best I
know, though.

Ron Jeffries
www.XProgramming.com
Assume that anything you didn't like was the funny stuff.
  -- Jim Shore
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.