Module
Text.Markdown.SlamDown.Halogen.Component
- Package
- purescript-markdown-halogen
- Repository
- slamdata/purescript-markdown-halogen
This module defines a component for rendering SlamDown documents to HTML
#SlamDownMessage Source
data SlamDownMessage vConstructors
#defaultBrowserFeatures Source
defaultBrowserFeatures :: BrowserFeaturesBy default, no features are enabled.
#evalSlamDownQuery Source
evalSlamDownQuery :: forall v m. Value v => (SlamDownQuery v) ~> (ComponentDSL (SlamDownState v) (SlamDownQuery v) (SlamDownMessage v) m)#SlamDownConfig Source
type SlamDownConfig = { browserFeatures :: BrowserFeatures, formName :: String }#renderSlamDown Source
renderSlamDown :: forall v. Value v => SlamDownConfig -> SlamDownState v -> ComponentHTML (SlamDownQuery v)Render a SlamDown document into an HTML form.
#slamDownComponent Source
slamDownComponent :: forall v m. Value v => SlamDownConfig -> Component HTML (SlamDownQuery v) Unit (SlamDownMessage v) mBundles up the SlamDown renderer and state machine into a Halogen component.
Re-exports from Text.Markdown.SlamDown.Halogen.Component.Query
#SlamDownQuery Source
data SlamDownQuery v aConstructors
ChangeTextBox String (TextBox Maybe) aChangeCheckBox String v Boolean aChangeRadioButton String v aChangeDropDown String (Maybe v) aSetDocument (SlamDownP v) aGetFormState (SlamDownFormState v -> a)PopulateForm (SlamDownFormState v) a
Instances
Functor (SlamDownQuery v)(Arbitrary v, Coarbitrary v, Arbitrary a, Eq v) => Arbitrary (SlamDownQuery v a)
Re-exports from Text.Markdown.SlamDown.Halogen.Component.State
#SlamDownStateR Source
type SlamDownStateR a = { document :: SlamDownP a, formState :: SlamDownFormState a }#SlamDownState Source
newtype SlamDownState aThe state of a SlamDown form
Constructors
Instances
Functor SlamDownState(Show a) => Show (SlamDownState a)(Arbitrary a, Ord a) => Arbitrary (SlamDownState a)
#SlamDownFormState Source
type SlamDownFormState a = StrMap (FormFieldValue a)#SlamDownFormDesc Source
type SlamDownFormDesc a = StrMap (FormField a)#FormFieldValue Source
type FormFieldValue = FormFieldP Identity#syncState Source
syncState :: forall v. Value v => SlamDownP v -> SlamDownFormState v -> SlamDownState v#replaceDocument Source
replaceDocument :: forall v. Value v => SlamDownP v -> SlamDownState v -> SlamDownState v#modifyFormState Source
modifyFormState :: forall a. (SlamDownFormState a -> SlamDownFormState a) -> SlamDownState a -> SlamDownState a#getFormFieldValue Source
getFormFieldValue :: forall v. String -> SlamDownState v -> Maybe (FormFieldValue v)Gets the form field value, or the default if none is present.
#formFieldGetDefaultValue Source
formFieldGetDefaultValue :: forall v. FormField v -> Maybe (FormFieldValue v)#emptySlamDownState Source
emptySlamDownState :: forall v. SlamDownState vThe initial empty state of the form, with an empty document.