Map over all tags in the document
Modulehakyll-4.17.0.0Haskell2010
Hakyll.Web.Html
Provides utilities to manipulate HTML pages
- 12 values
- Packagehakyll-4.17.0.0
- Exports12
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceHtml.hs
Generic
3 declarationsMap over all tags (as list) in the document
Map over all tags (as list) in the document, in a monad
Headers
2 declarationsMap every h1 to an h2, h2 to h3, etc.
Maps any hN to an hN+amount for any amount > 0 && 1 <= N+amount <= 6.
Url manipulation
5 declarationsExtract URLs from tags' attributes. Those would be the same URLs on which withUrls would act.
Apply a function to each URL on a webpage
Convert a filepath to an URL starting from the site root
Example:
toUrl "foo/bar.html"Result:
"/foo/bar.html"This also sanitizes the URL, e.g. converting spaces into '%20'
Get the relative url to the site root, for a given (absolute) url
Check if an URL links to an external HTTP(S) source
Stripping/escaping
2 declarationsStrip all HTML tags from a string
Example:
stripTags "<p>foo</p>"Result:
"foo"This also works for incomplete tags
Example:
stripTags "<p>foo</p"Result:
"foo"HTML-escape a string
Example:
escapeHtml "Me & Dean"Result:
"Me & Dean"