Commit ee5239bd authored by PONCELET's avatar PONCELET

update asciidoctor generator, converging to GFAST

parent 3e33f07e
This diff is collapsed.
......@@ -99,12 +99,12 @@ public class AsciiDoctorGenerator {
// Write group comments
writeLine(group.getComment(),context.globalOutput);
writeLine("include::"+computeAdocName(group)+"[]",context.globalOutput);
writeLine("|===",context.globalOutput);
startTable(context);
writeAttributes(group.getAttributes(), context);
writeTypes(group.getTypes(), context);
writeDimensions( group.getDims(), context);
writeCoordinateVariables( group.getCoordinateVariables(), context);
writeVariables( group.getVariables(), context);
endTable(context);
}
......@@ -132,9 +132,6 @@ public class AsciiDoctorGenerator {
for(Dimension v:dims)
{
String value = v.getName();
value+=":";
value+=v.getName();
writeTableLine(value, v.getObligation(), v.getComment(), context);
}
creturn(context.currentOutput);
......@@ -154,9 +151,14 @@ public class AsciiDoctorGenerator {
}
}
private void writeVariables(List<Variable> variables, Context context) throws IOException {
private void writeCoordinateVariables(List<Variable> variables, Context context) throws IOException {
if(variables==null || variables.isEmpty())
return;
reallyWriteVariable("Coordinate variables", variables, context);
}
private void reallyWriteVariable(String header,List<Variable> variables, Context context) throws IOException {
writeSubHeader( "Variables", context);
writeSubHeader( header, context);
boolean first=true;
for(Variable v:variables)
{
......@@ -185,6 +187,10 @@ public class AsciiDoctorGenerator {
}
creturn(context.currentOutput);
}
private void writeVariables(List<Variable> variables, Context context) throws IOException {
reallyWriteVariable("Variables", variables, context);
}
private void writeVariableAttributes( List<Attribute> attributes, Context context) throws IOException {
for(Attribute v:attributes)
{
......@@ -209,7 +215,9 @@ public class AsciiDoctorGenerator {
{
//on utilise des espace insécables pour se conformer à la doc WCFAST
value+="\u00A0=\u00A0";
value+=v.getValue();
//remove hyphen minus U002D sign with minus sign U2212
value+=v.getValue().replaceAll("\u002D", "\u2212").replaceAll(".0f", ".0");
}
}
......
......@@ -17,6 +17,7 @@ public class GGroupAdapter implements JsonSerializer<Group> {
object.add("types", context.serialize(value.types));
object.add("attributes", context.serialize(value.attributes));
object.add("variables", context.serialize(value.variables));
object.add("coordinatevariables", context.serialize(value.coordinatevariables));
object.add("subGroups", context.serialize(value.subGroups));
return object;
......
......@@ -9,6 +9,7 @@ public class Group extends Base{
List<Type> types = new ArrayList<>();
List<Dimension> dims = new ArrayList<>();
List<Variable> variables = new ArrayList<>();
List<Variable> coordinatevariables = new ArrayList<>();
protected List<Group> subGroups = new ArrayList<>();
......@@ -31,7 +32,9 @@ public class Group extends Base{
public List<Variable> getVariables() {
return variables;
}
public List<Variable> getCoordinateVariables() {
return coordinatevariables;
}
public List<Group> getSubGroups() {
return subGroups;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment