/** * Writes out the "default" CSS stylesheet specified via {@link #readBuiltinInlineCSSProperties()}, * saving the results to the given {@link OutputStream}. */ public static void writeDefaultStylesheet(OutputStream cssOutputStream) { writeStylesheet(readBuiltinInlineCSSProperties(), cssOutputStream); }
private Properties getCurrentInlineCSSProperties() { if (currentInlineCSSProperties==null) { currentInlineCSSProperties = CSSUtilities.readInlineCSSProperties(options); } return currentInlineCSSProperties; }
Element style = document.createElementNS(W3CConstants.XHTML_NAMESPACE, "style"); style.setAttribute("type", "text/css"); Properties cssProperties = CSSUtilities.readInlineCSSProperties(options); style.appendChild(document.createTextNode(CSSUtilities.writeStylesheet(cssProperties))); head.appendChild(style);
/** * Writes out the CSS stylesheet made from the given <strong>cssProperties</strong>, * saving the results to the given {@link OutputStream}. */ public static void writeStylesheet(Properties cssProperties, OutputStream cssOutputStream) { writeStylesheet(cssProperties, new OutputStreamWriter(cssOutputStream)); }
/** * Main method is used by the build process to write out the default CSS stylesheet. * * @param args Array containing 1 argument: the File that the default CSS should be written to. * Any parent directories will be created as required. * * @throws FileNotFoundException */ public static void main(String[] args) throws IOException { if (args.length!=1) { System.err.println("Usage: specify a File that the default SnuggleTeX CSS will be written to"); System.exit(1); } File outputFile = new File(args[0]); IOUtilities.ensureFileCreated(outputFile); writeDefaultStylesheet(new FileOutputStream(outputFile)); } }
/** * Reads in the custom CSS {@link Properties} Object specified by the given * {@link DOMOutputOptions}. If nothing has been supplied, then it reads in the * default CSS Properties via {@link #readBuiltinInlineCSSProperties()} as a fallback. */ public static Properties readInlineCSSProperties(DOMOutputOptions options) { Properties properties = options.getInlineCSSProperties(); if (properties==null) { properties = readBuiltinInlineCSSProperties(); } return properties; }
Element style = document.createElementNS(W3CConstants.XHTML_NAMESPACE, "style"); style.setAttribute("type", "text/css"); Properties cssProperties = CSSUtilities.readInlineCSSProperties(options); style.appendChild(document.createTextNode(CSSUtilities.writeStylesheet(cssProperties))); head.appendChild(style);
/** * Writes out the CSS stylesheet made from the given <strong>cssProperties</strong>, * saving the results to the given {@link OutputStream}. */ public static void writeStylesheet(Properties cssProperties, OutputStream cssOutputStream) { writeStylesheet(cssProperties, new OutputStreamWriter(cssOutputStream)); }
/** * Main method is used by the build process to write out the default CSS stylesheet. * * @param args Array containing 1 argument: the File that the default CSS should be written to. * Any parent directories will be created as required. * * @throws FileNotFoundException */ public static void main(String[] args) throws IOException { if (args.length!=1) { System.err.println("Usage: specify a File that the default SnuggleTeX CSS will be written to"); System.exit(1); } File outputFile = new File(args[0]); IOUtilities.ensureFileCreated(outputFile); writeDefaultStylesheet(new FileOutputStream(outputFile)); } }
/** * Reads in the custom CSS {@link Properties} Object specified by the given * {@link DOMOutputOptions}. If nothing has been supplied, then it reads in the * default CSS Properties via {@link #readBuiltinInlineCSSProperties()} as a fallback. */ public static Properties readInlineCSSProperties(DOMOutputOptions options) { Properties properties = options.getInlineCSSProperties(); if (properties==null) { properties = readBuiltinInlineCSSProperties(); } return properties; }
/** * Writes out the "default" CSS stylesheet specified via {@link #readBuiltinInlineCSSProperties()}, * returning the result as a String. */ public static String writeDefaultStylesheet() { return writeStylesheet(readBuiltinInlineCSSProperties()); }
Element style = createXHTMLElement(document, "style"); style.setAttribute("type", "text/css"); Properties cssProperties = CSSUtilities.readInlineCSSProperties(options); style.appendChild(document.createTextNode(CSSUtilities.writeStylesheet(cssProperties))); head.appendChild(style);
/** * Writes out the CSS stylesheet made from the given <strong>cssProperties</strong>, returning * the result as a String. */ public static String writeStylesheet(Properties cssProperties) { StringWriter resultWriter = new StringWriter(); writeStylesheet(cssProperties, resultWriter); return resultWriter.toString(); }
private Properties getCurrentInlineCSSProperties() { if (currentInlineCSSProperties==null) { currentInlineCSSProperties = CSSUtilities.readInlineCSSProperties(options); } return currentInlineCSSProperties; }
/** * Main method is used by the build process to write out the default CSS stylesheet. * * @param args Array containing 1 argument: the File that the default CSS should be written to. * Any parent directories will be created as required. * * @throws FileNotFoundException */ public static void main(String[] args) throws IOException { if (args.length!=1) { System.err.println("Usage: specify a File that the default SnuggleTeX CSS will be written to"); System.exit(1); } File outputFile = new File(args[0]); IOUtilities.ensureFileCreated(outputFile); writeDefaultStylesheet(new FileOutputStream(outputFile)); } }
/** * Reads in the custom CSS {@link Properties} Object specified by the given * {@link DOMOutputOptions}. If nothing has been supplied, then it reads in the * default CSS Properties via {@link #readBuiltinInlineCSSProperties()} as a fallback. */ public static Properties readInlineCSSProperties(DOMOutputOptions options) { Properties properties = options.getInlineCSSProperties(); if (properties==null) { properties = readBuiltinInlineCSSProperties(); } return properties; }
/** * Writes out the "default" CSS stylesheet specified via {@link #readBuiltinInlineCSSProperties()}, * returning the result as a String. */ public static String writeDefaultStylesheet() { return writeStylesheet(readBuiltinInlineCSSProperties()); }
/** * Writes out the CSS stylesheet made from the given <strong>cssProperties</strong>, returning * the result as a String. */ public static String writeStylesheet(Properties cssProperties) { StringWriter resultWriter = new StringWriter(); writeStylesheet(cssProperties, resultWriter); return resultWriter.toString(); }
private Properties getCurrentInlineCSSProperties() { if (currentInlineCSSProperties==null) { currentInlineCSSProperties = CSSUtilities.readInlineCSSProperties(options); } return currentInlineCSSProperties; }
String defaultCSS = CSSUtilities.writeDefaultStylesheet(); NodeList list = document.getElementsByTagName("head"); if (list.getLength() == 0)