HTML Converter for the Comprehensive Rules
by mtgrares
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
HTML Converter for the Comprehensive Rules
by silly freak » 23 Jul 2009, 11:40
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:
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!

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!
Last edited by silly freak on 25 Jul 2009, 14:30, edited 1 time in total.
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: HTML Converter for the Comprehensive Rules
by mtgrares » 24 Jul 2009, 17:30
You should post output of your program, the html comprehensive rules.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: HTML Converter for the Comprehensive Rules
by silly freak » 25 Jul 2009, 14:33
Here is it 

___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: HTML Converter for the Comprehensive Rules
by Rob Cashwalker » 25 Jul 2009, 14:52
sweet!
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: HTML Converter for the Comprehensive Rules
by zerker2000 » 28 Jul 2009, 12:54
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
).

O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: HTML Converter for the Comprehensive Rules
by silly freak » 30 Jul 2009, 10:06
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
stay tuned

___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: HTML Converter for the Comprehensive Rules
by zerker2000 » 30 Jul 2009, 10:33
Ah, good idea. Is linking "see <keyword>"s in the glossary a feature (it's a suggestion otherwise
)?

O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.
--Eladamri, the Seed of Freyalise
- zerker2000
- Programmer
- Posts: 569
- Joined: 09 May 2009, 21:40
- Location: South Pasadena, CA
- Has thanked: 0 time
- Been thanked: 0 time
Re: HTML Converter for the Comprehensive Rules
by silly freak » 30 Jul 2009, 19:43
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.

adding see <keyword> to the plaintext parser wasn't in my immediate plan, but it doesn't seem very hard.
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: HTML Converter for the Comprehensive Rules
by silly freak » 22 Oct 2009, 22:02
if someone's interested, here's the current CR:
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: HTML Converter for the Comprehensive Rules
by Mr.Chaos » 23 Oct 2009, 06:05
Grrrrrrrabbed it. You never know when it comes in handy. Thanks SF.
](./images/smilies/eusa_wall.gif)

- Mr.Chaos
- Tester
- Posts: 625
- Joined: 06 Sep 2008, 08:15
- Has thanked: 0 time
- Been thanked: 0 time
Re: HTML Converter for the Comprehensive Rules
by mtgrares » 24 Oct 2009, 20:00
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.
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.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: HTML Converter for the Comprehensive Rules
by silly freak » 24 Oct 2009, 20:42
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.
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: HTML Converter for the Comprehensive Rules
by silly freak » 23 Nov 2009, 23:20
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
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
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: HTML Converter for the Comprehensive Rules
by silly freak » 28 Feb 2010, 10:53
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.
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: HTML Converter for the Comprehensive Rules
by Marek14 » 28 Feb 2010, 12:03
It seems that the archive is missing pictures for the planeswalker and chaos symbol from Planechase.
18 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 39 guests