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

feat(doc): inline doc links #6626

Merged
merged 3 commits into from
Dec 20, 2023
Merged

Conversation

mattsse
Copy link
Member

@mattsse mattsse commented Dec 20, 2023

Closes #4541

image

This replaces {<Contract>-identifier}([display name])? with a link to the referenced item if it can be found.

There are likely some edge cases that I've missed but we can fix them once they get reported.

wdyt @PaulRBerg

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

lgtm, pending prb's input

/// Overloaded functions are referenced by including the exact function arguments in the `part`
/// section of the placeholder.
static RE_INLINE_LINK: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"(?m)(\{(?P<xref>xref-)?(?P<identifier>[a-zA-Z_][0-9a-zA-Z_]*)(-(?P<part>[a-zA-Z_][0-9a-zA-Z_-]*))?}(\[(?P<link>(.*?))\])?)").unwrap()
Copy link
Member

Choose a reason for hiding this comment

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

nice

@PaulRBerg
Copy link
Contributor

Beautiful, thanks guys

@Evalir Evalir merged commit 8be2649 into foundry-rs:master Dec 20, 2023
20 checks passed
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.

feat(doc): infer hyperlinks for {Contract}, {function}, and {Contract-function} references
4 participants