Package org.markdown4j

Examples of org.markdown4j.Markdown4jProcessor


  }

  public void RefreshPreviewField() {
    String mdText = jTextArea1.getText();
    try {
      String body = new Markdown4jProcessor().process(mdText);
      markdownPane1.setText(body);
      htmlView.SetHtmlContent(markdownPane1.getText());
    }
    catch (IOException ex) {
      Logger.getLogger(MainForm.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here


    }

    private ModelAndView renderMarkdown(final String documentName) throws IOException {
        ModelAndView mav = new ModelAndView("/developer/public/partials/user-manual");
        String release = env.get("release");
        Markdown4jProcessor processor = new Markdown4jProcessor();
        final String userManualsLocation = env.get("userManuals.location");
        String documentLocation = context.getRealPath("/doc/") + "/" + documentName + ".md";
        if (userManualsLocation!=null)
            documentLocation = userManualsLocation + documentName + ".md";
        String manual = processor.process(new File(documentLocation));
        manual = manual.replaceAll("\\$\\{homeBaseUrl\\}", env.get("homeBaseUrl"));
        mav.addObject("manual", manual);
        mav.addObject("release", release);
        return mav;
    }
View Full Code Here

    @Override
    public String parseMarkdown(InputStream markdownStream) throws ServiceException {
        try {
            // convert MD to HTML
            LOGGER.debug("Converting markdown InputStream to String");
            return new Markdown4jProcessor().process(markdownStream);

        } catch (IOException e) {
            throw new ServiceException("Error parsing markdown stream", e);
        }
    }
View Full Code Here

*/
public class Markdown2HtmlConverter  implements Converter<String, String> {
    @Override
    public String convert(String input) throws ConversionException {
        try {
            return new Markdown4jProcessor().process(input).trim();
        } catch (IOException e) {
            throw ConversionException.HTML_TO_PDF_EXCEPTION;
        }
    }
View Full Code Here

     * @return
     * @throws IOException
     */
    private Response parseMarkdown(UriInfo uriInfo, File file) throws IOException {
        return Response.ok().entity(
                parseHtml(uriInfo, toList(new Markdown4jProcessor().process(file))))
                .type(MediaType.TEXT_HTML_TYPE)
                .build();
    }
View Full Code Here

TOP

Related Classes of org.markdown4j.Markdown4jProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.