| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's
source location tracking to include the file name as well as line/column. This
way each AST item that is tagged with a SrcLoc gets the original file name too.
Use this original file name to add source links to each exported item, in the
same visual style as the wiki links. Note that the per-export source links are
to the defining module rather than whichever module haddock pretends it is
exported from. This is what we want for source code links. The source code link
URL can also contain the name of the export so one could implement jumping to
the actual location of the function in the file if it were linked to an html
version of the source rather than just plain text. The name can be selected
with the %N wild card.
So for linking to the raw source code one might use:
--source=http://darcs/haskell.org/foo/%F
Or for linking to html syntax highlighted code:
--source=http://darcs/haskell.org/foo/%M.html#%N
|
|
|
|
|
|
| |
Add attribute #not-home, to indicate that the current module should
not be considered to be a home module for the each entity it exports,
unless there is no other module that exports the entity.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Revamp the linking strategy in Haddock.
Now name resolution is done in two phases:
- first resolve everything to original names, like a Haskell compiler
would.
- then, figure out the "home" location for every entity, and point
all the links to there. The home location is the lowest non-hidden
module in the import hierarchy that documents the entity. If there
are multiple candidates, one is chosen at random.
Also:
- Haddock should not generate any HTML with dangling links any more.
Unlinked references are just rendered as plain text.
- Error reporting is better: if we can't find a link destination for
an entity reference, we now emit a warning.
|
|
|
|
|
|
|
|
|
|
| |
Make Haddock compile again after the recent base package changed. The Map/Set
legacy hell has been factored out, so that all modules can simply use the new
non-deprecated interfaces. Probably a lot of things can be improved by a little
bit of Map/Set/List algebra, this can be done later if needed.
Small note: Currently the list of instances in HTML code is reversed. This will
hopefully be fixed later.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for a short description for each module, which is included
in the contents.
The short description should be given in a "Description: " field of
the header. Included in this patch are changes that make the format
of the header a little more flexible. From the comments:
-- all fields in the header are optional and have the form
--
-- [spaces1][field name][spaces] ":"
-- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")*
-- where each [spaces2] should have [spaces1] as a prefix.
--
-- Thus for the key "Description",
--
-- > Description : this is a
-- > rather long
-- >
-- > description
-- >
-- > The module comment starts here
--
-- the value will be "this is a .. description" and the rest will begin
-- at "The module comment".
The header fields must be in the following order: Module, Description,
Copyright, License, Maintainer, Stability, Portability.
Patches submitted by: George Russell <ger@informatik.uni-bremen.de>,
with a few small changes be me, mostly to merge with other recent
changes.
ToDo: document the module header.
|
|
|
|
| |
copyright update
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Re-exporting names from a different package is problematic, because we
don't have access to the full documentation for the entity. Currently
Haddock just ignores entities with no documentation, but this results
in bogus-looking empty documentation for many of the modules in the
haskell98 package. So:
- the documentation will now just list the name, as a link
pointing to the location of the actual documentation.
- now we don't attempt to link to these re-exported entities if
they are referred to by the current module.
Additionally:
- If there is no documentation in the current module, include
just the Synopsis section (rather than just the documentation
section, as it was before). This just looks nicer and was on
the TODO list.
|
|
|
|
|
|
|
|
|
| |
- Include the OptHide setting in the interface, so we don't include
hidden modules in the combined index/contents.
- Add a -k/--package flag to set the package name for the current set
of modules. The package name for each module is now shown in the
right-hand column of the contents, in a combined contents page.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename instances based on the import_env for the module in which they
are to be displayed. This should give, in many cases, better links
for the types and classes mentioned in the instance head.
This involves keeping around the import_env in the iface until the
end, because instances are not collected up until all the modules have
been processed. Fortunately it doesn't seem to affect performance
much.
Instance heads are now attached to ExportDecls, rather than the HTML
backend passing around a separate mapping for instances. This is a
cleanup.
|
|
|
|
| |
Update to avoid using hslibs with GHC >= 5.04
|
|
|
|
|
|
| |
When a module A exports another module's contents via 'module B', then
modules which import entities from B re-exported by A should link to
B.foo rather than A.foo. See examples/Bug2.hs.
|
|
|
|
|
|
| |
Handle import specs properly, include 'hiding'. Haddock now has a
complete implementation of the Haskell module system (more or less; I
won't claim it's 100% correct).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lots of changes:
- instances of a class are listed with the class, and
instances involving a datatype are listed with that type.
Derived instances aren't included at the moment: the calculation
to find the instance head for a derived instance is non-trivial.
- some formatting changes; use rows with specified height rather than
cellspacing in some places.
- various fixes (source file links were wrong, amongst others)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reworking of the internals to support documenting function arguments
(the Most Wanted new feature by the punters).
The old method of keeping parsed documentation in a Name -> Doc
mapping wasn't going to cut it for anntations on type components,
where there's no name to attach the documentation to, so I've moved to
storing all the documentation in the abstract syntax. Previously some
of the documentation was left in the abstract syntax by the parser,
but was later extracted into the mapping.
In order to avoid having to parameterise the abstract syntax over the
type of documentation stored in it, we have to parse the documentation
at the same time as we parse the Haskell source (well, I suppose we
could store 'Either String Doc' in the HsSyn, but that's clunky). One
upshot is that documentation is now parsed eagerly, and documentation
parse errors are fatal (but have better line numbers in the error
message).
The new story simplifies matters for the code that processes the
source modules, because we don't have to maintain the extra Name->Doc
mapping, and it should improve efficiency a little too.
New features:
- Function arguments and return values can now have doc annotations.
- If you refer to a qualified name in a doc string, eg. 'IO.putStr',
then Haddock will emit a hyperlink even if the identifier is not
in scope, so you don't have to make sure everything referred to
from the documentation is imported.
- several bugs & minor infelicities fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a facility for specifying options that affect Haddock's treatment
of the module. Options are given at the top of the module in a
comma-separated list, beginning with '-- #'. eg.
-- # prune, hide, ignore-exports
Options currently available, with their meanings:
prune:
ignore declarations which have no documentation annotations
ignore-exports:
act as if the export list were not specified (i.e. export
everything local to the module).
hide:
do not include this module in the generated documentation, but
propagate any exported definitions to modules which re-export
them.
There's a slight change in the semantics for re-exporting a full
module by giving 'module M' in the export list: if module M does not
have the 'hide' option, then the documentation will now just contain a
reference to module M rather than the full inlined contents of that
module.
These features, and some other changes in the pipeline, are the result
of discussions between myself and Manuel Chakravarty
<chak@cse.unsw.edu.au> (author of IDoc) yesterday.
Also: some cleanups, use a Writer monad to collect error messages in
some places instead of just printing them with trace.
|
|
|
|
|
| |
DocEmpty is a right and left-unit of DocAppend (remove it in the smart
constructor).
|
|
|
|
|
|
|
| |
- Add support for named chunks of documentation which can be
referenced from the export list.
- Copy the icon from $libdir to the destination in HTML mode.
|
|
|
|
|
|
|
| |
Grok the kind of module headers we use in fptools/libraries, and pass
the "portability", "stability", and "maintainer" strings through into
the generated HTML. If the module header doesn't match the pattern,
then we don't include the info in the HTML.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- copy haddock.css into the same place as the generated HTML
- new option: --css <file> specifies the style sheet to use
- new option: -o <dir> specifies the directory in which to
generate the output.
- because Haddock now needs to know where to find its default stylesheet,
we have to have a wrapper script and do the haddock-inplace thing
(Makefile code copied largely from fptools/happy).
|
|
|
|
|
| |
Generate a little table of contents at the top of the module doc (only
if the module actually contains some section headings, though).
|
|
|
|
|
|
|
|
| |
- add the <...> syntax for marking up URLs in documentation
- Make the output for data & class declarations more compact when
there aren't any documentation annotations on the individual
methods or constructors respectively.
|
|
|
|
|
|
|
|
|
|
|
| |
Remap names in the exported declarations to be "closer" to the current
module. eg. if an exported declaration mentions a type 'T' which is
imported from module A then re-exported from the current module, then
links from the type or indeed the documentation will point to the
current module rather than module A.
This is to support better hiding: module A won't be referred to in the
generated output.
|
|
This is Haddock, my stab at a Haskell documentation tool. It's not
quite ready for release yet, but I'm putting it in the repository so
others can take a look.
It uses a locally modified version of the hssource parser, extended
with support for GHC extensions and documentation annotations.
|