001/*
002 * JDrupes MDoclet
003 * Copyright (C) 2017  Michael N. Lipp
004 * 
005 * This program is free software; you can redistribute it and/or modify it 
006 * under the terms of the GNU General Public License as published by 
007 * the Free Software Foundation; either version 3 of the License, or 
008 * (at your option) any later version.
009 * 
010 * This program is distributed in the hope that it will be useful, but 
011 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
012 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
013 * for more details.
014 * 
015 * You should have received a copy of the GNU General Public License along 
016 * with this program; if not, see <http://www.gnu.org/licenses/>.
017 */
018package org.jdrupes.mdoclet;
019
020import javax.tools.OptionChecker;
021
022/**
023 * Provides the interface to the Markdown processor.
024 */
025public interface MarkdownProcessor extends OptionChecker {
026
027        final String INTERNAL_OPT_DISABLE_AUTO_HIGHLIGHT
028                = "_disable-auto-highlight_";
029        
030        /**
031         * Starts the processor with the given options.
032         * 
033         * All processors should support the special option `_disable-auto-highlight_`.
034         * The doclet maps its option `-disable-auto-highlight` to this special
035         * processor option because disabling the auto highlight feature is usually
036         * implemented by configuring the processors HTML renderer in some way.
037         *  
038         * @param options an array of options; each entry consists of an array that has
039         * the option name as first entry and any parameters for that option as subsequent
040         * entries
041         */
042        void start (String[][] options);
043        
044        /**
045         * Converts the given markdown test to HTML.
046         * 
047         * @param markdown the markdoen text
048         * @return the HTML
049         */
050        String toHtml(String markdown);
051
052}