:::Title::: A simple text markup utility :::/Title:::
:::Section Introduction :::
I'm looking for something to help developers wirte documentation for
bits of software they are writing. The main (initially only)
presentation format will be HTML. The idea is to allow the author to
write a plain text file containing the text he wishes to present,
annotated with minimally intrusive markup which describes the
:::emph::: meaning :::/emph::: of parts of the text. The author should
not concern himself with how the output will look; he should trust the
rendering process to Do The Right Thing.
For example, the author might want to communicate that some portion of
text represents source code, or commands to be issued, or output given
by a program.
:::Example:::
A recursive implementation of the Fibonacci function might look like this
:::Source:::
def fib(n):
if n<2: return 1
return fib(n-1) + fib(n-2)
:::/Source:::
And it works like this
:::Input::: fib(8) :::/Input:::
:::Output::: 34 :::/Output:::
:::/Example::: :::/Section:::
:::Section Why not XML ? :::
The idea is that the utility should be minimally intrusive to the
author. Given that the author is likely to want to paste source code,
having to substitite all occurances of "<" with < and so on is
completely unacceptable.
As you can see, I have been using triple colons in this presentation
as a sufficiently unlikely character combination, to replace XML's "<"
and ">". Clearly this is not ideal. Maybe allowing the author to
specify how the markup should be identified is a solution ... for
example an instruction such as :::SetMarkup ||::: could be used to
change the markup identification sequence to two vertical bars (taking
effect only in "leafward" parts of the parse tree.
||/Section||
||Section Why not LaTeX ? ||
Yes, LaTeX pretty much reifies the idea I am trying to express, and I
could use something in the LateX2HTML genre as a
backend. Unfortunately LaTeX it not politically acceptable in my
environment.
(If the markup is sufficiently simple, then something based on s-exprs
could pass through the political correctness filters ... as long as
implemented in C(++) or Python.)
||Section Automation||
Ideally, I'd like to be able to execute arbitrary Python code within
the document source, in order to "suck in" information from elsewhere.
||Source||
||Macro||
for line in open("example1.cpp",'r'):
print line
||/Macro||
||/Source||
Given the fragment above, the source code in the file "example1.cpp"
would be inserted into the document.
||Section Inclusion||
Also, I'd like to be able to inline other sources of the same document
format:
||Include ~/docs/fubar.baz||
||/Section||
||Section Summary||
Of course, I am not looking for anything that looks exactly like what
I have shown. What I have presented here merely serves to illustrate
what sort of functionality I am looking for.
Neither am I looking for something of industrial strength, but
something that would solve more problems than it creates. The bottom
line is that I want authors to write something that looks mostly like
plain text, and be able to communicate a few key items of
meta-information via markup.
Any suggestions ?
||/Section|| 7 2084
Jacek Generowicz wrote: I'm looking for something to help developers wirte documentation for bits of software they are writing.
reStructredText. Bigtime.
--
__ Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
/ \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
\__/ Everybody's playing the game / But nobody's rules are the same
-- Florence, _Chess_
Erik Max Francis <ma*@alcyone.com> writes: Jacek Generowicz wrote:
I'm looking for something to help developers wirte documentation for bits of software they are writing.
reStructredText. Bigtime.
Way cool !
I am rather shocked that this (or its ancestors) has not registered on
my radar before now.
Thanks !
Jacek Generowicz wrote: Erik Max Francis <ma*@alcyone.com> writes:reStructredText. Bigtime.
Way cool !
I am rather shocked that this (or its ancestors) has not registered on my radar before now.
It's ancestors, at least in the "Structured Text" world, weren't
up to the task.
But they didn't have David Goodger behind them...
-Peter
Please don't invent yet another markup language. It gets incredibly
difficult to keep them all straight. There's some standard being
developed for Wiki markup. Why don't you use that. The stuff in your
example already looks pretty similar to wikipedia markup. Another
idea is use Texinfo.
In article <ty*************@pcepsft001.cern.ch>,
Jacek Generowicz <ja**************@cern.ch> wrote: Erik Max Francis <ma*@alcyone.com> writes: Jacek Generowicz wrote: I'm looking for something to help developers wirte documentation for bits of software they are writing.
reStructredText. Bigtime.
Way cool !
I am rather shocked that this (or its ancestors) has not registered on my radar before now.
You should be shocked. ;-) It's been discussed lots. The really neat
thing about reST is that it scales upward fairly well -- I'm writing a
book with it, and so is at least one other person.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/
"usenet imitates usenet" --Darkhawk
Paul Rubin <http://ph****@nospam.invalid> wrote: Please don't invent yet another markup language. It gets incredibly difficult to keep them all straight.
Seconded. At least, try to use whitespace as markup tags... you'll be
surprised.
--
William Park, Open Geometry Consulting, <op**********@yahoo.ca>
Linux solution for data processing and document management.
Jacek Generowicz <ja**************@cern.ch> wrote in message news:<ty*************@pcepsft001.cern.ch>...
<snip>
I write everything in rst format and then convert to HTML,Latex,PS, PDF, etc.
For what concerns the documentation, I write snippets and examples inside
it, then I execute the text file using (a minor hack to) doctest and I
get (additional) tests for free. Finally, I write the documentation (call
it implementation proposal if you wish) before writing the actual code,
so I get Documentation Driven Development ;)
Way cool: it is something between literate programming and TDD. Most
importantly it works. I have yet to implement the second step: the idea
is to convert the documentation in HTML, put it on the Web and let
the customer run the tests with a click on the browser as soon as he reads
the documentation (or proposal of implementation) and see if he/she likes it.
It is not difficult to implement though.
I think you get the picture. doctest is still largely unexplored but it
has enourmous potentiality in terms of easy of use and convenience.
Think only to the fact that you get always updated documentation by definition.
Michele Simionato This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Himanshu Garg |
last post by:
Hello,
I am using HTML::Parser to extract text from html pages from
http://bbc.co.uk/urdu/
However the encoding of the input text seems to...
|
by: Jofio |
last post by:
My PHP code to read a simple text file is listed below. What could have
gone wrong here? When I run it, the browser displays: 'COULD NOT Read'...
|
by: Guogang |
last post by:
Hi,
I need to extract plain text from HTML page (i.e. do not show images, html
formatting, ...)
Is there some C# class/function that can help...
|
by: keith |
last post by:
Hi,
I'm using WebClient to retrieve the contents of a particular page. I
would like to get a string containing only the page's text and no html...
|
by: Ksenia Marasanova |
last post by:
Hi,
I am looking for a library that will give me very simple text
representation of HTML.
For example
<div><h1>Title</h1><p>This is a <br...
|
by: Yourself |
last post by:
Are there any freely licensed Wiki markup to HTML converters available?
Basically, I don't want to convert full wiki markup, just very basic...
|
by: karen987 |
last post by:
Could someone please tell me what code to add here? I have a weblog, with daily news which readers can add comments to, which are stored in a...
|
by: jerger |
last post by:
I have converted my dictionary program into a simple asp program. It works great... but I now want to add speech functionality but have not had any...
|
by: Saquib Kazi |
last post by:
Hi,
I have a set of data in excel. This data includes some text, date fields and some numberic values. I want to create a document out of a...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
| |