Page 1 of 2

HTML Converter for the Comprehensive Rules

PostPosted: 23 Jul 2009, 11:40
by silly freak
I'm pretty sure this is the wrong place to post it, but it doesn't really suit anywhere, and i'm active in his forum. feel free to move it ;)

Anyway, i've done a small program that converts the text-form of the comprehensive rules to xml and the xml-form to html.
I always hated that there was no way to get directly to a rule using the hints ("see rule 104.2") and wanted to convert it to html with that feature.

now i'm done, and I want to share it with you:
  • Markup for the document title and section titles
  • Hyperlinks to external documents
  • Links between sections, rules, and the table of contents
  • Cross-Links to rules or sections from any where in the rules and glossary
  • Image-Conversion for Magic-Symbols
  • Anchors for every glossary index, so a manual "#Ability" in the browser's address bar is possible

For those interested in the code, I have a version including sources and javadoc, for the others there is a binary version.
Both versions include the latest text-version of the rules: 090708

The attachments are in zip-format, because the board doesn't allow jar. rename it to jar to execute it.

I hope you like it!

Re: HTML Converter for the Comprehensive Rules

PostPosted: 24 Jul 2009, 17:30
by mtgrares
You should post output of your program, the html comprehensive rules.

Re: HTML Converter for the Comprehensive Rules

PostPosted: 25 Jul 2009, 14:33
by silly freak
Here is it ;)

Re: HTML Converter for the Comprehensive Rules

PostPosted: 25 Jul 2009, 14:52
by Rob Cashwalker
sweet!

Re: HTML Converter for the Comprehensive Rules

PostPosted: 28 Jul 2009, 12:54
by zerker2000
Nice! However, I think that the program should download associated images during creation instead of linking to gatherer(speaking from a cellphone modem internet user's perspective :P).

Re: HTML Converter for the Comprehensive Rules

PostPosted: 30 Jul 2009, 10:06
by silly freak
i'm working on a much more comprehensive version, which allows that, as well as creating comprehensive rules in more than one file (say, one for the table of content and so on)

stay tuned ;)

Re: HTML Converter for the Comprehensive Rules

PostPosted: 30 Jul 2009, 10:33
by zerker2000
Ah, good idea. Is linking "see <keyword>"s in the glossary a feature (it's a suggestion otherwise :))?

Re: HTML Converter for the Comprehensive Rules

PostPosted: 30 Jul 2009, 19:43
by silly freak
sort of... the current version contains <a name="..."> for every entry in the glossary. so, in your own files (say a javadoc ;)), linking is no problem

adding see <keyword> to the plaintext parser wasn't in my immediate plan, but it doesn't seem very hard.

Re: HTML Converter for the Comprehensive Rules

PostPosted: 22 Oct 2009, 22:02
by silly freak
if someone's interested, here's the current CR:

Re: HTML Converter for the Comprehensive Rules

PostPosted: 23 Oct 2009, 06:05
by Mr.Chaos
Grrrrrrrabbed it. You never know when it comes in handy. Thanks SF.

Re: HTML Converter for the Comprehensive Rules

PostPosted: 24 Oct 2009, 20:00
by mtgrares
Thanks.

The author of Incantus taught me to always read from "the source" which is the comprehensive rule book, (understanding it is the hard part, ha.) In order to improve MTG Forge I need to learn the rules backwards and forwards, which is sometimes very tedious. I hate "last known information" and layers for power and toughness.

Re: HTML Converter for the Comprehensive Rules

PostPosted: 24 Oct 2009, 20:42
by silly freak
yeah, last known information is really hard. i got layers running in my program (nothing else though^^), but that one is a real headache. it's like one card having two characteristics at once, for effects before and after moving.

Re: HTML Converter for the Comprehensive Rules

PostPosted: 23 Nov 2009, 23:20
by silly freak
still the 09/10/05 rules, but maybe you find it interesting. i've done a big restructuring to the code, skipping the GUI, and I honestly don't expect anyone to run it himself. anyway, it's a good opportunity to push my blog, so here is it:
http://laterna--magica.blogspot.com/2009/11/html-comprehensive-rules.html
i'll try to upload new rules as soon as they go online, just inform me if I forget

Re: HTML Converter for the Comprehensive Rules

PostPosted: 28 Feb 2010, 10:53
by silly freak
Comprehensive rules 2010/02/01: unzip it into some directory, open the xml file in your browser, and enjoy the ability to navigate between the rules! png images for all the mana- and other symbols are included.

Re: HTML Converter for the Comprehensive Rules

PostPosted: 28 Feb 2010, 12:03
by Marek14
It seems that the archive is missing pictures for the planeswalker and chaos symbol from Planechase.