Skip to content
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

Allow certain directives in doc comments #591

Open
bitjammer opened this issue May 18, 2023 · 0 comments
Open

Allow certain directives in doc comments #591

bitjammer opened this issue May 18, 2023 · 0 comments
Assignees
Labels
enhancement Improvements or enhancements to existing functionality

Comments

@bitjammer
Copy link
Member

Feature Name

Some Directives in Doc Comments

Description

DocC currently disallows all directives in doc comments. There are reasons to allow some, such as @Snippet. @Snippet is a textual element that renders identically to a code block, so that would be reasonable to allow on symbols when there is a quick, canonical example to use an API.

Motivation

This feature request is motivated by allowing the @Snippet directive in doc comments, as was noted here: https://forums.swift.org/t/using-snippets-in-documentation-comments-not-possible/65046

I'll leave the total list of allowed directives to the implementor. There may be others that could be useful on symbol docs.

Importance

Code examples in doc comments are currently limited to Markdown code blocks. If snippets are a useful alternative to some code blocks, then it would be an improvement to allow them in doc comments as well.

Alternatives Considered

No response

@bitjammer bitjammer added the enhancement Improvements or enhancements to existing functionality label May 18, 2023
@emilyychenn emilyychenn self-assigned this Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements or enhancements to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants