Article Creation/Parsing?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
ruiner17
Forum Newbie
Posts: 3
Joined: Fri Mar 10, 2006 12:06 am

Article Creation/Parsing?

Post by ruiner17 »

Hi All, great forum going on here!

I am looking for a solution that will allow me to write html web-based articles. These articles will have multiple Chapters, Sections, & Subsections. Along with this, the articles can be broken into pages. These elements of the article will contain various web elements (text, images, flash, php applications, etc). Essentially, putting these all together will form an online book of some sort.

I would like to have the entire article content in a flat file (xml?). Then when someone visits this article, it will pull the appropriate content into a template depending on page number, etc...

How should I get started on this? What direction should I go?

TIA
James
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What about using a wiki?
ruiner17
Forum Newbie
Posts: 3
Joined: Fri Mar 10, 2006 12:06 am

Post by ruiner17 »

now why didn't i think of that?

Well, I haven't had much experience with wikis. My thought was that they are database driven. I will do some research and try to understand how they work.

Thanks feyd!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

True, they generally are database driven. Any particular reason you're against that?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

If you really want to you XML files PHP had a whole library of XML functions to handling parsing etc for you:

http://php.net/xml

I'm curious, if you're using XML, why not use it to display the pages too? All you need to do is write a DTD for your XML. It would probably be a lot easier, unless I've misunderstood you.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

DocBook is a popular documentation format in XML. It's basically markup over normal text/media which can later be parsed into HTML, PDF or CHM (Windows Help format). It's not difficult to learn and get started with it. Since its XML you can probably (haven't tried it) parse it as normal XML into sections.
ruiner17
Forum Newbie
Posts: 3
Joined: Fri Mar 10, 2006 12:06 am

Post by ruiner17 »

thanks guys.

@feyd: I want to keep it flat file based for now in order for editors to actually markup the content on their own with out an extraordinary web-based interface. Perhaps later on I may switch over to database, but I am converting over a system that already has over 2000 articles, some 100s of pages long. This may be more than my database can handle.

@d11wtq: xml is nice since it can be universally (more or less) read. can xmls contain content like flash, php applications, etc? I would like to keep my templates driven by smarty since that is how it is now.

@Maugrim_The_Reaper: Thanks. I'll check out docbook.

I've taken a look at a few php wiki engines as feyd suggested. This is pretty close to what I am looking for. But it is definitely more than I am looking for. I would like to get to the base of the wiki engine.

I'm mainly trying to figure out how the following works:
- version control
- parsing the data (flat file) into readable html

Any thoughts, pointers?

James
Post Reply