473,325 Members | 2,860 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,325 software developers and data experts.

Structuring the code of a wiki parsing engine

Hello everybody. I'm kind of new to Python. I'm working on a simple
text parser that will allow me to transform a certain syntax into a
certain output. I find wikis interesting, so wiki to HTML parsing is
one of the things that I want to accomplish (I'm not actually writing
a whole wiki, that's complex, but I'm only trying to get basic text
conversion going on).

Presently, I'm thinking of putting the (simple, regexp-driven)
filters in a module called "parsers", and then make a "handlers"
module that allows for the actual transformation. So, for example,
one parser would be a separate class (WikiParser) which would have an
attribute called "emph" (emphasis) which is a string '\*\*(.+?)\*\*'.
Then a handler class (HTMLHandler) would have an attribute called
"emph" which is a string '<em>\\1</em>'. Then the regular expressions
would be generated via a chosen parser/handler combination. This to
make it easy to change things around later.

My question to you: is this the right way to go about it? My parser
doesn't really need to do all that much, but I would like for it to
be easily changeable by editing a single file.

Thanks for any help!

Greets,
Michiel

May 19 '07 #1
0 952

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

Similar topics

3
by: tm | last post by:
Hello, I have to to scan c-code, look for a c-struct variable(declaration) and represent the struct in a tree-graphic. Are there modules for scanning c-code and graphictools for the...
2
by: Eric | last post by:
Greetings Comrades, Pythonistas! I am looking for guidance on the quick and easiest path to set up a Python wiki. A wiki application idea popped into my head while I was making morning coffee. ...
2
by: Kenneth McDonald | last post by:
I'm looking for a Wiki engine to set up for my company, so that we can incrementally add user documentation for a fairly complex program, plus allow users to add their own comments for the benefit...
44
by: john bailo | last post by:
I microcrap is buying Google -- then I want a GNU search engine ! ( Cant that decrepit creep keep his hands off of anything ? )
1
by: Michael Schuerig | last post by:
I'm looking for advice on how to structure CSS stylesheets to make working with them easier. I'm thinking of things like - grouping of rules - what makes a good selector - gainfully using the...
1
by: loguser | last post by:
Hello, I'm thinking about embedding a wiki into one of my project. However, I'm looking just for a wiki-text-processing library, not a complete out-of-box solution. Ideal feature set is...
3
by: piotr maliński | last post by:
I'm planning to wite a fully featured wiki in Python in one of frameworks. I've seen some notes about wiki/documentation management scripts that use SVN as a data storage/versioning. I've been...
5
by: Alexey Smirnov | last post by:
Can someone suggest me a good light-weight free Wiki-engine? A source on C# is a plus :-) Any is help appreciated.
25
by: Jon Slaughter | last post by:
I have some code that loads up some php/html files and does a few things to them and ultimately returns an html file with some php code in it. I then pass that file onto the user by using echo. Of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.