go-editorjs-parser

command module
v0.0.0-...-30259db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 6 Imported by: 0

README




EditorJS Tool for Editor.js

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

     

Full Documentation

     

LICENSE

MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
parser
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL