Java Code Examples for org.asciidoctor.extension.PreprocessorReader#restoreLines()
The following examples show how to use
org.asciidoctor.extension.PreprocessorReader#restoreLines() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommentPreprocessor.java From asciidoctorj with Apache License 2.0 | 6 votes |
@Override public void process(Document document, PreprocessorReader reader) { List<String> lines = reader.readLines(); // <2> List<String> newLines = new ArrayList<String>(); boolean inComment = false; for (String line: lines) { // <3> if (line.trim().equals("////")) { if (!inComment) { newLines.add("[NOTE]"); } newLines.add("--"); inComment = !inComment; } else { newLines.add(line); } } reader.restoreLines(newLines); // <4> }
Example 2
Source File: IncludePreprocessor.java From helidon-build-tools with Apache License 2.0 | 4 votes |
private static List<String> readAndClearReader(PreprocessorReader reader) { List<String> result = reader.readLines(); reader.restoreLines(Collections.emptyList()); return result; }