Package org.rendersnake.site

Source Code of org.rendersnake.site.SyntaxHighlightingWrapper

package org.rendersnake.site;

import static org.rendersnake.HtmlAttributesFactory.type;

import java.io.IOException;

import org.rendersnake.HtmlCanvas;
import org.rendersnake.Renderable;
import org.rendersnake.RenderableWrapper;
import org.rendersnake.site.components.SyntaxHighlighterLibary;

public class SyntaxHighlightingWrapper extends RenderableWrapper {

    public SyntaxHighlightingWrapper(Renderable component) {
        super(component);
    }

    @Override
    public void renderOn(HtmlCanvas html) throws IOException {
        html.render(new SyntaxHighlighterLibary());
        html.render(this.component);
        // highlight all examples
        html.script(type("text/javascript")).write("SyntaxHighlighter.all();",false)._script();
    }
}
TOP

Related Classes of org.rendersnake.site.SyntaxHighlightingWrapper

TOP
Copyright © 2018 www.massapi.com. 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.