Documentation
XHTML General
Include all content documents in a directory named text
. Each XHTML file should be named following the expressing order:
bash1FB01 # frontmatter2FB02 # bodymatter3FB03 # backmatter
Front Matter
Example of XHTML front matter:
01_frontmatter02.xhtml
01_frontmatter03.xhtml
FB01_frontmatter02.xhtml
FB01_frontmatter03.xhtml
It is allowed to append what the type is after the front matter:
01_frontmatter02_copyright.xhtml
01_frontmatter03_preface.xhtml
01_frontmatter04_introduction.xhtml
FB01_frontmatter02_copyright.xhtml
FB01_frontmatter03_preface.xhtml
FB01_frontmatter04_introduction.xhtml
Main Content
Any chapter content should be built into a chapter XHTML file:
default1FB02_chapter01.xhtml2FB02_chapter02.xhtml3FB02_chapter03.xhtml
Back Matter
All content that comes after the last chapter such as Conclusions, Acknowledgements (which can be sometimes placed in the frontmatter), Indecies, etc. etc. should be placed in a backmatter XHTML file:
default1FB03_backmatter01.xhtml2FB03_backmatter02.xhtml3FB03_backmatter03.xhtml
and like frontmatter the name type can be appended:
bash1FB03_backmatter01_index.xhtml # could be for name index2FB03_backmatter02_index.xhtml # could be for subject index
Markup
Only two types of markup will be allowed:
- Forced left, regex pattern:
^\s+(?=<)
. - Tabbed indentation, reference: Correct indentation for selected code with BBEdit.
Line Break
Do not use:
html1<p><br /></p>
If found replace with CSS. <br />
tags should be replaced with a CSS declaration accounting for the space in em
or px
.
Empty Span
Empty span tags should be removed, use the following to find them:
html1<span class="[A-Za-z0-9_-]*"></span>
Span tags with a space should be removed, use the following to find them:
bash1## Find:2<span class="[A-Za-z0-9_-]*">( )</span>3## Replace:4\1
Finding empty and spaced span tags can be consolidated to one find and replace pattern using BBEdit's Find Panel:
bash1## Find:2`<span class="[A-Za-z0-9_-]*">( |)</span>`3## Replace:4`\1`
Multiple Span
Multiple span tags should be consolidated, example:
HTML
:::warning Bad
html1<span class="bold"><span class="italic">Foo Bar</span></span>
:::
:::tip Good
html1<span class="boldItalic">Foo Bar</span>
:::
CSS
CSS can also be consolidated:
css1.bold {2font-weight: bold;3}4.italic {5font-style: italic;6}7.boldItalic {8font-weight: bold;9font-style: italic;10}
css1.bold,2.boldItalic {3font-weight: bold;4}5.italic,6.boldItalic {7font-style: italic;8}
Self Closing Tags
Self closing tags are not allowed except for images. For example: <p class=”foobar” />
should be replaced with <p class=”foobar”></p>
. Good references:
- Are self-closing tags valid in HTML5?
- Difference between “> or ” /> in HTML
- Do we still need end slashes in HTML5?
- Why do browsers think this tag isn't immediately ended?
Attributes
The attribute selectors’ value should not use dashes (example: <p class=”foo-bar”>foobar</p>
) but should be either:
Camel case:
html1<p class="”fooBar”">foobar</p>
Underscore:
html1<p class="”foo_bar”">foobar</p>
Symbols
Symbols should be coded as numerical entities, example: ® should be ®
and the clean_entity.scpt will replace the most common rendered symbols and named entities to their numerical value.
HR Tags
If you’re needing a line do not use <hr />
tag use a <div />
with css, example:
html1<!-- old way -->2<hr />
html1<!-- replacement -->2<div class="line></div>