Skip to content

Format term lists in markdown export#1544

Open
jrturton wants to merge 1 commit into
swiftlang:mainfrom
jrturton:166128254/term-list-support
Open

Format term lists in markdown export#1544
jrturton wants to merge 1 commit into
swiftlang:mainfrom
jrturton:166128254/term-list-support

Conversation

@jrturton

Copy link
Copy Markdown
Contributor

Bug/issue #, if applicable: 166128254

Summary

Term lists were not formatted correctly in markdown exports. This PR re-formats outputted term lists as follows:

Input:

- term Term1: Description
- term Term2: Description2

Previous output was exactly the same as the input. New output is:

Term1: Description
Term2: Description2

Dependencies

N/A

Testing

Steps:

  1. Create source documentation containing term lists (see above for example)
  2. Run docc convert on the documentation with the --enable-experimental-markdown-output flag enabled
  3. Examine the markdown output in the docc archive.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary (N/A)

@jrturton jrturton requested a review from a team as a code owner June 11, 2026 14:35
Comment on lines +655 to +656

Here is some post-list content

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: This markup is never verified in this test.

Suggested change
Here is some post-list content

Comment on lines +645 to +650

Shows how term lists are represented in markdown output

## Overview

Here is some content

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: This markup is never verified in this test.

Suggested change
Shows how term lists are represented in markdown output
## Overview
Here is some content

}


func testTermList() async throws {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same feedback as in your other PR:

Please use Swift Testing for all new tests. See the "Adding new tests" section of the contributing document for more details.



func testTermList() async throws {
let content = """

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The other tests in this file define the content inline in the catalog.

if let indentationToRemove, output.hasPrefix(indentationToRemove) {
output.removeFirst(indentationToRemove.count)
}
// Format term lists after processing other elements

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment would benefit from a before and after example to highlight the formatting differences.

Comment on lines +664 to +666
Spring: The first season of the year
Summer: The second season of the year
`Code`: A code voice item used as a term

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit surprised that this is the indented formatting. I would at least expect the content to continue be list items.

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.

2 participants