473,383 Members | 1,855 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Simple text markup (-> HTML)

:::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 &lt 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||
Jul 18 '05 #1
7 2157
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_
Jul 18 '05 #2
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 !
Jul 18 '05 #3
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
Jul 18 '05 #4
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.
Jul 18 '05 #5
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
Jul 18 '05 #6
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.
Jul 18 '05 #7
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
Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
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 change to some unknown encoding in the output. The...
3
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' opton of the fread() function. I thought the code was...
4
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 me on this? Thanks, Guogang
3
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 markup. How can I do this? Is there a class to...
6
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 />test</p></div> will be transformed to: Title
0
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 inline formatting (specically options for bold,...
0
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 database. The form to add the comments is on an ASP page,...
2
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 success. I have tried several online templates that...
0
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 pre-defined template where some text is "marked" to be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.