HHH-18654 - Change setting docs to use an asciidoc section per setting
This commit is contained in:
parent
c9621aa9e2
commit
cbdbb273bf
|
@ -68,9 +68,7 @@ public class AsciiDocWriter {
|
|||
for ( SettingDescriptor settingDescriptor : sectionSettingDescriptors ) {
|
||||
// write an anchor in the form `[[{anchorNameBase}-{settingName}]]`
|
||||
tryToWriteLine( writer, "[[", anchorNameBase, "-", settingDescriptor.getName(), "]]" );
|
||||
|
||||
writeSettingName( settingDescriptor, writer );
|
||||
writer.write( "::\n" );
|
||||
tryToWriteLine( writer, "==== ", settingName( settingDescriptor ) );
|
||||
|
||||
writeMetadata( settingDescriptor, writer );
|
||||
|
||||
|
@ -88,7 +86,6 @@ public class AsciiDocWriter {
|
|||
return;
|
||||
}
|
||||
|
||||
writer.write( "+\n" );
|
||||
writer.write( "****\n" );
|
||||
|
||||
writer.write(
|
||||
|
@ -125,27 +122,24 @@ public class AsciiDocWriter {
|
|||
writer.write( settingDescriptor.getApiNote() + "\n\n" );
|
||||
}
|
||||
|
||||
writer.write( "****\n+\n" );
|
||||
writer.write( "****\n\n" );
|
||||
}
|
||||
|
||||
private static void writeSettingName(SettingDescriptor settingDescriptor, FileWriter writer) throws IOException {
|
||||
writer.write( "`" );
|
||||
private static String settingName(SettingDescriptor settingDescriptor) {
|
||||
if ( settingDescriptor.getLifecycleDetails().isDeprecated() ) {
|
||||
writer.write( "[.line-through]#" );
|
||||
return String.format(
|
||||
Locale.ROOT,
|
||||
"`[.line-through]#%s#`",
|
||||
settingDescriptor.getName()
|
||||
);
|
||||
}
|
||||
else {
|
||||
writer.write( '*' );
|
||||
return String.format(
|
||||
Locale.ROOT,
|
||||
"`%s`",
|
||||
settingDescriptor.getName()
|
||||
);
|
||||
}
|
||||
|
||||
writer.write( settingDescriptor.getName() );
|
||||
|
||||
if ( settingDescriptor.getLifecycleDetails().isDeprecated() ) {
|
||||
writer.write( '#' );
|
||||
}
|
||||
else {
|
||||
writer.write( '*' );
|
||||
}
|
||||
writer.write( '`' );
|
||||
}
|
||||
|
||||
private static void tryToWriteLine(Writer writer, String prefix, String value, String... other) {
|
||||
|
|
|
@ -93,9 +93,6 @@ class DomToAsciidocConverter {
|
|||
}
|
||||
|
||||
private void visitDiv(Element div) {
|
||||
if ( converted.length() != 0 ) {
|
||||
converted.append( "\n+\n" );
|
||||
}
|
||||
for ( Node childNode : div.childNodes() ) {
|
||||
visitNode( childNode );
|
||||
}
|
||||
|
@ -129,7 +126,6 @@ class DomToAsciidocConverter {
|
|||
if ( converted.lastIndexOf( "\n" ) != converted.length() - 1 ) {
|
||||
converted.append( '\n' );
|
||||
}
|
||||
converted.append( "+\n" );
|
||||
for ( Node childNode : ul.childNodes() ) {
|
||||
visitNode( childNode );
|
||||
}
|
||||
|
|
|
@ -195,12 +195,9 @@ public class JavadocToAsciidocConverter {
|
|||
}
|
||||
|
||||
private void visitDiv(Element div) {
|
||||
if ( converted.length() != 0 ) {
|
||||
converted.append( "\n+\n" );
|
||||
}
|
||||
boolean deprecation = div.hasClass( "deprecationBlock" );
|
||||
if ( deprecation ) {
|
||||
converted.append( "+\n[WARNING]\n====\n" );
|
||||
converted.append( "[WARNING]\n====\n" );
|
||||
}
|
||||
for ( Node childNode : div.childNodes() ) {
|
||||
visitNode( childNode );
|
||||
|
@ -238,7 +235,6 @@ public class JavadocToAsciidocConverter {
|
|||
if ( converted.lastIndexOf( "\n" ) != converted.length() - 1 ) {
|
||||
converted.append( '\n' );
|
||||
}
|
||||
converted.append( "+\n" );
|
||||
for ( Node childNode : ul.childNodes() ) {
|
||||
visitNode( childNode );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue