You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
loadFile doesn't generate complete document, only first paragraph will be processed.
Reading from string (line based reading of a file done before) does work.
The project is maven based and is using version 1.5.4 of asciidoctorj.
// Example of reading via loadFile
Map<String,Object> attributes = new HashMap<String, Object>();
attributes.put("stylesdir", "adocs/css");
attributes.put("stylesheet", "asciidoctor.css");
Map<String, Object> options = new HashMap<String, Object>();
options.put("attributes", attributes);
options.put("in_place", true);
options.put("header", true);
options.put("footer", true);
options.put("safe", 0);
loadFile doesn't generate complete document, only first paragraph will be processed.
Reading from string (line based reading of a file done before) does work.
The project is maven based and is using version 1.5.4 of asciidoctorj.
// Example of reading via loadFile
Map<String,Object> attributes = new HashMap<String, Object>();
attributes.put("stylesdir", "adocs/css");
attributes.put("stylesheet", "asciidoctor.css");
Map<String, Object> options = new HashMap<String, Object>();
options.put("attributes", attributes);
options.put("in_place", true);
options.put("header", true);
options.put("footer", true);
options.put("safe", 0);
Document document = asciidoctor.loadFile(file, options);
// Example for asciidoctor.load:
Map<String,Object> attributes = new HashMap<String, Object>();
attributes.put("stylesdir", "adocs/css");
attributes.put("stylesheet", "asciidoctor.css");
Map<String, Object> options = new HashMap<String, Object>();
options.put("attributes", attributes);
options.put("in_place", true);
options.put("header", true);
options.put("footer", true);
options.put("safe", 0);
String lines = "";
String tmpString = "";
if (file.canRead())
{
System.out.println("File: " + file + " is readable");
try {
FileReader fileReader = new FileReader(file);
BufferedReader bufferedReader = new BufferedReader(fileReader);
while( (tmpString = bufferedReader.readLine()) != null )
{
lines = lines + "\n" + tmpString;
}
bufferedReader.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Document document = asciidoctor.load(lines, options);
System.out.println("content: " + document.convert());
The text was updated successfully, but these errors were encountered: