This package is as an extension of the Elm Actor Framework Package.
Turn your markdown templates into Html or any other output enriched by your Actors.
import Framework.Template.Markdown exposing (MarkdownTemplate, blank, parse)
type Actors
= Editor
| Layout
| Counter
components : Components Actors
components =
Components.fromList
[ Component.make
{ actor = Counter
, nodeName = "counter-component"
}
, Component.make
{ actor = Counter
, nodeName = "COUNTER"
}
]
template : String
template =
"""
## A Markdown Example
Lorem **ipsum** dolor sit *amet* ...
- [x] list item
- [ ] more dummy content
---
Render an actor here!
<counter-component steps="10" value="10" ></counter-component>
And another one:
<!COUNTER 100:25 >
"""
markdownTemplate : MarkdownTemplate Actors
markdownTemplate =
parse components template
|> Result.withDefault blank
- tables
Actors make up ideal components that can be used on a template.
This module uses a shared type from the Elm Actor Framework -Templates
package.
The goal of these packages is to be able to provide different parsers and renderers.
- Elm Actor Framework - Templates
- Elm Actor Framework - Templates - Html
- Demo
- Parse Html Template (Using
hecrj/html-parser
) - Render Html (Using
elm/html
)
- Elm Actor Framework - Templates - Markdown
- Demo
- Parse Markdown (Using dillonkearns/elm-markdown)