Added camel-tagsoup Dataformat docs to Gitbook
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3d00cb72 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3d00cb72 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3d00cb72 Branch: refs/heads/master Commit: 3d00cb7218c38214b49da96862615c636cc126ed Parents: f404157 Author: Andrea Cosentino <anco...@gmail.com> Authored: Wed Jun 8 16:37:44 2016 +0200 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Wed Jun 8 16:37:44 2016 +0200 ---------------------------------------------------------------------- .../camel-tagsoup/src/main/docs/tagsoup.adoc | 69 ++++++++++++++++++++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 70 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/3d00cb72/components/camel-tagsoup/src/main/docs/tagsoup.adoc ---------------------------------------------------------------------- diff --git a/components/camel-tagsoup/src/main/docs/tagsoup.adoc b/components/camel-tagsoup/src/main/docs/tagsoup.adoc new file mode 100644 index 0000000..1ac5d92 --- /dev/null +++ b/components/camel-tagsoup/src/main/docs/tagsoup.adoc @@ -0,0 +1,69 @@ +[[TidyMarkup-TidyMarkup]] +TidyMarkup +~~~~~~~~~~ + +TidyMarkup is a link:data-format.html[Data Format] that uses the +http://www.ccil.org/~cowan/XML/tagsoup/[TagSoup] to tidy up HTML. It can +be used to parse ugly HTML and return it as pretty wellformed HTML. + +*Camel eats our own -dog food- soap* + +We had some issues in our pdf link:manual.html[Manual] where we had some +strange symbols. So http://janstey.blogspot.com/[Jonathan] used this +data format to tidy up the wiki html pages that are used as base for +rendering the pdf manuals. And then the mysterious symbols vanished. + +link:tidymarkup.html[TidyMarkup] only supports the *unmarshal* operation +as we really don't want to turn well formed HTML into ugly HTML +image:https://cwiki.apache.org/confluence/s/en_GB/5982/f2b47fb3d636c8bc9fd0b11c0ec6d0ae18646be7.1/_/images/icons/emoticons/smile.png[(smile)] + +[[TidyMarkup-JavaDSLExample]] +Java DSL Example +^^^^^^^^^^^^^^^^ + +An example where the consumer provides some HTML + +[source,java] +--------------------------------------------------------------------------- +from("file://site/inbox").unmarshal().tidyMarkup().to("file://site/blogs"); +--------------------------------------------------------------------------- + +[[TidyMarkup-SpringXMLExample]] +Spring XML Example +^^^^^^^^^^^^^^^^^^ + +The following example shows how to use link:tidymarkup.html[TidyMarkup] +to unmarshal using Spring + +[source,java] +----------------------------------------------------------------------- +<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="file://site/inbox"/> + <unmarshal> + <tidyMarkup/> + </unmarshal> + <to uri="file://site/blogs"/> + </route> +</camelContext> +----------------------------------------------------------------------- + +[[TidyMarkup-Dependencies]] +Dependencies +^^^^^^^^^^^^ + +To use TidyMarkup in your camel routes you need to add the a dependency +on *camel-tagsoup* which implements this data format. + +If you use maven you could just add the following to your pom.xml, +substituting the version number for the latest & greatest release (see +link:download.html[the download page for the latest versions]). + +[source,java] +---------------------------------------- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-tagsoup</artifactId> + <version>x.x.x</version> +</dependency> +---------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/3d00cb72/docs/user-manual/en/SUMMARY.md ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index d5e0b4e..4c3339f 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -291,6 +291,7 @@ * [Lzf](lzf.adoc) * [Syslog](syslog.adoc) * [SOAP](soap.adoc) + * [Tagsoup](tagsoup.adoc) * [YAML](yaml.adoc) * [XML JSON](xmljson.adoc) * [YAML](yaml.adoc)