Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A symfony bundle to parse data generated by EditorJS

License

NotificationsYou must be signed in to change notification settings

SyntaxPhoenix/editorjs-symfony-parser-bundle

Repository files navigation

ContributorsStargazersIssuesGPLv3 License


Logo

EditorJS Symfony Parser Bundle

Table of Contents

  1. About The Project
  2. Usage
  3. Roadmap
  4. Contributing
  5. License
  6. Contact

About The Project

The EditorJS-ParserBundle parses editorjs-configsEditor.js. It is designed to be best integrated in Symfony and also offers a Twig-Extension. The bundle is based onDurlecode/editorjs-simple-html-parser, but strongly improved the parsing by using an object-oriented approach.

Built With

Usage

useSyntaxPhoenix\EJSParserBundle\Parser\EditorjsParser;$parser =newEditorjsParser($data);$html =$parser->toHtml();

Where$data is the clean JSON data coming from Editor.jsSee$data example below

{"time" :1583848289745,"blocks" : [        {"type" :"header","data" : {"text" :"Hello World","level" :2            }        }    ],"version" :"2.16.1"}

Installation

composer require syntaxphoenix/editorjs-symfony-parser-bundle

Supported Plugins

PackageKeyMain CSS Class
@editorjs/codecode.prs-code
@editorjs/embedembed.prs-embed
@editorjs/delimiterdelimiter.prs-delimiter
@editorjs/headerheader.prs-h{header-level}
@editorjs/linklink.prs-link
@editorjs/listlist.prs-list
@editorjs/paragraphparagraph.prs-paragraph
@editorjs/rawraw
@editorjs/simple-imagesimpleImage.prs-image
@editorjs/imageimage.prs-image
@editorjs/warningwarning.prs-warning
@editorjs/tabletable.prs-table
editorjs-alertalert.prs-alert +.prs-alert-{type}
editorjs-youtube-embedyoutubeembed.prs-youtubeembed

If you want to add a new Parser for a specific editorjs-plugin you can fork the master and make a pull-request. Please also change the readme in that case and add the parser you have edited.

Methods

toHtml()

Return generated HTML

Generated HTML

Code
<divclass="prs-code"><pre><code></code></pre></div>
Embed
(Actually working with Youtube, Codepen & Gfycat)
<divclass="prs-embed"><iframesrc=""height="300"></iframe></div>
Delimiter
<hrclass="prs-delimiter">
Header
<h2class="prs-h2">Lorem</h2>
Link
<ahref="https://github.com/"target="_blank"class="prs-link"><divclass="prs-link-container-with-img"><divclass="prs-link-title">Title</div><divclass="prs-link-description">Description</div><divclass="prs-link-url">https://example.com/</div></div><divclass="prs-link-img-container"><imgsrc="https://example.com/cat.png"alt=""></div></a>
Ordered List
<divclass="prs-list"><ol><li></li></ol></div>
Unordered List
<divclass="prs-list"><ul><li></li></ul></div>
Paragraph
<pclass="prs-paragraph"><codeclass="inline-code">Pellentesque</code><i>malesuada fames</i><markclass="cdx-marker">tempus</mark></p>
Image
<figureclass="prs-image"><imgsrc=""class="prs-image-border prs-image-background"alt=""><figcaption></figcaption></figure>
Warning
<divclass="prs-warning"><ion-iconname="information-outline"size="large"aria-label="information outline"></ion-icon><div><p>Title</p><p>Message</p></div></div>
Raw
<divclass="prs-raw">    Raw HTML ...</div>
Alert
<divclass="prs-alert prs-alert-{type}"><div>My Text</div></div>

Roadmap

See theopen issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make aregreatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GPLv3 License. SeeLICENSE for more information.

Contact

@SyntaxPhoenix -support@syntaxphoenix.com

Project Link:https://github.com/SyntaxPhoenix/editorjs-symfony-parser-bundle

About

A symfony bundle to parse data generated by EditorJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp