Skip to content

Specify default code listing language for DocC catalog #85

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

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

denil-ct
Copy link
Contributor

@denil-ct denil-ct commented Jun 21, 2023

Motivation

Resolves #20

Modifications

  • Added CDDefaultCodeListingLanguage to info.plist
  • Updated ambiguous language highlightings

Result

Swift code blocks no longer needs to be explicitly marked as such.

Test Plan

Files inside the docc archive - Tested and verified with both explicit and non-explicit swift markings.
Files outside the docc archive - TBD

@czechboy0
Copy link
Contributor

czechboy0 commented Jun 21, 2023

Thanks @denil-ct!

Were you able to test that after this addition, when you preview the docs locally, you get syntax highlighting for Swift even for code blocks without the explicit annotation? Would be good to do this, and add this to the Test Plan section of your PR description.

@denil-ct
Copy link
Contributor Author

Were you able to test that after this addition, when you preview the docs locally, you get syntax highlighting for Swift even for code blocks without the explicit annotation? Would be good to do this, and add this to the Test Plan section of your PR description.

Yes, I tested it for the one I removed.

Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

Ok, to summarize, please just fix these up and we're good to go:

  • revert the removal of the explicit listing name in Contributing-...md
  • edit the PR description to say that you tested the change manually by removing one of the annotations and still seeing the syntax highlighting

Thanks!

@denil-ct
Copy link
Contributor Author

denil-ct commented Jun 21, 2023

The default listing language is very helpful in code snippets in documentation comments above type definitions in Swift files, where folks frequently omit the language name.

So I had a concern regarding this. Won't the plist only affect whatever is listed within the docc archive?

I tried adding something like this
image

But it generated the non-highlighted version
image

However on explicitly marking swift, it is correctly highlighted.
image

@czechboy0
Copy link
Contributor

czechboy0 commented Jun 21, 2023

Hmm that's unfortunate, not sure if expected behavior? cc @ethan-kusters @franklinsch

Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

This PR fixes the issue, we'll investigate code listings coming from code comments separately. Looks good, thanks!

@denil-ct
Copy link
Contributor Author

denil-ct commented Jun 21, 2023

@czechboy0 This comment seems to imply this is only applicable for listings within the bundle.

@czechboy0 czechboy0 requested a review from simonjbeaumont June 21, 2023 11:20
@simonjbeaumont simonjbeaumont added the semver/none No version bump required. label Jun 21, 2023
@simonjbeaumont simonjbeaumont changed the title Add default code listing to docc archive Specify default code listing language for DocC catalog Jun 21, 2023
@simonjbeaumont
Copy link
Collaborator

@swift-server-bot test this please

@simonjbeaumont simonjbeaumont enabled auto-merge (squash) June 21, 2023 12:34
@simonjbeaumont simonjbeaumont merged commit 28258e2 into apple:main Jun 21, 2023
@denil-ct denil-ct deleted the add-default-code-listing-lang branch June 21, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set Swift as the default language in the Info.plist of the docc bundles
3 participants