1

Sometimes, I notice typos in articles (blog posts) or books in source code that appears in the body of the article. It may be an indication that the code has been manually copied and pasted (e.g. missing braces ), or that something nasty happened to the text.

How may I write an article inside the source code of a project ? I'm targetting Wordpress; I'm basically looking for a parser that would recognize two kinds of region: article and source code, and that would format them to whatever I want (stackoverflow question, LaTeX code or Wordpress article)

7
  • 2
    This one confuses me, I don't get what you want to achieve. Embed what into what - article into source code, source code into article or get a mix of both and reformat into a another format? What should be done by a program, and what manually? What has this to do with "typos" by manul copying? A small example would probably be helpful.
    – Doc Brown
    Apr 16, 2013 at 11:08
  • @DocBrown I want to write text in same file as the source code so that I can generate an article with actual code that is guaranteed to compile. I want to manually mark which blocks of code and which blocks of text belong to the article, and it would be great if it was integrated in the build process. And for the typos: have you never seen a missing < in a web page due to a conflict with html tags ?
    – alecail
    Apr 16, 2013 at 11:21
  • ok, I think I got it now. Hint: you might consider to edit your question to make it more clearer, this increases the chance of getting more and better answers.
    – Doc Brown
    Apr 16, 2013 at 12:27
  • @DocBrown OK. Feel free to reformulate my question, english is not my first language.
    – alecail
    Apr 16, 2013 at 12:34
  • nor is it mine ;-) But perhaps my answer is sufficient for you.
    – Doc Brown
    Apr 16, 2013 at 12:44

1 Answer 1

3

I think you could utilize doxygen for this purpose.

  • works for objective-c
  • does not support Wordpress directly, but HTML and LaTeX output. As far as I know you can import HTML into Wordpress by this plugin
  • cross-platform (works on MacOSX)

You might have to setup some kind of infrastructure around your program to get exactly the part of your program you want as the final article, but I guess this should not be too hard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.