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

Autodoc: hyperlink URLs in text #19402

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

ianprime0509
Copy link
Contributor

Closes #19265

There are two commits in this PR: the first one implements the "traditional" Markdown autolink syntax, using <> to delimit the link, and the second one extends the parser to also recognize a more restricted form of links directly in plain text without any delimiters.

Both forms of autolinks are currently represented in the standard library documentation. Here are some examples:

  • Using <> (these are a minority):
    • #std.Uri
    • #std.fmt.parse_float.convert_slow.convertSlow
    • #std.fmt.parse_float.convert_eisel_lemire.convertEiselLemire
  • Plain text:
    • #std.ascii (the subject of the linked issue)
    • #std.unicode.fmtUtf8
    • #std.mem.page_size

Closes ziglang#19265

This commit implements support for Markdown autolinks delimited by angle
brackets. The precise syntax accepted is documented in the doc comment
of `markdown.zig`.
This extension to the typical `<>` Markdown autolink syntax allows
HTTP(S) links to be recognized in normal text without being delimited by
`<>`. This is the most natural way to write links in text, so it makes
sense to support it and allow documentation comments to be written in a
more natural way.
@ianprime0509
Copy link
Contributor Author

It seems that the aarch64-macos-debug CI timed out, although unfortunately I don't have access to an aarch64-macos system to see if this is reproducible or just an unfortunate random occurrence. I'm not sure how these changes could have caused such a noticeable change in the build time; judging from other aarch64-macos-debug CI runs, it seems they usually take only 3.5-4.5 hours, not 6+ as in this case.

@andrewrk
Copy link
Member

Nice!

@andrewrk andrewrk merged commit abadad4 into ziglang:master Mar 25, 2024
9 of 10 checks passed
@ianprime0509 ianprime0509 deleted the markdown-autolinks branch March 26, 2024 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std docs: bare urls are not linkified
2 participants