Safe Haskell | Safe-Inferred |
---|
Pull deriver call documentation out of a Performance and format it nicely.
Synopsis
- doc_text :: Document -> Lazy.Text
- call_bindings_text :: Bool -> CallBindings -> Format.Doc
- environ_keys :: ArgName -> EnvironDefault -> Text
- write_doc :: Doc.Doc -> Format.Doc
- show_module :: Module.Module -> Text
- show_parser :: ArgParser -> (Maybe.Maybe Text, Maybe.Maybe Text)
- bindings_text :: Document -> Text
- doc_html :: Html.HtmlState -> Document -> Html.Html
- html_header :: Html.HtmlState -> Html.Html
- css :: Html.Html
- javascript :: Html.Html
- search_javascript :: Html.Html
- hide_empty_javascript :: Html.Html
- call_bindings_html :: Html.HtmlState -> Text -> CallBindings -> Html.Html
- binding_tags :: CallBindings -> [Text]
- type Scale = [CallBindings]
- scales_html :: Html.HtmlState -> [CallBindings] -> Html.Html
- scale_docs :: [(Pitch.ScaleId, Text, DocumentedCall)] -> [CallBindings]
- type Document = [Section]
- type Section = (CallKind, [ScopeDoc])
- type CallKind = Text
- type ScopeDoc = (ScopeSource, [CallBindings])
- type ScopeSource = Maybe.Maybe CallPriority
- type CallBindings = ([Binding], CallType, CallDoc)
- type Binding = (SymbolName, CallName)
- type SymbolName = Text
- data CallType
- filter_calls :: (SymbolName -> CallName -> Bool) -> Document -> Document
- strip_empty :: Document -> Document
- builtins :: Builtins -> [Section]
- convert_modules :: CallType -> (call -> DocumentedCall) -> Map mod (CallMap call) -> [ScopeDoc]
- scope :: Map Module.Module (CallMap (Call gen)) -> Map Module.Module (CallMap (Call trans)) -> Map Module.Module (CallMap (TrackCall track)) -> [ScopeDoc]
- type Entry = Library.Entry DocumentedCall
- type CallMap = CallMap DocumentedCall
- entry_doc :: (call -> DocumentedCall) -> Library.Entry call -> Entry
- call_map_doc :: (call -> DocumentedCall) -> CallMap call -> CallMap
- instrument_calls :: InstrumentCalls -> Document
- track :: Cmd.M m => BlockId -> TrackId -> m Document
- track_sections :: ParseTitle.Type -> Scopes -> [Section]
- convert_scope :: (CallMap call -> CallMap) -> ScopePriority call -> ScopePriority DocumentedCall
- merged_scope_docs :: [(CallType, ScopePriority DocumentedCall)] -> [ScopeDoc]
- merge_scope_docs :: [ScopeDoc] -> [ScopeDoc]
- sort_calls :: [CallBindings] -> [CallBindings]
- imported_scope_doc :: CallType -> [Entry] -> [ScopeDoc]
- scope_type :: CallType -> ScopePriority DocumentedCall -> [ScopeDoc]
- call_map_to_entries :: CallMap -> [Entry]
- entries :: CallType -> [Entry] -> [CallBindings]
output
call_bindings_text :: Bool -> CallBindings -> Format.Doc Source #
environ_keys :: ArgName -> EnvironDefault -> Text Source #
write_doc :: Doc.Doc -> Format.Doc Source #
show_module :: Module.Module -> Text Source #
:: 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
call_bindings_html :: Html.HtmlState -> Text -> CallBindings -> Html.Html Source #
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
type Scale = [CallBindings] Source #
scales_html :: Html.HtmlState -> [CallBindings] -> Html.Html Source #
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 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 Binding = (SymbolName, CallName) Source #
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.
strip_empty :: Document -> Document Source #
builtins :: Builtins -> [Section] Source #
Extract all the documentation from the Builtins. 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.
convert_modules :: CallType -> (call -> DocumentedCall) -> Map mod (CallMap call) -> [ScopeDoc] Source #
scope :: Map Module.Module (CallMap (Call gen)) -> Map Module.Module (CallMap (Call trans)) -> Map Module.Module (CallMap (TrackCall track)) -> [ScopeDoc] Source #
Create docs for generator, transformer, and track calls, and merge and sort them.
type Entry = Library.Entry DocumentedCall Source #
A Library.Entry
with the call stripped out and replaced with
just documentation. This is so Call
s and ValCall
s can
be treated uniformly.
type CallMap = CallMap DocumentedCall Source #
entry_doc :: (call -> DocumentedCall) -> Library.Entry call -> Entry Source #
Convert Library.Entry
to Entry
by stripping out the code part of the
call, and replacing it with DocumentedCall.
call_map_doc :: (call -> DocumentedCall) -> CallMap call -> CallMap Source #
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 #
convert_scope :: (CallMap call -> CallMap) -> ScopePriority call -> ScopePriority DocumentedCall Source #
merged_scope_docs :: [(CallType, ScopePriority DocumentedCall)] -> [ScopeDoc] Source #
Create docs for generator and transformer calls, and merge and sort them.
merge_scope_docs :: [ScopeDoc] -> [ScopeDoc] Source #
sort_calls :: [CallBindings] -> [CallBindings] Source #
imported_scope_doc :: CallType -> [Entry] -> [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.
scope_type :: CallType -> ScopePriority DocumentedCall -> [ScopeDoc] Source #
call_map_to_entries :: CallMap -> [Entry] Source #