PDA

View Full Version : Text to HTML sheet



Curufea
Dec 18th, '05, 08:02 PM
.

Super Squirrel
Dec 20th, '05, 06:09 AM
No. That is actually not only incredibly complicated but subjective as well. Even if someone had made something, it wouldn't necessarily be a format you would be interested in.

Derek Hiemforth
Dec 20th, '05, 09:15 AM
If you don't care what the result looks like, but just want it to be HTML format, just throw the basic HTML tags at the top and bottom, with the original text file sandwiched between a pair of <PRE> tags.

Killer Shrike
Dec 21st, '05, 12:50 PM
{cough]HERODESIGNER{cough}

Dr. Anomaly
Dec 22nd, '05, 07:55 AM
What KS said. There are HTML export templates for HeroDesigner, so if you've got it (and if you don't, I heavily reccomend you do) you can output them that way.

Derek Hiemforth
Dec 22nd, '05, 09:24 AM
True, but if Curufea has tons of text files to deal with, inputting them all into Hero Designer would probably be at least as much work as converting the text files into HTML by hand. :)

gojira
Dec 22nd, '05, 04:25 PM
Good points about possibly having lots of files to convert. Maybe Curufea could tell us what the current format looks like, and why he'd like to convert them to HTML (instead of, say HDC).

You could just point link at the text files like <a href="filename.txt">this</a>. A browser will display a straight text file with out complaint. I think the default even is to use a non-proportional font. No PRE tags even needed.

'Course, it doesn't look the best, but it'll display 'em just fine.

mudpyr8
Dec 28th, '05, 05:08 AM
I still don't get what you are trying to do. If you are trying to simplify input, just make an html form.

If you are trying to convert from an existing text format as long as the format is consistent you can do that actually pretty easily. PHP wouldn't be the best choice but it would be doable. What is the destination format supposed to look like?

I don't understand what your process flow is. Is someone creating a character from scratch on the website? Are they simply uploading an existing character? If uploading an existing character, how was it created in the first place? If HD, then you are jumping through a lot of unnecessary hoops.

Killer Shrike
Dec 28th, '05, 09:26 AM
Um...you do realize that Herodesigner will export your character files to HTML or TXT right?

Killer Shrike
Dec 28th, '05, 02:10 PM
Yes.
But you need Herodesigner.

I have Herodesigner - other people don't.

Wiki is about sharing.
Maybe im missing the obvious -- dump the character to HTML or TXT, paste the results into your Wiki.

What's the problem?

Killer Shrike
Dec 28th, '05, 02:12 PM
I think the main misunderstanding ever since my first post is that none of you actually understand the word "Wiki" - so here's a brief description of what a Wiki is-


Or perhaps we know what a Wiki is, but:


Has anyone written any PHP to convert text files into HTML character sheets?

I'm hoping someone has so it will save me lots of work throwing it into a Wiki ;-p


isn't a very clear or well communicated request for what you actually want.

Simon
Dec 28th, '05, 03:25 PM
You're not thinking this through.

1. What you are asking for REQUIRES that the original text file be strictly formatted/marked up so that the various elements can be read in by the processor and placed in the appropriate sections of the final sheet. Take a single characteristic, for example: in order to determine what you show for the value of the STR Characteristic, the PHP processor would need to look for a particular piece of markup in the original text file.

If you're going to structure your original text file so rigidly, you may as well just write it as HTML from the outset (which is, after all, just a text file with structured markup).

2. If you're looking to take Hero Designer hdc files and have them rendered as HTML character sheets, you're going to want to take the advice given above and use HD -- it's export will give you HTML character sheets of a rather wide variety of styles, all ready for importing into your Wiki. As I'm assuming you realize, HTML is HTML -- you don't need HD to view the files, just a browser. You need HD to create the HTML character sheets from the hdc character files in the first place, but not after that.

You REALLY do not want to try to parse the hdc file on your own. While the hdc files are XML by nature, they are only half of the equation -- they contain the information about the abilities that have been purchased. The second half of the equation is the template (hdt) file associated with the character, which contains the rules by which the cost for the various abilities (as well as the display and overall structure and rules) is determined.

Simon
Dec 28th, '05, 05:48 PM
A "fill in the blanks" form template is not a text file -- it's an HTML form with a server-side PHP (or whatever) form processor.

And you're not done after just processing the entry -- manual entry of characters in that fashion is hugely prone to error. Folks are going to need to edit their entries. Which means loading the fields back into the form for editing....which is basically talking about a database application which populates/reads the form and then renders the character sheet.

I think you're going to a LOT of trouble when you could just use the HD exports....and I would be amazed if you found anything existing that would come even remotely close to what you're looking for.