Skip to content

Commit

Permalink
Merge pull request #38648 from gsmet/doc-adjustments
Browse files Browse the repository at this point in the history
More documentation adjustments for new downstream tooling
  • Loading branch information
gsmet authored Feb 7, 2024
2 parents 322c251 + cdd343f commit ff8d73c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ final public class Constants {
public static final String DURATION_NOTE_ANCHOR = String.format("duration-note-anchor-{%s}",
SUMMARY_TABLE_ID_VARIABLE);
public static final String MEMORY_SIZE_NOTE_ANCHOR = "memory-size-note-anchor";
public static final String MORE_INFO_ABOUT_TYPE_FORMAT = " link:#%s[icon:question-circle[], title=More information about the %s format]";
public static final String MORE_INFO_ABOUT_TYPE_FORMAT = " link:#%s[icon:question-circle[title=More information about the %s format]]";
public static final String DURATION_INFORMATION = String.format(Constants.MORE_INFO_ABOUT_TYPE_FORMAT,
Constants.DURATION_NOTE_ANCHOR, Duration.class.getSimpleName());
public static final String MEMORY_SIZE_INFORMATION = String.format(Constants.MORE_INFO_ABOUT_TYPE_FORMAT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class AssembleDownstreamDocumentation {
Pattern.CASE_INSENSITIVE);
private static final Pattern ANGLE_BRACKETS_WITH_DESCRIPTION_PATTERN = Pattern.compile("<<([a-z0-9_\\-#\\.]+?),([^>]+?)>>",
Pattern.CASE_INSENSITIVE);
private static final Pattern ANCHOR_PATTERN = Pattern.compile("^\\[#([a-z0-9_-]+)]$",
Pattern.CASE_INSENSITIVE + Pattern.MULTILINE);
private static final String SOURCE_BLOCK_PREFIX = "[source";
private static final String SOURCE_BLOCK_DELIMITER = "--";

Expand Down Expand Up @@ -448,6 +450,10 @@ private static String rewriteLinks(String fileName,
return "link:" + QUARKUS_IO_GUIDES_ATTRIBUTE + "/" + mr.group(1);
});

content = ANCHOR_PATTERN.matcher(content).replaceAll(mr -> {
return "[[" + mr.group(1) + "]]";
});

return content;
}

Expand Down

0 comments on commit ff8d73c

Please sign in to comment.