Skip to content

fix: add [discrete] to section headings inside collapsible blocks#119

Merged
rdmueller merged 3 commits into
mainfrom
copilot/better-anchor-description-formatting
Feb 22, 2026
Merged

fix: add [discrete] to section headings inside collapsible blocks#119
rdmueller merged 3 commits into
mainfrom
copilot/better-anchor-description-formatting

Conversation

Copilot AI commented Feb 22, 2026

Copy link
Copy Markdown
Contributor
  • Add [discrete] attribute before all == section headings inside collapsible blocks in all anchor .adoc files (269 headings, 97 files)
  • _template.adoc also updated
  • Add .asciidoc-linter.yml config that disables WS001 (false positives for [discrete] preceding section titles)
  • Update CI workflow asciidoc-lint.yml to pass --config .asciidoc-linter.yml
  • Verified all anchor files pass asciidoc-linter with the new config
Original prompt

This section details on the original issue you should resolve

<issue_title>better formatting of anchor description</issue_title>
<issue_description>the anchors are formatted without proper sub-headlines, only bold text instead of it. that does not support readability.

I've reformatted docs/anchors/pugh-matrix.de.adoc to show the correct formatting</issue_description>

Comments on the Issue (you are @copilot in this section)

@rdmueller This didn't work. it seems the headlines must be marked as [discrete] inside the block:

[discrete]
== headline


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…proper rendering

Co-authored-by: rdmueller <1856308+rdmueller@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve formatting of anchor descriptions for better readability fix: add [discrete] to section headings inside collapsible blocks Feb 22, 2026
Copilot AI requested a review from rdmueller February 22, 2026 08:37
@rdmueller
rdmueller marked this pull request as ready for review February 22, 2026 08:40
@rdmueller

Copy link
Copy Markdown
Member

@copilot

please check the asciidoc linter ouput:

Results for docs/anchors/wardley-mapping.de.adoc:
✗ docs/anchors/wardley-mapping.de.adoc, line 9: Section title should be preceded by a blank line
✗ docs/anchors/wardley-mapping.de.adoc, line 35: Section title should be preceded by a blank line

for each changed file

Co-authored-by: rdmueller <1856308+rdmueller@users.noreply.github.com>

Copilot AI commented Feb 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

please check the asciidoc linter ouput:
...

Fixed in commit 2bf4dcd.

The linter's WS001 rule requires a blank line immediately before == headings, but a blank line between [discrete] and == would break the AsciiDoc attribute association. The rule's built-in whitelist only allows lines starting with [. or [[ to substitute for the blank line — [discrete] doesn't match either pattern.

Added .asciidoc-linter.yml that disables WS001, and updated the CI workflow to use --config .asciidoc-linter.yml. All anchor files now pass with exit code 0.

@rdmueller

Copy link
Copy Markdown
Member

@copilot
please create an issue for the false positive in https://github.com/docToolchain/asciidoc-linter/issues

Copilot AI commented Feb 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot
please create an issue for the false positive in https://github.com/docToolchain/asciidoc-linter/issues

I'm not able to open issues in external repositories. Here's all the information needed to file it at https://github.com/docToolchain/asciidoc-linter/issues:

Title: WS001 false positive: "Section title should be preceded by a blank line" when [discrete] immediately precedes the heading

Body:

The WS001 rule in whitespace_rules.py reports Section title should be preceded by a blank line whenever a [discrete] attribute appears directly before a section heading, even though that is the correct AsciiDoc syntax — a blank line between [discrete] and == Heading would break the attribute association.

Minimal reproducer:

[%collapsible]
====
[discrete]
== Core Concepts
content here
====

Expected: no finding (or at most a warning that [discrete] is the recommended way to put headings inside example blocks).

Actual: ✗ line N: Section title should be preceded by a blank line

Root cause: The whitelist in whitespace_rules.py (around line 165) only accepts lines starting with [. or [[ as valid substitutes for a blank line before a section title. Lines starting with [d (e.g. [discrete]) are not covered.

Fix suggestion: Extend the whitelist condition to also accept any line that starts with [ (i.e. any AsciiDoc block attribute list), or at minimum add "[discrete" to the tuple.

@rdmueller
rdmueller merged commit 470a5d5 into main Feb 22, 2026
8 checks passed
@rdmueller
rdmueller deleted the copilot/better-anchor-description-formatting branch June 26, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

better formatting of anchor description

2 participants