This userscript has moved to https://github.com/lesteve/userscripts/blob/master/add-button-for-pr-circleci-doc.user.js.
Last active
March 2, 2018 08:54
-
-
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 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.
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 mappingexamples
toauto_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.
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
@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!