packages feed

tagsoup 0.13.3 → 0.13.4

raw patch · 6 files changed

+27/−9 lines, 6 files

Files

CHANGES.txt view
@@ -1,5 +1,8 @@ Changelog for TagSoup +0.13.4+    #24, add isTagComment function+    Update the copyright year 0.13.3     Work on GHC 7.9 0.13.2
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2006-2014.+Copyright Neil Mitchell 2006-2015. All rights reserved.  Redistribution and use in source and binary forms, with or without
README.md view
@@ -1,8 +1,8 @@-# TagSoup [![Hackage version](https://img.shields.io/hackage/v/tagsoup.svg?style=flat)](http://hackage.haskell.org/package/tagsoup) [![Build Status](http://img.shields.io/travis/ndmitchell/tagsoup.svg?style=flat)](https://travis-ci.org/ndmitchell/tagsoup)+# TagSoup [![Hackage version](https://img.shields.io/hackage/v/tagsoup.svg?style=flat)](https://hackage.haskell.org/package/tagsoup) [![Build Status](https://img.shields.io/travis/ndmitchell/tagsoup.svg?style=flat)](https://travis-ci.org/ndmitchell/tagsoup)  TagSoup is a library for parsing HTML/XML. It supports the HTML 5 specification, and can be used to parse either well-formed XML, or unstructured and malformed HTML from the web. The library also provides useful functions to extract information from an HTML document, making it ideal for screen-scraping. -This document gives two particular examples of scraping information from the web, while a few more may be found in the [Sample](https://github.com/ndmitchell/tagsoup/blob/master/TagSoup/Sample.hs) file from the source repository. The examples we give are:+The library provides a basic data type for a list of unstructured tags, a parser to convert HTML into this tag type, and useful functions and combinators for finding and extracting information. This document gives two particular examples of scraping information from the web, while a few more may be found in the [Sample](https://github.com/ndmitchell/tagsoup/blob/master/TagSoup/Sample.hs) file from the source repository. The examples we give are:  * Obtaining the Hit Count from Haskell.org * Obtaining a list of Simon Peyton-Jones' latest papers@@ -155,3 +155,14 @@         tags <- fmap parseTags $ openURL "http://www.timeanddate.com/worldclock/city.html?n=136"         let time = fromTagText (dropWhile (~/= "<strong id=ct>") tags !! 1)         putStrLn time+        +<h2>Related Projects</h2>++<ul>+    <li><a href="http://tagsoup.info/">TagSoup for Java</a> - an independently written malformed HTML parser for Java. Including <a href="http://tagsoup.info/#other">links to other</a> HTML parsers.</li>+    <li><a href="http://www.fh-wedel.de/~si/HXmlToolbox/">HXT: Haskell XML Toolbox</a> - a more comprehensive XML parser, giving the option of using TagSoup as a lexer.</li>+    <li><a href="http://www.fh-wedel.de/~si/HXmlToolbox/#rel">Other Related Work</a> - as described on the HXT pages.</li>+    <li><a href="http://therning.org/magnus/archives/367">Using TagSoup with Parsec</a> - a nice combination of Haskell libraries.</li>+    <li><a href="http://hackage.haskell.org/packages/tagsoup-parsec">tagsoup-parsec</a> - a library for easily using TagSoup as a token type in Parsec.</li>+    <li><a href="http://hackage.haskell.org/packages/archive/wraxml/latest/doc/html/Text-XML-WraXML-Tree-TagSoup.html">WraXML</a> - construct a lazy tree from TagSoup lexemes.</li>+</ul>
Text/HTML/TagSoup.hs view
@@ -23,7 +23,7 @@      -- * Tag identification     isTagOpen, isTagClose, isTagText, isTagWarning, isTagPosition,-    isTagOpenName, isTagCloseName,+    isTagOpenName, isTagCloseName, isTagComment,      -- * Extraction     fromTagText, fromAttrib,
Text/HTML/TagSoup/Type.hs view
@@ -10,7 +10,7 @@      -- * Tag identification     isTagOpen, isTagClose, isTagText, isTagWarning, isTagPosition,-    isTagOpenName, isTagCloseName,+    isTagOpenName, isTagCloseName, isTagComment,      -- * Extraction     fromTagText, fromAttrib,@@ -129,3 +129,7 @@ isTagCloseName :: Eq str => str -> Tag str -> Bool isTagCloseName name (TagClose n) = n == name isTagCloseName _ _ = False++-- | Test if a 'Tag' is a 'TagComment'+isTagComment :: Tag str -> Bool+isTagComment TagComment {} = True; isTagComment _ = False
tagsoup.cabal view
@@ -1,7 +1,7 @@ cabal-version:  >= 1.6 name:           tagsoup-version:        0.13.3-copyright:      Neil Mitchell 2006-2014+version:        0.13.4+copyright:      Neil Mitchell 2006-2015 author:         Neil Mitchell <ndmitchell@gmail.com> maintainer:     Neil Mitchell <ndmitchell@gmail.com> homepage:       http://community.haskell.org/~ndm/tagsoup/@@ -11,7 +11,7 @@ license-file:   LICENSE build-type:     Simple synopsis:       Parsing and extracting information from (possibly malformed) HTML/XML documents-tested-with:    GHC==7.8.2, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2+tested-with:    GHC==7.10.1, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2 description:     TagSoup is a library for parsing HTML/XML. It supports the HTML 5 specification,     and can be used to parse either well-formed XML, or unstructured and malformed HTML@@ -19,7 +19,7 @@     from an HTML document, making it ideal for screen-scraping.     .     Users should start from the "Text.HTML.TagSoup" module.-extra-source-files:+extra-doc-files:     CHANGES.txt     README.md