Home / Ranma 1/2 Fanfictions / Format

Obsolete Document!

This Version (1.0) of "HTML Formatting for Prose" has been superceded by version 2.0, and is no longer being maintained.

Please use HTML Formatting for Prose 2.0


The original document content is presented below.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


HTML Formatting for Prose 1.0

By Joseph Palmer

     This is an evolving document. If you have comments, or have found errors, please let me know so that I can address them. jpalmer@josephpalmer.com

 

HTML can be coaxed into presenting your Fanfictions in a form very similar to a book. I've been refining my format over the years, and have finally found one that I like.

The goals of this format

    Indented Paragraphs - In a book, a new paragraph is indicated by indenting the first line.

    Paragraph Spacing - In a book, there is no extra space between paragraphs, unless there is a break in the narrative.

    Fixed Column Width - There's a reason why prose books are printed with the text crossing the narrow direction of the page, and why large pages are broken up into columns — The eye is more likely to find the beginning of the next line if it does not have to retrace too far.

    This format causes the text to be flowed into paragraphs that are roughly as wide as 22 lines of text are high. I picked 22 after looking at and measuring several paperbacks. Hardbacks frequently have wider lines, but they also tend to be more nicely printed, and on better paper. Since few of us have 1200 dpi displays (but they're coming!) I have elected to err on the side of readability.

    Font - I have not specified either the font face, nor the absolute font size. I'd rather let the user display the document on their preferred or default Font face and size. Readers with visual disabilities can view the story with a very large font, and readers with ultra-high resolution monitors may need a larger font. Readers with low resolution displays (or PDAs) may need a smaller font.

    Compatibility - The format renders nicely on all browsers, including text based tools like "lynx". This format does use Cascading Style Sheets (CSS), but it does not depend upon them. Obsolete browsers (and lynx) that don't understand CSS will still display a pleasing representation of the prose.

    CSS is used sparingly - there has been a lot of noise about poor support for the entire CSS spec in popular browsers, but the subset of features I've used in my format work with Navigator, Internet Explorer, and Opera.

    Standard - This format uses XHTML, which is more strict than normal HTML. Modern browsers are bloated with code that tries to make sense of poor html, XHTML is a response to that. If we create better-formed documents, the browsers can be simpler. (Think PDAs)

    There are a few changes in XHTML, but none are particularly difficult. Tags must now be lower case. (That argument is over.) Values must be within quote marks: like "this". No overlapping tags. and all elements must be terminated.

    Webreview has an excellent article explaining the ins and outs of XHTML.

Contents:


The Format


The Header

This is the required stuff you put at the top of your document to tell the browser what to do. It is not displayed on the screen of the browser.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta name="MSSmartTagsPreventParsing" content="TRUE"> This tag prevents Internet Explorer from adding "smart links" to the text of your story

<title> The title of your document </title>

<link rel="stylesheet" href="YourSytleSheet.css" type="text/css" />

<meta name="MSSmartTagsPreventParsing" content="TRUE" />

</head>

 

    The <!DOCTYPE... line is required by XHTML, It's sort of a pointer to the 'Roseta stone' of HTML. The DOCTYPE is automatically added if you use HTML Tidy checking software. (More on HTML Tidy in the tools section)

    The <html... line declares that this is an html document, and points to the name space documentation. (Again required by XHTML)

    The <head> tag begins the header. The header is also where you would put other meta-information, like search tags.

    The <title> tag begins the title. This title is what's picked up in the browser window title. close the title with the </title>tag.

    The <link... tag links the stylesheet to the page

    The </head> tag closes the header.


The Body


    The body contains the HTML that will be rendered onto the screen.

 

<body>

<div>

<h1> The Title of your Story, </h1>

<p> By T. Author</p>

<hr />

<p> This is the first paragraph of the story. XHTML demands that a paragraph always begins with a <p> tag and end with a </p> tag. </p>

<p>&nbsp;&nbsp;&nbsp;&nbsp; This is the second paragraph of the story. I've used four &nbsp; characters to perform the indent. </p>

<p>&nbsp;&nbsp;&nbsp;&nbsp; Each paragraph in the story is formed in the same way. </p>

<hr />

<a href="http://validator.w3.org/check?url=" your full url"><img border="0" src="vxhtml10.gif" alt="Valid XHTML 1.0!" height="31" width="88" /></a>

</div>

</body>

</html>


    The <body> tag is required, It tells the browser that the body starts here. (The closing </body> is at the bottom of the format.)

    The <div> tag declares a region on the document. In the Stylesheet It's used to set the width of the text. I put the entire story into one big "div". (See the closing </div> down at the bottom of the format.)

    The <h1> tag makes a nice big title. The </h1> tag is required to close the title.

    The <p> tag starts each paragraph, the </p> tag is required to close each paragraph.

    The <hr /> is used to create a break between the title section and the story itself. That space and slash are not a misprint. XHTML requires that all elements be closed (which explains the </p> on every paragraph). Naturally empty elements, such as the <hr> are closed by the addition of a space and trailing slash.

    The following section is optional.

 

<a href="http://validator.w3.org/check?url=your full url"><img border="0" src="vxhtml10.gif" alt="Valid XHTML 1.0!" height="31" width="88" /></a>

 

    It places a small graphic in your story, and links it to the W3 validation software. When you click on that graphic it asks the W3 to read the page you've specified, and generate a report about that page.

It looks like this:

Valid XHTML 1.0!

    Go ahead, click on the picture above. Then hit the back button on your browser to get back here.

    That's the format. That's all you need to be XHTML compatible. Now on to the Stylesheet...


The Stylesheet

This is the style sheet that I use for all of my stories.


    div     {width:         22em;
             margin-left:    2em;
             margin-right:   2em}

    p       {margin-top:    .3em;
             margin-bottom: .3em}

    p.small {margin-top:    .3em;
             margin-bottom: .3em;
             font-size:    .75em;
             color:      #0000ef}

    p.blk   {margin-top:    .5em;
             margin-bottom: .5em;
             margin-left:    2em;
             margin-right:   2em}

    ol      {font-size:    .75em}

    ul      {font-size:    .75em}

    body    {background: #cdc0b0}


div - Division

    div     {width:         22em;
             margin-left:    2em;
             margin-right:   2em}

    The div Element is the magic key to this format. It's used to set the width of the text, and to pull the text away from the left edge of the window.

    The width: property sets the width of the 'div' region.

    The margin-left: pushes the div region to the right, (Out of the left gutter)

    The margin-right: does the same on the right.

    I'm using the em to set the widths here. The em is a relative measurement, which means that the width of the text is related to the font size. If you want to know more about the em, here is an outstanding article on Typographical Measurement systems.

    A width of 22em will cause the lines to break at about the same relative width as a paperback book.

    Browser note: The 4.x versions of Netscape Navigator will display the text as something closer to 24 em wide. That's a bug. Navigator 6, IE 5x, and Opera will display the text correctly at 22em width.


p - Paragraph

    p       {margin-top:    .3em;
             margin-bottom: .3em}

    The p element sets the base style for paragraphs. A paragraph is a block-level element, which means that it is rendered within a 'box'. For the base style the only thing I do is adjust the whitespace above and below the box.

    margin-top: sets the space above the 'box'

    margin-top: sets the space below the 'box'

    These style changes pull paragraphs of text closer together. Books are printed with no blank lines between paragraphs, but the HTML standard renders a full blank line between paragraphs.

    I've elected to bring the paragraphs closer together, but not so close as to completely remove the extra 'leading' between them. This compromise is a both an aesthetic choice and a concession to the lower resolution of computer screens. In less fancy words, I like the way it looks.

    There's another reason to bring the paragraphs together — a full space between paragraphs is used in prose to indicate to the reader that a change or discontinuity has occurred in the narrative.

    That full line break is forced by adding a paragraph with a non-printing character between paragraphs:

 

<p>&nbsp;&nbsp;&nbsp;&nbsp; Here is a sample paragraph. It's just nonsense text used to illustrate the basic shape of a rendered paragraph.</p>

<p> &nbsp;</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp; Here is a the second sample paragraph. It's just nonsense text used to illustrate the basic shape of a rendered paragraph.</p>

 

This html would render as:


    Here is a sample paragraph. It's just nonsense text used to illustrate the basic shape of a rendered paragraph.

 

    Here is a the second sample paragraph. It's just nonsense text used to illustrate the basic shape of a rendered paragraph.


    While CCS has a text-indent property that can be applied to paragraphs, I have elected to indent paragraphs by using a string of three or four &nbsp; characters. I chose this method for backwards compatibility with older (Pre-4.0) browsers and text-based browsers (such as Lynx).


p.small - Paragraph (Small)

    p.small {margin-top:    .3em;
             margin-bottom: .3em;
             font-size:    .75em;
             color:      #0000ef}

    I use this style in one place, in the navigation line at the top of each story.

    This style is called by adding the class parameter to the p tag:

 

<p class="small">This is the string of text I want to appear in a smaller font. It will also appear on a bluish color.</p>

 

    It will render as:

This is the string of text I want to appear in a smaller font. It will also appear on a bluish color.

 

    Here's what my navigation bar looks like:

 

Home / Ranma 1/2 Fanfictions / Format

 

    The HTML for that looks like this:

<p class="small">
<a href="http://www.josephpalmer.com/index.shtml">Home</a> /
<a href="http://www.josephpalmer.com/fanfic/fanfic.shtml">Ranma 1/2 Fanfictions</a> / Format</p>

 

    I recommend that you have a navigation feature on your stories, but that is, of course, optional.


p.blk - Paragraph (Block)

    p.blk   {margin-top:    .5em;
             margin-bottom: .5em;
             margin-left:    2em;
             margin-right:   2em}

    I use this style for paragraphs that are in some way removed from the story. The text appears in a smaller box like this:

This is an example of the 'blk' style, I used it in "Black" to set off a news report that was heard from a radio. The block format is commonly used when a large block of text is to be quoted verbatim, such as a newspaper article.

You can also set off the text in a block by applying italics or Typewriter Text


ol - Ordered List

    ol      {font-size:    .75em}

    I use the ordered list to format my copyright disclaimer.


Copyright Notice

  1. The characters and stories of Ranma 1/2 are Copyright © Rumiko Takahashi, and are used here without permission or license.
  2. No claims to the above copyright are made by the author of this work.
  3. This work is for non-commercial use ONLY, and is produced for the enjoyment of fans only.
  4. This work is the expression of the author and the depiction of the Ranma 1/2 characters herein are in no way represented to be a part of Ranma 1/2 as depicted by the original author and copyright holder(s).

The HTML for that looks like this:

<p><b>Copyright Notice</b></p>

<ol><li type="i">The characters and stories of Ranma 1/2 are Copyright &copy; Rumiko Takahashi, and are used here without permission or license.</li>

<li type="i">No claims to the above copyright are made by the author of this work.</li>

<li type="i">This work is for non-commercial use ONLY, and is produced for the enjoyment of fans only.</li>

<li type="i">This work is the expression of the author and the depiction of the Ranma 1/2 characters herein are in no way represented to be a part of Ranma 1/2 as depicted by the original author and copyright holder(s).</li>

</ol>


ul - Unordered List

    ul      {font-size:    .75em}

    I used the unordered list in "Hot" to break off a series of non-story paragraphs.


body - Body

    body    {background: #cdc0b0}

    I declare a body background color to flood the page with a less than bright white background. I'm personally not very hot on either full white or patterned .gif backgrounds, and I find that a pastel background makes it easier on the eyes.


Tools


Text Editor

    I prefer NoteTab Pro 4.82 as my text editor. NoteTab Pro does html tag coloring, and can integrate with Html Tidy. It's available online for $19.95. I've been using it for a couple of years, and it has proven to be very stable.


HTML Checker

    I use HTML Tidy to check the validity of my code. I highly recommend that you get and use HTML Tidy as well. (It's Free!)

    I think it's important to the future of the web that we authors stick to the W3 standards. By supporting open standards, can we can help prevent the takeover of the web by those pushing proprietary features and tags. HTML Tidy is a painless way of checking (and cleaning up) your html

    HTML Tidy is a separate filter, not a GUI program. NoteTab opens it, and passes the file through, then returns the repaired file to the editing window. (You can undo) The HTML Tidy web page links to other programs that are integrated with Tidy.

    HTML Tidy can use a Configuration file to create the output you desire Here's my tidy.cfg file:

// Palmer's xhtml-prose config file for HTML tidy
indent: auto
indent-spaces: 2
wrap: 0
markup: yes
output-xml: no
input-xml: no
show-warnings: yes
numeric-entities: no
quote-marks: no
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
char-encoding: ascii
output-xhtml: yes

    This configuration creates a non-wrapped, indented file that remembers &nbsp; characters and keeps the text in simple (7 bit) ascii format.


Text Decoration

<b> </b> - Bold is frequently used as the title of chapter, but is rarely used within the body of prose text.

Example Bold Text

<i> </i> - Italics is used for extra emphasis or to clue the reader that a word is in a foreign language.

Example Italic Text

<tt> </tt> - Teletype Text can be used to quote external material.

Example Teletype Text

Special Characters

    HTML can call characters outside of the normal ascii range.

 

&nbsp; - The non-breaking space. This space can be put between words that you simply don't want split between lines. Also, since browsers compress 'white space', tabs and spaces in the source file are shrink to a single space. The &nbsp; is treated differently, and you can stack them up to make indents or expressive spacing.

Example     of several non-breaking spaces in a row

&#8212; - The em dash. An extra wide dash commonly used in prose to mean a break longer than a comma. Traditionally the em dash is as wide as the block around the capital letter "M".

Example—Text

 

 

 

 

 


Appendix A

    A Copy-paste ready XHTML Template, ready for you to input your story.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta name="MSSmartTagsPreventParsing" content="TRUE" />

<title> The title of your document </title>

<link rel="stylesheet" href="xprose.css" type="text/css" />

<!-- Make sure that the Stylesheet name (above) matches the file name. -->

</head>

<body>

<div>

 

<!-- this section is the optional navigation feature -->

<p class="small">
<a href="
Your Home page URL">Home</a> /
<a href="
Your Fanfic Page URL">Ranma 1/2 Fanfictions</a> /
The Title of this file -Not a link</p>

<!-- End of optional navigation feature -->

 

<h1> The Title of your Story, </h1>

<p> By T. Author</p>

<hr />

<p> This is the first paragraph of the story. Note that this paragraph is not indented. The first paragraph of a story (or chapter) is frequently not indented, unless it begins with quoted dialog.</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp; This is the second paragraph of the story. I've used four &nbsp; characters to perform the indent. </p>

<p>&nbsp;&nbsp;&nbsp;&nbsp; Each paragraph in the story is formed in the same way. </p>

<hr />

<!-- this section is the optional copyright notice -->

<p><b>Copyright Notice</b></p>

<ol><li type="i">The characters and stories of Ranma 1/2 are Copyright &copy; Rumiko Takahashi, and are used here without permission or license.</li>

<li type="i">No claims to the above copyright are made by the author of this work.</li>

<li type="i">This work is for non-commercial use ONLY, and is produced for the enjoyment of fans only.</li>

<li type="i">This work is the expression of the author and the depiction of the Ranma 1/2 characters herein are in no way represented to be a part of Ranma 1/2 as depicted by the original author and copyright holder(s).</li>

</ol>

<!-- End of the optional copyright notice -->

<a href="http://validator.w3.org/check?url=your full url"><img border="0" src="vxhtml10.gif" alt="Valid XHTML 1.0!" height="31" width="88" /></a>

</div>

</body>

</html>


Appendix B

    A Copy-paste ready Cascading Style sheet. Save as "xprose.css".


    div     {width:        22em;
             margin-left:   2em;
             margin-right:  2em}

    P       {margin-top:    .3em;
             margin-bottom: .3em}

    P.small {margin-top:    .3em;
             margin-bottom: .3em;
             font-size:     .75em;
             color:         #0000EF}

    P.blk   {margin-top:     .5em;
             margin-bottom:  .5em;
             margin-left:    2em;
             margin-right:   2em}

    ol      {font-size:     .75em}

    ul      {font-size:     .75em}

    body    {Background:     #CDC0B0}


Appendix C

    A Copy-paste ready HTML Tidy config file. Save the file as "tidy.cfg", in the same directory as "tidy.exe".


// Palmer's xhtml-prose config file for HTML tidy
indent: auto
indent-spaces: 2
wrap: 0
markup: yes
output-xml: no
input-xml: no
show-warnings: yes
numeric-entities: no
quote-marks: no
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
char-encoding: ascii
output-xhtml: yes

Valid HTML 4.0!

[TextCounter Fatal Error: Could Not Write to File _fanfic_format_Format_shtml] hits.

[an error occurred while processing this directive]