Re: Thoughts on the way to school...

David Calinski <[email protected]> Fri, 10 Oct 2003 01:53:25 +0200
Newsgroups gmane.comp.tools.memaid.devel
Message-ID <[email protected]>
On Sunday 12 of October 2003 04:19, Richard in Public wrote:
> I'll need a little time to chew on everything you've said (particularly
> the bits about scripting).  But the xml format you propose would already
> help a great deal. 

Ok, I made a simple script (xmlexport) in Perl (attached to this email), may 
have bugs as I am not a Perl programmer, but it WorksForMe[tm].

Imagine now such script in sh:

----< cut here >----
#!/bin/sh

/a/path/to/memaid # run memaid

	# after memaid session will be over, following script will be fire-up:
a/path/to/xmlexport # call to xmlexport - it will create elements.xml

---< cut here >---

But you really want something like this:

---< cut here >----
#!/bin/sh

/a/path/to/xmlimport # here is a call to a script that will do what xmlexport
	# does, but the other way round (it should be easy to make xmlimport from
	# xmlexport)
	# it creates elements.txt from elements.xml and deletes elements.bin
	# so memaid will read elements.txt

/path/to/memaid/memaid # call memaid - it will ready elements.txt that was
	# just created from elements.xml so it would look like memaid
	# reads elements.xml

	# after memaid session will be over following script will be fire-up:
a/path/to/xmlexport # call to xmlexport - it will create elements.xml

---< cut here >---


For an end user: it makes memaid use xml format.
But it gives even more freedom: one can make an own format(s), make a sql 
queries, etc. - no limits here what you can do.


> I've got a few suggestions pending but I want to
> think them through first.  In particular, my instinct is to separate out
> the basic Q & A info and the statistical info.

I am against splitting memaid database into many files.
It would be nice and handy if everything would be in one file only, IMHO.
Sending your database to another computer, making a back-up copy, coding "open 
database" dialog on memaid GUI, checking for database integrity - everything 
is simple when database is only in one file.

You are free to split files (and what you like) using external scripts - you 
can split elements.txt into two files (e.g. one with elements questions/
answers text, second with data), create your own formats, etc.

> Another advantage of using xml, is that it would be very easy to support
> (x)html formatting.

KMemAid already support some html formatting, AFAIK.
I think that html formatting has nothing to do with format of memaid database 
files.

As for html formatting:
Fox Toolkit (which is used by memaid gui, not kmemaid) doesn't provide a HTML 
widget (nor even RTF) for now... I would like to see some kind of formatting 
that html/rtf provides though... I will look for a solution.

Dave
xmlexport (application/x-perl, 1021 B) - not displayed