# Swift DocC Plugin Pitch: Add symbolGraphMinimumAccessLevel option support

**URL:** <https://forums.swift.org/t/swift-docc-plugin-pitch-add-symbolgraphminimumaccesslevel-option-support/72212>\
**Category:** Swift Documentation Tooling\
**Created:** [June 2, 2024, 8:42am UTC](https://forums.swift.org/t/swift-docc-plugin-pitch-add-symbolgraphminimumaccesslevel-option-support/72212 "2024-06-02T08:42:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyle-Ye](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kyle-ye/32/19686_2.png) [@Kyle-Ye](https://forums.swift.org/u/Kyle-Ye)\
**Post date:** [June 2, 2024, 8:42am UTC](https://forums.swift.org/t/swift-docc-plugin-pitch-add-symbolgraphminimumaccesslevel-option-support/72212/1 "2024-06-02T08:42:29Z")

</div>

I propose to add a new symbolGraphMinimumAccessLevel option support. (Implemented as `--experimental-symbol-graph-minimum-access-level` in the PR now)

The current behavior for it is for library target we assume it to be `public` and for executable target we assume it to be `internal` implemented in `defaultSymbolGraphOptions`.

I propose to add `symbol-graph-minimum-access-level` option in command line so that we can opt-out the default `internal` behavior for executable target.

The use case is that for some package, we want to documentation the executable target via docc bundle but we do not want to expose the internal symbol graph into the documentation.

PR: [Add symbolGraphMinimumAccessLevel option support by Kyle-Ye · Pull Request #82 · apple/swift-docc-plugin · GitHub](https://github.com/apple/swift-docc-plugin/pull/82)

Related discussion: cc @Joseph_Heck

> [@CLI option to choose protection level when using the swift-docc-plugin](https://forums.swift.org/t/cli-option-to-choose-protection-level-when-using-the-swift-docc-plugin/54806):
>
> I didn't want to derail the [earlier Swift-DocC plugin thread](https://forums.swift.org/t/swift-docc-plugin-for-swiftpm/54725/20), but I would like to propose an additional CLI option for that plugin: --access level with options to accept the following values: public, internal, private, fileprivate, and open. (these are the [access levels defined in Swift Package Manager](https://github.com/apple/swift-package-manager/blob/850c772727825a9d09a7febfd6d3819ab52c1fe8/Sources/Commands/SymbolGraphExtract.swift#L31)) Background: The plugin currently invokes the PackageManager to generate the symbol graph using one of these access levels, and two other Boolean options: --includeSPI and --includeSynthesized.…

---

<div class="post-metadata">

**Author:** ![Joseph\_Heck](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/joseph_heck/32/22369_2.png) [@Joseph\_Heck](https://forums.swift.org/u/Joseph_Heck)\
**Post date:** [June 2, 2024, 2:37pm UTC](https://forums.swift.org/t/swift-docc-plugin-pitch-add-symbolgraphminimumaccesslevel-option-support/72212/2 "2024-06-02T14:37:45Z")

</div>

A huge +1 from me!

In the PR, you have the CLI optional as including 'experimental' - and I'd prefer to just see it directly matching the DocC CLI option, rather than tacking on the experimental addition. It feels superflous because this is (now) a well established option in DocC and matches the "upstream" functionality one to one.

---

<div class="post-metadata">

**Author:** ![Kyle-Ye](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kyle-ye/32/19686_2.png) [@Kyle-Ye](https://forums.swift.org/u/Kyle-Ye)\
**Post date:** [June 2, 2024, 3:53pm UTC](https://forums.swift.org/t/swift-docc-plugin-pitch-add-symbolgraphminimumaccesslevel-option-support/72212/3 "2024-06-02T15:53:46Z")

</div>

> In the PR, you have the CLI optional as including 'experimental' - and I'd prefer to just see it directly matching the DocC CLI option, rather than tacking on the experimental addition

Replied on the PR. It's a start-up PR suggestion from the package maintainer. We'll get ride of it eventually.

---

<div class="post-metadata">

**Author:** ![Kyle-Ye](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kyle-ye/32/19686_2.png) [@Kyle-Ye](https://forums.swift.org/u/Kyle-Ye)\
**Post date:** [August 12, 2024, 3:48pm UTC](https://forums.swift.org/t/swift-docc-plugin-pitch-add-symbolgraphminimumaccesslevel-option-support/72212/4 "2024-08-12T15:48:51Z")

</div>

Update: The feature is landed onto main branch of swift-docc-plugin without experimental prefix.
