Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Cmd.CallDoc

Contents

Description

Pull deriver call documentation out of a Performance and format it nicely.

Synopsis

output

doc_text :: Document -> Lazy.Text Source #

Convert a Document to plain text.

show_parser Source #

Arguments

:: ArgParser 
-> (Maybe.Maybe Text, Maybe.Maybe Text)

(superscript to mark this arg, default value)

bindings_text :: Document -> Text Source #

Print an abbreviated list of calls, grouped by namespace and ordered by shadowing priority. Should look like:

    note generator
n -- note (instrument) [inst] When the event has zero duration, dispatc...
n -- note (imported) [prelude] The note call is the main note generator...
    note transformer
n -- note-attributes (imported) [prelude] This is similar to to `=`, bu...

html output

doc_html :: Doc.HtmlState -> Document -> Doc.Html Source #

Convert a Document to HTML.

binding_tags :: CallBindings -> [Text] Source #

Extract explicit tags as well as some implicit tags. Implicit tags are %control for controls in the default arguments, name-arg for environ keys that default the arguments, and note, control, pitch, or val for the call kind.

scale doc

scale_docs :: [(Pitch.ScaleId, Text, DocumentedCall)] -> [CallBindings] Source #

Extract documentation from scales.

doc

type Document = [Section] Source #

An intermediate format between Scopes and the eventual textual output.

type CallKind = Text Source #

From the fields of Scope and Scopes: note, control, pitch, or val.

type ScopeDoc = (ScopeSource, [CallBindings]) Source #

Documentation for one type of scope.

type ScopeSource = Maybe.Maybe CallPriority Source #

Nothing is when the source is irrelevant, so don't put it in the docs.

type CallBindings = ([Binding], CallType, CallDoc) Source #

Multiple bound symbols with the same DocumentedCall are grouped together:

type SymbolName = Text Source #

This is the name the call is bound to.

implementation

filter_calls :: (SymbolName -> CallName -> Bool) -> Document -> Document Source #

Keep only CallDocs whose name or binding name matches the function.

builtin :: Cmd.M m => m Document Source #

Emit docs for all calls in the default scope.

library :: Library -> [Section] Source #

Extract all the documentation from a Library. Document extraction is a big mess of walking over nested data and converting it to a parallel nested data structure. It's tedious, but the types make it hard to get wrong.

type LookupCall = LookupCall DocumentedCall Source #

A LookupCall with the call stripped out and replaced with just documentation. This is so Calls and ValCalls can be treated uniformly.

convert_call :: LookupCall (Call f) -> LookupCall Source #

Strip out the actual code part of the call, and make it just a lookup for DocumentedCall.

fmap_lookup :: (a -> b) -> LookupCall a -> LookupCall b Source #

call_maps :: CallMaps d -> [ScopeDoc] Source #

Create docs for generator, transformer, and track calls, and merge and sort them.

instrument doc

instrument_calls :: InstrumentCalls -> Document Source #

Get docs for the calls introduced by an instrument.

track doc

track :: Cmd.M m => BlockId -> TrackId -> m Document Source #

Get documentation for calls in scope at the given block and track.

track_sections :: ParseTitle.Type -> Scopes -> [Section] Source #

This is an alternate doc extraction path which extracts the docs from Scopes instead of Library.

merged_scope_docs :: [(CallType, ScopePriority DocumentedCall)] -> [ScopeDoc] Source #

Create docs for generator and transformer calls, and merge and sort them.

imported_scope_doc :: CallType -> [LookupCall] -> [ScopeDoc] Source #

A Library only has builtins, but ScopeDoc wants a source so it can work uniformly with track_sections, which does have separate sources.