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

Fix broken link and missing space in @Resources documentation #810

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable: rdar://102737063

Summary

This fixes a broken link and a missing space on https://www.swift.org/documentation/docc/resources

Dependencies

None

Testing

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • [ ] Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@d-ronnqvist d-ronnqvist added the documentation Improvements or additions to documentation label Jan 30, 2024
@@ -8,7 +8,7 @@ Displays a set of links to related resources, like downloads, sample code, and v

## Overview

Use the `Resources` directive to include a Resources section at the bottom of a tutorial's table of contents page. This optional section can offer links to helpful material for continued learning. Provide some text for the top of the section, then add directives, for example``Documentation``, ``Downloads``, ``Forums``, ``SampleCode``, and ``Videos`) for the resource types you want to share.
Use the `Resources` directive to include a Resources section at the bottom of a tutorial's table of contents page. This optional section can offer links to helpful material for continued learning. Provide some text for the top of the section, then add directives, for example ``Documentation``, ``Downloads``, ``Forums``, ``SampleCode``, and ``Videos``) for the resource types you want to share.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there's any way we could emit a diagnostic for this? Seems like a missing backtick will be a common typo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea but it would probably need to be fixed in Swift Markdown.

The missing backtick makes the link text not parse as its own element. For example, the correct link (below) parses as:

Some text with a ``Link`` followed by some more text.
Paragraph
├─ Text "Some text with a "
├─ SymbolLink destination: Link
└─ Text " followed by some more text."

and a single backtick before and after pages as:

Some text with a `Link` followed by some more text.
Paragraph
├─ Text "Some text with a "
├─ InlineCode `Link`
└─ Text " followed by some more text."

but double backticks before and a single backtick after just parses as a single text element

Some text with a ``Link` followed by some more text.
Paragraph
└─ Text "Some text with a ``Link` followed by some more text."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened this issue about this swiftlang/swift-markdown#165

Copy link
Contributor

Choose a reason for hiding this comment

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

Great thanks for filing that 👍 ... and I'm guessing there might be more edge cases to handle, like if there is more than one mistake in the same paragraph, or if the author really wanted a single backtick for code voice. Not an obvious fix.

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit e0764ea into swiftlang:main Feb 14, 2024
2 checks passed
@d-ronnqvist d-ronnqvist deleted the resource-directive-docs branch February 14, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants