purescript-0.8.0.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.Docs.Convert

Description

Functions for converting PureScript ASTs into values of the data types from Language.PureScript.Docs.

Synopsis

Documentation

convertModules :: (Functor m, MonadError MultipleErrors m) => Env -> [Module] -> m [Module] Source

Convert a group of modules to the intermediate format, designed for producing documentation from. It is also necessary to pass an Env containing imports/exports information about the list of modules, which is needed for documenting re-exports.

Preconditions:

  • If any module in the list re-exports documentation from other modules, those modules must also be included in the list.
  • The modules passed must have had names desugared and re-exports elaborated first.

If either of these are not satisfied, an internal error will be thrown. To avoid this, it is recommended to use Language.PureScript.Docs.ParseAndDesugar to construct the inputs to this function.

convertModulesInPackage :: (Functor m, MonadError MultipleErrors m) => Env -> [InPackage Module] -> m [Module] Source

Like convertModules, except that it takes a list of modules, together with their dependency status, and discards dependency modules in the resulting documentation.

collectBookmarks :: InPackage Module -> [Bookmark] Source

Go through a PureScript module and extract a list of Bookmarks; references to data types or values, to be used as a kind of index. These are used for generating links in the HTML documentation, for example.