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

Add links to source code #46

Merged
merged 4 commits into from
Dec 10, 2023
Merged

Add links to source code #46

merged 4 commits into from
Dec 10, 2023

Conversation

kostiantxn
Copy link
Collaborator

Closes #41.

@kostiantxn kostiantxn linked an issue Dec 10, 2023 that may be closed by this pull request
@kostiantxn kostiantxn marked this pull request as draft December 10, 2023 00:17
var from = new Uri(_output);
var to = new Uri(member.Location.Path);

return $"[{text}]({from.MakeRelativeUri(to)}#L{member.Location.Start.Line + 1})";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The line number format should be configurable. For example, GitHub uses #L3-L7, while Bitbucket uses #lines-3:7.

Copy link
Member

@joshua-light joshua-light Dec 10, 2023

Choose a reason for hiding this comment

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

What do you think about extracting a new MdRendererOptions class for tweaking such things?

For example, we could call the UseMdRenderer method on the pipeline with few ways:
(the old one)

pipeline
  .UseMdRenderer("...");

(the more customizable one)

pipeline
  .UseMdRenderer(options => options
    .CleanupOutputDir()
    .UseGitHubMarkdown())

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's a really good idea! I was also planning to raise a ticket to create a configuration mechanism for the pipeline, which I'll do shortly. 👍

var from = new Uri(_output);
var to = new Uri(member.Location.Path);

return $"[{text}]({from.MakeRelativeUri(to)}#L{member.Location.Start.Line + 1})";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should also consider adding columns to the URL (e.g., #L3C5).

@kostiantxn kostiantxn marked this pull request as ready for review December 10, 2023 00:26
Copy link
Member

@joshua-light joshua-light left a comment

Choose a reason for hiding this comment

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

This feature is busted!

@kostiantxn kostiantxn merged commit 87f0255 into develop Dec 10, 2023
1 check passed
@kostiantxn kostiantxn deleted the feature/41-source-links branch December 10, 2023 18:51
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.

Generate a link to source
2 participants