Open Bug 1648775 Opened 6 years ago Updated 6 years ago

docs.telemetry.mozilla.org tutorials should have author, last modified data in footer

Categories

(Data Platform and Tools :: Documentation and Knowledge Repo (RTMO), enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: wlach, Unassigned)

References

Details

Some of the documentation on docs.tmo is really old and out of date-- it would be helpful to know when it was last modified and have an easy way to browse revision history. This goes especially for some of the new metrics documentation we're adding, where it is expected things might change relatively frequently.

Proposal:

In addition to the edit-on-github link, have something like this information in the footer:

Last modified on 2020-04-20 by @elkevorh (<a href="https://github.com/mozilla/firefox-data-docs/commits/master/src/introduction.md">view history</a>)

The history link should be easy to create programmatically in a similar way to the edit functionality. The author/commit data might be a bit more difficult-- I'd propose a short bit of JavaScript to grab/derive it on the client side, this API should be sufficient:

https://api.github.com/repos/mozilla/firefox-data-docs/commits?path=README.md&page=1&per_page=1

Here's a simple iodide notebook demonstrating the idea:

https://alpha.iodide.io/notebooks/4789/

Jan-Erik, is this something you could do? I suspect it would be easier for you to implement than me, hopefully it wouldn't take so long.

Flags: needinfo?(jrediger)

Certainly sounds like something I'd be willing to tackle. But I won't get to it in the next 3 or 4 weeks at all.
Did you see if maybe someone already implemented such a thing for mdbook?

Flags: needinfo?(jrediger)

(In reply to Jan-Erik Rediger [:janerik] (Away 2020-06-29 to 2020-07-03) from comment #2)

Certainly sounds like something I'd be willing to tackle. But I won't get to it in the next 3 or 4 weeks at all.
Did you see if maybe someone already implemented such a thing for mdbook?

Didn't see anything in a few minutes of googling. I think this might be a straightforward extension for your existing "edit in github" extension, I might be willing to do the work if you have time to review it. Let's chat about it sometime soon.

"edit in github" is a purely static approach. It picks up the configured URL and tries to guess the right path.
Adding actual modification and author information will require some git integration, so you can look at the commit information.

That doesn't mean it's impossible or particular hard, but it's also not as straightforward.

(In reply to Jan-Erik Rediger [:janerik] (Away 2020-06-29 to 2020-07-03) from comment #4)

"edit in github" is a purely static approach. It picks up the configured URL and tries to guess the right path.
Adding actual modification and author information will require some git integration, so you can look at the commit information.

That doesn't mean it's impossible or particular hard, but it's also not as straightforward.

That would be true, if you wanted to just get the result in the raw HTML. However, if we're willing to execute some javascript (which we already do for the mermaid plugin, I believe), you could just use the approach shown in the iodide notebook above and lean on the GitHub API to get the information on render-time.

Ah, sorry, didn't see that iodide part.
Sure, that would work. Only small issue I see is that the GitHub API is heavily rate-limited and we might not be able to fetch the data.

See Also: → 1661360
You need to log in before you can comment on or make changes to this bug.