-
Notifications
You must be signed in to change notification settings - Fork 145
Add support for abstract Headerdoc tag #1215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ class DoxygenTests: XCTestCase { | |
func testDoxygenDiscussionAndNote() throws { | ||
let documentationLines: [SymbolGraph.LineList.Line] = """ | ||
This is an abstract. | ||
@abstract This is description with abstract. | ||
|
||
@discussion This is a discussion linking to ``AnotherClass`` and ``AnotherClass/prop``. | ||
|
||
|
@@ -96,6 +97,7 @@ class DoxygenTests: XCTestCase { | |
|
||
XCTAssertEqual(symbol.abstract?.format(), "This is an abstract.") | ||
XCTAssertEqual(symbol.discussion?.content.map { $0.format() }, [ | ||
#"\abstract This is description with abstract."#, | ||
#"\discussion This is a discussion linking to ``doc://unit-test/documentation/ModuleName/AnotherClass`` and ``doc://unit-test/documentation/ModuleName/AnotherClass/prop``."#, | ||
#"\note This is a note linking to ``doc://unit-test/documentation/ModuleName/Class3`` and ``Class3/prop2``."# | ||
]) | ||
|
@@ -108,10 +110,10 @@ class DoxygenTests: XCTestCase { | |
XCTAssertEqual(renderNode.primaryContentSections.count, 1) | ||
|
||
let overviewSection = try XCTUnwrap(renderNode.primaryContentSections.first as? ContentRenderSection) | ||
XCTAssertEqual(overviewSection.content.count, 3) | ||
XCTAssertEqual(overviewSection.content.count, 4) | ||
XCTAssertEqual(overviewSection.content, [ | ||
.heading(.init(level: 2, text: "Overview", anchor: "overview")), | ||
|
||
.paragraph(.init(inlineContent: [.text("This is description with abstract.")])), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we try to actually parse On the other hand, we probably shouldn't add too much Doxygen/HeaderDoc support, since we really want to push people to using Markdown... 😅 I'm fine either way on this, though i'm curious what the workgroup (or just the rest of our team) thinks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the thought of having limited Oxygen/HeaderDoc support I thought we should not restrain from parsing @abstract as an abstract. But open to other ideas too and can be convinced otherwise :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like we should at least explore what it would take for It might also be good to verify that links in the abstract are resolved. IIRC this doesn't happen automatically for new elements. |
||
.paragraph(.init(inlineContent: [ | ||
.text("This is a discussion linking to "), | ||
.reference( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen if these two lines were flipped? If the "abstract" content becomes the second sentence in the discussion section, then I'd argue that it's more important that we actually parse
@abstract
as an abstract (like Vera pointed our here).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a confusing workflow to support in terms of how the abstract is written while documenting, where the first time without tag is abstract, followed by discussion tag, and if there is a abstract tag post that, we would need to append to the abstract in the first line. It is an interesting scenario to think about but I don't know for sure we should support/facilitate that workflow.