Giter Site home page Giter Site logo

queshaw / flexmark-java-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vsch/flexmark-java-sample

0.0 1.0 0.0 10 KB

Sample application using flexmark-java - https://github.com/vsch/flexmark-java for Markdown to HTML conversion

License: BSD 2-Clause "Simplified" License

HTML 0.71% Java 99.29%

flexmark-java-sample's Introduction

Sample flexmark-java application

Simple use of flexmark-java to convert Markdown to HTML with options settings compatible with Markdown Navigator parser options.

Options

Two parameters control the option configuration: ForUseBy enum allows selecting the following Markdown Navigator context:

  • PARSER equivalent to parsing for generating PsiTree and syntax highlighting
  • JAVAFX equivalent to generating HTML for JavaFX WebView browser
  • SWING equivalent to generating HTML for Swing browser
  • HTML equivalent to generating the HTML plain HTML text

The other parameter is a set of options that emulate Markdown Navigator parser settings, with defaults set to mimick GFM Document compatibility.

Nothing is stopping you from modifying the MutableDataSet returned by the static options() method to customize the options to your requirements.

HTML Rendering and Link Resolution

Keep in mind that Markdown Navigator provides custom link resolver to convert document relative and site absolute links to actual files. This is not available outside of the plugin and if desired must be implemented according to your project requirements via a flexmark-java extension.

Similarly none of the style sheets, java scripts or other necessary HTML document elements are generated. These are left to the discretion of the user. This can be accomplished by wrapping the rendered HTML with desired text or through a flexmark-java extension implementing a PhasedNodeRenderer which will generate the necessary HTML for different parts of the HTML document.

Emoji Shortcuts

Emoji shortcut rendering requires emoji-cheat-sheet.com image file location to be provided for emoji image URL generation. If the directory is not set then emoji shortcuts will be converted to GitHub emoji URLs for testing purposes.

Tables

By default parsing allows more flexible table parsing than allowed by GFM but for rendering purposes options are set to emulate GFM table parsing.

flexmark-java-sample's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.