Document Browser

One suite to code them all. An complete IDE and assembler for all your z80 projects!

Moderators: benryves, kv83

Post Reply
User avatar
benryves
Maxcoderz Staff
Posts: 3074
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Document Browser

Post by benryves »

One more piece of software to add to the EarlyMorning/Brass/Latenite collection is something that can be used as an entirely standalone app. :)

I don't know if you're like me, but if you are you'll have directories stuffed to the brim with odd bits of documentation in a variety of exotic formats.

What I'm writing is something a bit like the Visual Studio documentation browser, but a tad more flexible. And, of course, plugin-extendable!

Image Image Image

(Click for larger screenshots). From left to right, some HTML (CoBB's excellent guide once again!), PDF and text.

It's the last one, actually, that gave me the idea of this project - I've got a lot of old text files which I can't read properly as they rely on a variety of quirky encodings. Hence the text file plugin adds its own custom toolbar to allow you to pick a new encoding and save the current file back as UTF-8.

The files will be stored within the directory "My Documents\Latenite\Documentation\", the library file held at "My Documents\Latenite\Documentation\library.doclib". For files to appear at all, they need to have an entry in the library.doclib file (just an XML file).

I'll probably add the functionality to import documentation from a single file - most likely a PAK/Zip-alike file which contains its own library.doclib file, which when "installed" through the browser will extract to the right place and merge libraries.

Currently HTML/PDF support is delivered via IE, and text and RTF files have their own plugins. I've wrapped XP's Picture and Fax Viewer up to view images, and I'd like to find a way to wrap Office components to display Word/Excel files.

Some sort of indexing to provide text searches would be nice, but I don't really want to reinvent the wheel and will see if I can find a simple way to use Windows IFilters. A CHM/HLP plugin might be useful, not sure how feasible that would be.

Let me know if you have any requests/ideas. I'll post an update when there's a usable beta.
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

Wow. This is extremly useful for all those different z80 text files and other documents and stuff...

Btw, I guess the files I output with my "secret" project will blend in fine, since they are HTML, but what do I need to do to make such a nice tree-view of all htmlfiles :)

BTW: Where did you get those cool icons? Are thos from the site I gave you?
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3074
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

kv83 wrote:Wow. This is extremly useful for all those different z80 text files and other documents and stuff...
That's the intention. I've got hundreds of the blighters. ;) The worst part is that they're all in many different formats, and having a viewer open for each different one is a pain.

Btw, I guess the files I output with my "secret" project will blend in fine, since they are HTML, but what do I need to do to make such a nice tree-view of all htmlfiles :)
You could even make it so that the "secret" project would directly load the files it works with. The plugins inherit from a Panel, so you can do whatever you like on said panel. The existing plugins are all very simple (they just stick a TextBox or WebBrowser, docked to fill, on themselves).

For a tree view, you could do something like the PDF plugin does (in my case, it's Foxit Reader) and provide your own tree view on the tab itself.

Creating plugins is pretty easy, given that all you're really inheriting from is a standard Panel control (and the extra method - "bool TryLoadDocument(string filename, string arguments)" - which returns true on success, false on failure).

As for the structure of the library, it's just an XML document made up of nested <document /> elements.

If a <document /> has a "src" attribute, when clicked it loads that particular document. If it has any child attributes, it turns into an expandable menu and gets a blue page icon instead of a white one.

The "book" icons are just <document />s which don't have a src attribute.

As well as a src attribute, you need to include a name attribute (display name) and can optionally include an args attribute. For example, with CoBB's Z80 guide, everything under the "Simple Structures" section points to the same HTML document, but the "args" bit contains an extra string that is passed to the plugin which it uses as a bookmark - file.htm#whatevertheargwas.

There isn't a library editor in there yet (I'm currently editing the XML by hand), but I intend to add one (renaming documents, dragging-and-dropping them around to arrange things to your liking). At the simplest level, you can add a file (or a collection of files) through an open file dialog, but as previously mentioned a format that allows you to install documentation from a single file would be convenient.

BTW: Where did you get those cool icons? Are thos from the site I gave you?
Yes, the famfamfam set. Thank you. :)
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Re: Document Browser

Post by Timendus »

benryves wrote:I don't know if you're like me, but if you are you'll have directories stuffed to the brim with odd bits of documentation in a variety of exotic formats.

I love you for your software and the bright light you shed on this dark, Americanized forum with sentences that make me smile time on time again :)

Great application once again, I'm sure it'll come in very handy and not just for calculator related documentation!
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4120
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

benryves wrote:You could even make it so that the "secret" project would directly load the files it works with.


Not only is this whole thing awesome, that feature is incredibly useful! I always have an asm/project documents folder open when im working on stuff, this fees up space on the taskbar :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Maybe you could add an internet explorer pane too, and add a bookmark to the tiwiki in the directory..?
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

Currently HTML/PDF support is delivered via IE


So that's a "yes" i guess :)
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3074
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Well, sort of. The browser expects documentation to be on your hard disk, so it's a good point to raise. I'll add support for external links. :)

I'd like to find a slicker OLE solution than using IE as the container, so if you have any bright ideas...
User avatar
benryves
Maxcoderz Staff
Posts: 3074
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Hm, do I really need support for external links... if the document is a .lnk/.url file?

Anyhow, I've now added exporting (right-click any tree node in the contents, pick "export" and it rattles away to get all the linked files and exports the node details and binaries in a single compressed ".docpack" file). Importing comes next.

I've also added the ability to search for broken links (if a document is missing, it rattles through the documentation directory trying to fix the link for you). Currently it only works on filename, but I'll probably store extra data (file size and hash) along with the link so that it can work out which of the myriad 'index.htm's you really meant.

Now, I need suggestions as to which document packs I should provide. As a standalone it won't come with any, but the Latenite website will host a few (and Latenite itself might come bundled with some).

What I have so far is of course the official TI guides - and I spent some time yesterday importing that well-known link protocol guide.

Suggestions?

Z80TI

(It all depends on whether I can get permission, of course).
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

This is the official, always most up-to-date version of Z80 Bits:

http://baze.au.com/misc/z80bits.html
User avatar
benryves
Maxcoderz Staff
Posts: 3074
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Thank you. :)

The browser now imports/exports via a single file - the .docpack.

To go with the contents, one needs an index, so I've added a search-as-you-type sort of affair:

Image

I can't find any way to get an embedded PDF (within IE) to jump to pages/sections (bookmarks), something that would be rather useful. I don't know if anyone can recommend a decent PDF viewer control (a lot of the .NET/ActiveX ones are rather pricey)?
gangsta
Sir Posts-A-Lot
Posts: 171
Joined: Wed 12 Oct, 2005 10:46 pm

Post by gangsta »

search-as-you-type...reminds me of OSX or Vista...that will be easier...
User avatar
elfprince13
Sir Posts-A-Lot
Posts: 234
Joined: Sun 11 Dec, 2005 2:21 am
Contact:

Post by elfprince13 »

/me suggests the ability to import data from a specified category in a wiki.
Post Reply