| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
* Keep track of ordered list indexes and render them
* Rename some identifiers to clarify
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Catch Markdown links at beginning of line within paragraph
Per Issue #774, Markdown links were being parsed as ordinary text when
they occurred at the beginning of a line other than the first line of
the paragraph. This occurred because the parser was not interpreting a
left square bracket as a special character that could delimit special
markup. A space character was considered a special character, so, if a
space occurred at the beginning of the new line, then the parser would
interpret the space by itself and then continue parsing, thereby
catching the Markdown link. '\n' was not treated as a special character,
so the parser did not catch a Markdown link that may have followed.
Note that this will allow for Markdown links that are not surrounded by
spaces. For example, the following text includes a Markdown link that
will be parsed:
Hello, world[label](url)
This is consistent with how the parser handles other types of markup.
* Remove obsolete documentation hint
Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the
need for the workaround suggested in the documentation.
|
| |
|
| |
|
|
|
|
| |
Instead construct the ModLink value directly when parsing.
|
|
|
|
|
|
|
|
|
|
| |
Support a markdown-style way of annotating module references. For instance
-- | [label]("Module.Name#anchor")
will create a link that points to the same place as the module
reference "Module.Name#anchor" but the text displayed on the link will
be "label".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix multiple typos and inconsistencies in doc/markup.rst
Note: I noticed some overlap with #1112 from @wygulmage and #1081 from
@parsonsmatt after creating these proposed changes - mea culpa for not
looking at the open PRs sooner.
* Fix #1113 If no Signatures, no section of index.html
* Change the formatting of missing link destinations
The current formatting of the missing link destination does not really
help user to understand the reasons of the missing link.
To address this, I've changed the formatting in two ways:
- the missing link symbol name is now fully qualified. This way you
immediately know which haskell module cannot be linked. It is then easier
to understand why this module does not have documentation (hidden module
or broken documentation).
- one line per missing link, that's more readable now that symbol name
can be longer due to qualification.
For example, before haddock was listing missing symbol such as:
```
could not find link destinations for:
Word8 Word16 mapMaybe
```
Now it is listed as:
```
could not find link destinations for:
- Data.Word.Word8
- Data.Word.Word16
- Data.Maybe.mapMaybe
```
* Add `--ignore-link-symbol` command line argument
This argument can be used multiples time. A missing link to a symbol
listed by `--ignore-link-symbol` won't trigger "missing link" warning.
* Forbid spaces in anchors (#1148)
* Improve error messages with context information (#1060)
Co-authored-by: Matt Audesse <matt@mattaudesse.com>
Co-authored-by: Mike Pilgrem <mpilgrem@users.noreply.github.com>
Co-authored-by: Guillaume Bouchard <guillaume.bouchard@tweag.io>
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
|
| |
|
|
|
|
|
| |
Document the fact the header level is going to always be between 1 and 6
inclusive. Along the way, I also optimized the parsing code a bit.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our quickcheck tests for `haddock-library` stumbled across an edge case
input that was causing Haddock to crash: it was a unicode space
character.
The root cause of the crash is that we were implicitly assuming that
if a space character was not " \t\f\v\r", it would have to be "\n".
We fix this by instead defining horizontal space as: any space character
that is not '\n'.
Fixes #1142
|
|
|
|
|
|
|
|
|
|
| |
* Update parsing to strip leading & trailing whitespace from table cells
* Update fixture data to disallow whitespaces at both ends in table cells
* Add test case for whitespaces stripped from both ends of table cells
* Update table reference test data for html tests
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `$>` operator definition is available only since base-4.7 which
unfortunately wasn't caught before release to Hackage (but has been
fixed up by a metadata-revision)
This commit introduces a `CompatPrelude` module which allows to reduce
the amount of CPP by ousting it to a central location, i.e. the new
`CompatPrelude` module. This pattern also tends to reduce the tricks
needed to silence unused import warnings.
Addresses #1119
|
|
|
|
|
|
|
|
|
| |
This can easily trip up people if one isn't aware of it. Usually it's
better to avoid this kind of conditionality especially for typeclasses
for which there's an compat-package as conditional instances like
these tend to fragment the ecosystem into those packages that go the
extra mile to provide backward compat via those compat-packages and
those that fail to do so.
|
|
|
|
|
| |
Tentatively adjust bounds and changelogs for the release to be bundled
with GHC 8.8.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* '(<|>)' 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).
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The circumstances under which this module appeared are completely gone.
The Hyperlinker backend no longer needs this module (it uses the more
efficient `Encoding` module from `ghc`).
Why no deprecation? Because this module really shouldn't exist!
- It isn't used in `haddock-library`/`haddock-api` anymore
- It was copy pasted directly from `utf8-string`
- Folks seeking a boot-lib only solution can use `ghc`'s `Encoding`
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
The parser for pictures hasn't been properly adjusted yet.
|
|
|
|
|
|
|
|
| |
Perf only change:
* use 'getParserState'/'setParserState' to make 'Text'-optimized
parser combinators
* minimize uses of 'Data.Text.{pack,unpack,cons,snoc}'
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
| |
This fixes #546.
|
|
|
|
| |
This allows us to later throw warnings if can't find an identifier
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* WIP: Provide --show-interface option to dump interfaces
Like ghcs own --show-iface this flag dumps a binary interface file to
stdout in a human (and machine) readable fashion. Currently it uses
json as output format.
* Fill all the jsonNull stubs
* Rework Bifunctor instance of DocH, update changelog and documentation
* replace changelog, bring DocMarkupH doc back
* Update CHANGES.md
* Update CHANGES.md
* Move Control.Arrow up
It would result in unused import if the Bifunctor instance is not generated.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Move `DocMarkup` from haddock-api to haddock-library
* Move more markup related functions
* Markup module
* CHANGELOG
|
| |
|
|
|
| |
These allow attoparsec to do some clever lookup optimization
|
|
|
|
|
|
| |
Previously, it was `data` wrapping a `Maybe`, which seems a bit
silly. Obviously, this can be changed back if anyone wants to add
more fields some day.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
| |
On Windows this was causing newline to be rendered twice in code blocks.
Closes #359, fixes #356.
|