lisher.acceptance-test.1.0.2.source-code.index.html Maven / Gradle / Ivy
Documentation and acceptance test for a html publisher
This is the documentation and acceptance tests for a html publisher. The purpose with the html publisher os to allow
a text written in html include source code that is properly formatted for html. Source code may be Java, xml, html,
xhtml and so on. This document will act both as documentation of the tool and as an acceptance test document. It
will contain the specific includes that should be handled properly as well as being used for the transformation.
A key feature is that the html should be formatted so no unnecessary line breaks are included in the transformed
result. This is needed so Wordpress doesn't break a paragraph written in html just because a pretty code formatter
did that.
Comments
Html comments should be respected in the sense that no transformation should be done inside of a comment. The
comment
should just be passed through the transformer without any changes in its formatting. An example may look like this:
Lists
Lists should be treated as paragraphs in the sense that any line breaks should not be included. Very long list items
should be transformed so that they have there start tag and end tag on the same line. An example may look like:
- This is a long list item that has been divided into more then one line in the source but should not be divided
in the transformed result.
- This is another long list item that has been divided into more then one line in the source but should not be
divided
in the transformed result.
Includes
The most important feature is including files. The include is defined with an include tag at the beginning of a row
in the tml document. It should not be part of any tag, except the html and possible the body tag. The result should
be a pre tag with the file properly transformed. The transformation should only be done for characters that has a
special meaning in html. A typical example is '>' in xml that has to be transformed.
The different includes that are supported are these:
Simple file include:
<include-source-code root="./acceptance-test"
file="./src/test/java/se/somath/publisher/AcceptanceTest.java"/>
And the result is:
You can include a file tree like this:
<include-file-tree root="./acceptance-test"/>
And the result is:
Pre and code
Pre and code tags should not be transformed at all, they should be treated as pass through without any
alterations
at all.
Resources
- Thomas Sundberg - the author