A Golang library which converts Editor.js JSON output to pure Markdown or HTML.
Usage
Is it possible to import in a project
import (
"gitlab.com/rodrigoodhin/go-editorjs-parser/pkg/html"
"gitlab.com/rodrigoodhin/go-editorjs-parser/pkg/markdown"
)
func main() {
// Parse a EditorJS JSOn file to HTML file
html.Sample("YOUR/EDITORJS/OUTPUT/FILE.json", "YOUR/OUTPUT/FILE.html")
html.Bootstrap("YOUR/EDITORJS/OUTPUT/FILE.json", "YOUR/OUTPUT/FILE.html")
html.Bulma("YOUR/EDITORJS/OUTPUT/FILE.json", "YOUR/OUTPUT/FILE.html")
html.Custom("YOUR/EDITORJS/OUTPUT/FILE.json", "YOUR/OUTPUT/FILE.html", "YOUR/STYLE/FILE.json")
// Parse a EditorJS JSOn file to MARKDOWN file
markdown.Parser("YOUR/EDITORJS/OUTPUT/FILE.json", "YOUR/OUTPUT/FILE.md")
}
or you can build and execute
go build goEditorjsParser.go
Usage of goEditorjsParser
./goEditorjsParser -j <JSONFilePath> -s <StylePath> -o <OutputFilePath> -t <OutputFileType>
-j = Path to a JSON file. MANDATORY
-s = Style CSS to be used. If not set, the sample style will be used. Possible values: "sample", "bootstrap", "bulma" or "PATH/TO/YOUR/CUSTOM/STYLE/MAP"
-o = Output file path. If not set, root path will be used
-t = Output file type. Possible values: markdown or html
Example:
./goEditorjsParser -j Input.json
./goEditorjsParser -j Input.json -s bulma
./goEditorjsParser -j Input.json -s bootstrap -o output/
./goEditorjsParser -j Input.json -s sample -o output/ -t html
./goEditorjsParser -j Input.json -o output/ -t markdown
LICENSE
MIT License