Package org.jbake.parser

Examples of org.jbake.parser.MarkupEngine


                contentPath,
                hasHeader,
                content
        );

        MarkupEngine engine = Engines.get(FileUtil.fileExt(file));
        if (engine==null) {
            LOGGER.error("Unable to find suitable markup engine for {}",file);
            return null;
        }

        if (hasHeader) {
            // read header from file
            processHeader(fileContents, content);
        }
        // then read engine specific headers
        engine.processHeader(context);
       
        if (config.getString(Keys.DEFAULT_STATUS) != null) {
          // default status has been set
          if (content.get("status") == null) {
            // file hasn't got status so use default
            content.put("status", config.getString(Keys.DEFAULT_STATUS));
          }
        }

        if (content.get("type")==null||content.get("status")==null) {
            // output error
            LOGGER.error("Error parsing meta data from header!");
            return null;
        }

        // generate default body
        processBody(fileContents, content);

        // eventually process body using specific engine
        if (engine.validate(context)) {
            engine.processBody(context);
        } else {
            LOGGER.error("Incomplete source file ({}) for markup engine:", file, engine.getClass().getSimpleName());
            return null;
        }

        return content;
    }
View Full Code Here

TOP

Related Classes of org.jbake.parser.MarkupEngine

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.