aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
Commit message (Collapse)AuthorAgeFilesLines
* Group similar fixities togetherNiklas Haas2014-03-091-3/+10
| | | | | Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <=
* Differentiate between TH splices (line-links) and regular namesNiklas Haas2014-03-0910-138/+178
| | | | | | | | | | | | | | | | | This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures.
* Use optLast instead of listToMaybe for sourceUrls/wikiUrlsNiklas Haas2014-03-091-7/+6
| | | | | | This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates.
* Reorder topDeclElem to move the source/wiki links to the topNiklas Haas2014-03-091-1/+1
| | | | | They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom.
* Render fixity informationNiklas Haas2014-03-088-102/+182
| | | | | | Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of.
* Change rendering of duplicate record field docsMateusz Kowalczyk2014-02-271-1/+2
| | | | | | | | See Haddock Trac #195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this.
* Fix rendering of Contents when links are presentMateusz Kowalczyk2014-02-244-22/+37
| | | | Fixes Haddock Trac #267.
* Lower precedence of equality constraintsNiklas Haas2014-02-231-1/+1
| | | | | | | This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC
* Make ImplicitParams render correctly (#260)Niklas Haas2014-02-232-8/+13
| | | | | | This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone)
* Don't shadow ‘strip’.Mateusz Kowalczyk2014-02-231-4/+4
| | | | -Wall complains
* Turn a source code comment into specsSimon Hengel2014-02-221-2/+0
|
* Strip a single leading space from bird tracks (#201)Niklas Haas2014-02-221-1/+10
| | | | | | | | | | | | | | | | | | | | This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch.
* Use a bespoke data type to indicate fixityMateusz Kowalczyk2014-02-194-66/+66
| | | | | | This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment.
* Only warn about missing docs when docs are missingMateusz Kowalczyk2014-02-131-1/+2
| | | | | This fixes the ‘Missing documentation for…’ message for modules with 100% coverage.
* Get rid of re-implementation of sortByNiklas Haas2014-02-131-7/+3
| | | | | | | I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
* Improve display of poly-kinded type operatorsnand2014-02-116-35/+40
| | | | | | | This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
* Add support for type/data familiesnand2014-02-1110-138/+181
| | | | | | | | This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>
* Ensure a space between type signature and ‘Source’Mateusz Kowalczyk2014-02-101-2/+1
| | | | | | This is briefly related to Haddock Trac #249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain.
* Insert a space between module link and descriptionMateusz Kowalczyk2014-02-101-1/+1
| | | | Fixes Haddock Trac #277.
* Handle infix vs prefix names correctly everywhere, by explicitly specifying ↵Dr. ERDI Gergo2014-01-314-56/+66
| | | | | | the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+"
* Fix @ code blocksMateusz Kowalczyk2014-01-301-0/+1
| | | | | | In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output.
* <+>: Don't insert a space when concatenating empty nodesDr. ERDI Gergo2014-01-311-1/+3
|
* Update CPP check for __GLASGOW_HASKELL__Austin Seipp2014-01-291-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Support for -XPatternSynonymsDr. ERDI Gergo2014-01-198-33/+156
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fixes #271Mateusz Kowalczyk2014-01-131-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Allow escaping in URLs and pictures.Mateusz Kowalczyk2014-01-122-5/+20
| | | | | | | | | Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs
* Allow for nesting of paragraphs under lists.Mateusz Kowalczyk2014-01-123-27/+87
| | | | | | | | | | | | | | | | | The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs
* Bump interface versionMateusz Kowalczyk2014-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change.
* Per-module extension flags and language listing.Mateusz Kowalczyk2014-01-128-36/+89
| | | | | | | | | | | | | Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs
* Allow for headings inside function documentation.Mateusz Kowalczyk2014-01-128-8/+70
| | | | | | | | | | | | | LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs
* Support for bold.Mateusz Kowalczyk2014-01-1210-13/+62
| | | | | | | Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs
* Fix totality, unicode, examples, paragraph parsingSimon Hengel2014-01-124-331/+216
| | | | | | | | Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu@fuuzetsu.co.uk if you need the full commit history.
* Don't append newline to parseString inputSimon Hengel2014-01-121-18/+12
| | | | We also check that we have parsed everything with endOfInput.
* One pass parser and tests.Mateusz Kowalczyk2014-01-1212-489/+598
| | | | | | | | We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing.
* Some code simplification by using traverseSimon Hengel2014-01-122-52/+9
|
* Adapt to small change in Pretty's exportsSimon Peyton Jones2014-01-101-3/+3
|
* Track changes in HsSpliceTy data constructorSimon Peyton Jones2013-11-251-1/+1
|
* Bump versionSimon Hengel2013-11-101-12/+2
|
* Print missing documentation. Fixes #258.Mateusz Kowalczyk2013-09-182-6/+33
|
* Fixes #231Mateusz Kowalczyk2013-09-182-2/+4
|
* Add missing `traverse` method for `GenLocated`Herbert Valerio Riedel2013-09-181-1/+1
| | | | | | | As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Revision to reflect new role annotation syntax in GHC.Richard Eisenberg2013-09-176-14/+12
|
* Fix AMP warningsDavid Luposchainsky2013-09-081-0/+8
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fixes #253Mateusz Kowalczyk2013-09-021-2/+16
|
* Fix ticket #247.Mateusz Kowalczyk2013-08-271-2/+6
| | | | | I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions.
* Add spec tests.Mateusz Kowalczyk2013-08-251-2/+25
| | | | | This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it.
* Bump interface file version.David Waern2013-08-041-2/+2
|
* Output Copright and License keys in Xhtml backend.Mathieu Boespflug2013-08-044-26/+38
| | | | | | | This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern@gmail.com>
* Changes to reflect changes in GHC's type HsTyVarBndrRichard Eisenberg2013-08-025-11/+13
|
* Remove (error "synifyKind") to use WithinType, to allow haddock to process base.Richard Eisenberg2013-07-241-1/+1
|