aboutsummaryrefslogtreecommitdiff
path: root/haddock-library/src/Documentation/Haddock/Parser.hs
Commit message (Collapse)AuthorAgeFilesLines
* Better identifier parsingAlec Theriault2019-02-251-59/+4
| | | | | | | | | | | | | | | | * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental).
* Support value/type namespaces on identifier linksAlec Theriault2019-02-251-8/+14
| | | | | | | | | | | Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity)
* Fix warnings, accept outputAlec Theriault2018-12-121-1/+1
| | | | | | | * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's
* Accept test caseAlec Theriault2018-11-061-1/+1
|
* Support (and flatten) inline markup in image linksAlec Theriault2018-11-061-5/+10
| | | | | | | Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547
* Support hyperlink labels with inline markupAlec Theriault2018-11-061-10/+12
| | | | The parser for pictures hasn't been properly adjusted yet.
* Faster 'Text' driven parser combinatorsAlec Theriault2018-11-051-14/+16
| | | | | | | | Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}'
* Replace 'attoparsec' with 'parsec' (#799)Alec Theriault2018-04-251-192/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments
* @since includes package name (#749)Alec Theriault2018-03-271-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too.
* Make a proper definition for the <link> parserSimon Jakobi2018-03-141-4/+6
|
* Restore backward-compat with base-4.5 through base-4.8Herbert Valerio Riedel2018-03-101-2/+27
|
* Support unicode operators, proper modulesAlec Theriault2018-03-021-22/+12
| | | | | | | | Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes #458.
* Grid Tables (#718)Oleg Grenrus2018-02-011-3/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example
* Take until line feedalexbiehl2018-02-011-1/+1
|
* Remove scanner, takeWhile1_ already takes care of escapingalexbiehl2018-02-011-14/+1
|
* Treat escaped \] better in definition lists (#717)Alexander Biehl2018-02-011-1/+14
| | | This fixes #546.
* Fixup haddockAlexander Biehl2017-07-311-1/+1
|
* Consequently use inClass and notInClass in haddock-library (#617)Alex Biehl2017-05-131-8/+13
| | | These allow attoparsec to do some clever lookup optimization
* Fix the documentation for haddock itself.Dominic Steinitz2015-12-211-9/+15
| | | | | | | | | | | | | | | Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs
* Handle inline math with mathjax.Dominic Steinitz2015-12-211-1/+15
|
* Make nested lists count indentation according to first item.Łukasz Hanuszczak2015-05-271-35/+46
|
* Create simple method for indentation parsing.Łukasz Hanuszczak2015-05-271-0/+9
|
* Filter '\r' from comments due to Windows problems.Vincent Berthoux2015-01-221-2/+3
| | | | | On Windows this was causing newline to be rendered twice in code blocks. Closes #359, fixes #356.
* Disambiguate string-literalsHerbert Valerio Riedel2014-12-121-4/+4
| | | | | | | | GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs
* Update doctest parts of commentsMateusz Kowalczyk2014-12-101-18/+22
|
* Allow the parser to spit out meta-infoMateusz Kowalczyk2014-12-101-2/+4
| | | | | | | | | | | | | | | Currently we only use it only for ‘since’ annotations but with these patches it should be fairly simple to add new attributes if we wish to. Closes #26. It seems to work fine but due to 7.10 rush I don't have the chance to do more exhaustive testing right now. The way the meta is output (emphasis at the end of the whole comment) is fairly arbitrary and subject to bikeshedding. Note that this makes test for Bug310 fail due to interface version bump: it can't find the docs for base with this interface version so it fails. There is not much we can do to help this because it tests for ’built-in’ identifier, not something we can provide ourselves.
* (wip) Add support for @since (closes #26)Simon Hengel2014-11-161-6/+20
|
* State intention rather than implementation details in Haddock commentSimon Hengel2014-11-161-1/+1
|
* newtype-wrap parser monadSimon Hengel2014-11-081-1/+1
|
* Minor code simplificationSimon Hengel2014-11-081-4/+3
|
* Fix parsing of identifiers written in infix wayMateusz Kowalczyk2014-11-041-11/+12
|
* Allow an optional colon after the closing bracket of definition listsSimon Hengel2014-11-031-1/+1
| | | | | This is to disambiguate them from markdown links and will be require with a future release.
* Add support for markdown imagesSimon Hengel2014-11-031-2/+10
|
* Allow markdown links at the beginning of a paragraphSimon Hengel2014-11-031-2/+18
|
* Add support for markdown links (closes #336)Simon Hengel2014-11-031-2/+20
|
* parser: Try to parse definition lists right before text paragraphsSimon Hengel2014-11-031-1/+1
|
* Minor refactoringSimon Hengel2014-11-031-22/+28
|
* Remove unused language extensionsSimon Hengel2014-11-031-4/+0
|
* Fix #313 by doing some list munging.Mateusz Kowalczyk2014-08-151-13/+13
| | | | | | I get rid of the Monoid instance because we weren't satisfying the laws. Convenience of having <> didn't outweigh the shock-factor of having it behave badly.
* Catch mid-line URLs. Fixes #314.Mateusz Kowalczyk2014-07-281-2/+2
|
* Don't mangle append order for nested lists.Mateusz Kowalczyk2014-06-251-14/+2
| | | | | | | | The benefit of this is that the ‘top-level’ element of such lists is properly wrapped in <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346.
* Drop DocParagraph from front of headersMateusz Kowalczyk2014-06-251-1/+6
| | | | | I can not remember why they were wrapped in paragraphs to begin with and it seems unnecessary now that I test it. Closes #307.
* Fix anchors. Closes #308.Mateusz Kowalczyk2014-06-251-3/+8
|
* Fixed haddock warnings.John MacFarlane2014-06-181-6/+4
|
* Removed reliance on LambdaCase (which breaks build with ghc 7.4).John MacFarlane2014-06-181-3/+3
|
* Use doctest to check examples in documentationSimon Hengel2014-06-181-0/+3
|
* Comment improvements + few words in cabal fileMateusz Kowalczyk2014-06-181-9/+28
|
* Compatibility with older versions of base and bytestringSimon Hengel2014-06-181-1/+1
|
* Move parser + parser tests out to own package.Mateusz Kowalczyk2014-05-051-0/+474
We move some types out that are necessary as well and then re-export and specialise them in the core Haddock. Reason for moving out spec tests is that if we're working on the parser, we can simply work on that and we can ignore the rest of Haddock. The downside is that it's a little inconvenient if at the end of the day we want to see that everything passes.