quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.98k stars 328 forks source link

When using `code-tools: source: repo` link to exact commit #4819

Open kdheepak opened 1 year ago

kdheepak commented 1 year ago

Bug description

I think when linking to the source file, it would be nice if the code-tools: source: repo linked to exact commit for that file on GitHub.

For my personal blog, I used to do something like this:

const commit = child_process
  .spawnSync("git", ["log", "-n", "1", "--pretty=format:%H", "--", `${filename}`])
  .stdout.toString();
metadata.source = `https://github.com/kdheepak/blog/blob/${commit}/${filename}`;

Checklist

cscheid commented 1 year ago

That would be cool! We should just keep performance regression in mind when we do this (I know we had trouble in the past with a call to git taking longer than we expected)