Skip to content

Instantly share code, notes, and snippets.

@lesteve
Last active March 2, 2018 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesteve/470170f288884ec052bcf4bc4ffe958a to your computer and use it in GitHub Desktop.
Save lesteve/470170f288884ec052bcf4bc4ffe958a to your computer and use it in GitHub Desktop.
Greasemonkey script that adds a button to the PR page to open the doc generated by CircleCI for this PR.
@choldgraf
Copy link

@lesteve this is awesome...do you think there's a way we could combine this + the _changed functionality of sklearn into a little mini doc helper package? Or write a little tutorial that could exist on the internet that people could find? I think this kinda thing would be helpful for other projects as well!

@lesteve
Copy link
Author

lesteve commented Aug 1, 2017

@choldgraf just seeing this now ... glad you find it useful! Not sure how to package and whether this is worth the effort, to be perfectly honest. There was some attempt at documenting this kind of developer tweaks and it is in the dev doc here. The problem with this kind of doc is that it quickly goes out of date.

@jnothman
Copy link

jnothman commented Aug 7, 2017

This involves three components (which I introduced piece by piece):

  • the redirect from /circle?<CIRCLE_ID>/<PATH> to the corresponding artifact path
  • the _changed.html being output in the build process, which uses some heuristics for mapping examples to auto_examples and similar for generated docs. It could be improved particularly by matching more precisely which docstrings were modified. Atm it just lands up reporting all public objects from a module.
  • the Javascript presented here. Unfortunately, yes, it breaks if github changes things, but that, at least, is something that can be handled by having a centralised script or extension that is fixed at each break.

How to package this all up? I'm not sure! The first step is not strictly necessary; one only needs a way to template and into a URL.

@rth
Copy link

rth commented Oct 13, 2017

This is great. Can confirm it also works on Chome with Tampermonkey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment