swift-doc
swift-doc copied to clipboard
Group enum cases based on `MARK` comments
For https://github.com/sindresorhus/KeyboardShortcuts/blob/49b017b2450ac37353934d94d6c64957b62c45b4/Sources/KeyboardShortcuts/Key.swift#L8-L34, I get the following: https://sindresorhus.com/playground/KeyboardShortcuts_Key/
With Jazzy, I get the enum cases grouped too: https://sindresorhus.com/KeyboardShortcuts/Classes/KeyboardShortcuts/Key.html#/Letters
@sindresorhus Curious to know, do you have any thoughts about how MARK
headings should relate to declaration type groupings? Should we treat them as peers / alternates or should we see the current "by type" grouping just as the default sections for when MARK
headings aren't provided?
My preference would be for them to be sub-headings under the Enumeration Cases
section. Jazzy makes them top-level sections, which feels wrong to me.
@sindresorhus What if a section contains different kinds of symbols? For example:
enum E {
// MARK: Example
case c
func f() {}
}
Would they repeat for each kind of symbol, like this?
- Cases
- "Example"
-
c
-
- "Example"
- Methods
- "Example"
-
f()
-
- "Example"
Not sure, to be honest. I wouldn't use MARK
like that.