Skip to content

Commit

Permalink
Merge pull request quarkusio#43225 from Athou/markdown-tables
Browse files Browse the repository at this point in the history
Config Doc: use HTML tables to be able to output markdown inside cells
  • Loading branch information
gsmet authored Sep 12, 2024
2 parents 4636861 + 63b38d0 commit a36ef64
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,7 @@ protected JavadocFormat javadocFormat() {

@Override
public String formatSectionTitle(ConfigSection configSection) {
// markdown only has 6 heading levels
int headingLevel = Math.min(6, 2 + configSection.getLevel());
return "#".repeat(headingLevel) + " " + super.formatSectionTitle(configSection);
}

@Override
public String escapeCellContent(String value) {
String cellContent = super.escapeCellContent(value);
return cellContent == null ? null : cellContent.replace("\n\n", "<br><br>").replace("\n", " ");
return "&nbsp;".repeat(configSection.getLevel() * 4) + super.formatSectionTitle(configSection);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@

# {extensionConfigRootsEntry.key.formatName}

| Configuration property | Type | Default |
|------------------------|------|---------|
<table>
<thead>
<tr>
<th align="left">Configuration property</th>
<th>Type</th>
<th>Default</th>
</tr>
</thead>
<tbody>
{#for configRoot in extensionConfigRootsEntry.value.values}
{#for item in configRoot.items}
{#if !item.deprecated}
Expand All @@ -17,6 +24,8 @@
{/if}
{/for}
{/for}
</tbody>
</table>
{/for}

{#if includeDurationNote}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
🔒: Configuration property fixed at build time - All other configuration properties are overridable at runtime

{#if configItemCollection.nonDeprecatedProperties}
| Configuration property | Type | Default |
|------------------------|------|---------|
<table>
<thead>
<tr>
<th align="left">Configuration property</th>
<th>Type</th>
<th>Default</th>
</tr>
</thead>
<tbody>
{#for property in configItemCollection.nonDeprecatedProperties}
{#configProperty configProperty=property extension=extension additionalAnchorPrefix=additionalAnchorPrefix /}
{/for}
{/if}
{#for section in configItemCollection.nonDeprecatedSections}

{#configSection configSection=section extension=extension additionalAnchorPrefix=additionalAnchorPrefix displayConfigRootDescription=false /}
{/for}
</tbody>
</table>

{#if includeDurationNote}
{#durationNote summaryTableId /}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
| {#if configProperty.phase.fixedAtBuildTime}🔒 {/if}`{configProperty.path.property}`{#for additionalPath in configProperty.additionalPaths}<br>`{additionalPath.property}`{/for}<br><br>{configProperty.formatDescription.escapeCellContent.or("")}{#envVar configProperty /} | {configProperty.formatTypeDescription.escapeCellContent.or("")} | {#if configProperty.defaultValue}{configProperty.formatDefaultValue.escapeCellContent}{/if} |
<tr>
<td>

{#if configProperty.phase.fixedAtBuildTime}🔒 {/if}`{configProperty.path.property}`
{#for additionalPath in configProperty.additionalPaths}
`{additionalPath.property}`
{/for}

{configProperty.formatDescription.escapeCellContent.or("")}

{#envVar configProperty /}
</td>
<td>

{configProperty.formatTypeDescription.escapeCellContent.or("")}
</td>
<td>

{#if configProperty.defaultValue}{configProperty.formatDefaultValue.escapeCellContent}{/if}
</td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<thead>
<tr>
<th align="left" colspan="3">
{configSection.formatTitle}
</th>
</tr>
</thead>

{#if configSection.nonDeprecatedProperties}
| Configuration property | Type | Default |
|------------------------|------|---------|
{#for property in configSection.nonDeprecatedProperties}
{#configProperty configProperty=property extension=extension additionalAnchorPrefix=additionalAnchorPrefix /}
{/for}
{/if}
{#for subsection in configSection.nonDeprecatedSections}

{#configSection configSection=subsection extension=extension additionalAnchorPrefix=additionalAnchorPrefix /}
{/for}
{/for}

0 comments on commit a36ef64

Please sign in to comment.