This Chrome extension turns #include X
in C/C++ files, and import X
/from X import Y
/process.load(XXX.YYY.ZZZ_cff)
in python config files, into hyperlinks when viewing CMSSW files on Github.com, so you can get to the includes easily. It works on the central repo AND your forks.
C++ bonus: it even adds links to the related src files (if they exist).
Get it here: Chrome web store
- Download the latest release:
https://github.com/raggleton/github-linkify-cmssw/releases/latest
You will have to hit "Continue" in your downloads bar. Note that it may say "Extensions cannot be installed from this website". That's fine.
-
Go to chrome://extensions
-
Drag and drop the
github-linkify-cmssw.crx
package onto the window. Click OK when it asks permission to access github.com. This should install it.
-
Clone this repo.
-
Go to
chrome://extensions
-
If you installed the extension from the crx package above, remove it (hit the little bin icon next to it) or disable it.
-
Enable Developer Mode by ticking the box in the top right of the page.
-
Hit "Load unpacked extension..." and navigate to the folder into which you cloned.
-
This should add the extension at the top of the list of extensions.
-
You can now edit make edits. Everything is done in contentscript.js. The manifest.json file declares the extension to Chrome, with options about name, version number, page permissions, etc.
-
Once you've made your edits, hit the Reload button below the extension (or ctrl/cmd+R on the
chrome://extensions
page) and reload your CMSSW page to see your work in action!
This is required whenever a new release is made
-
Go to
chrome://extensions
-
Click "Pack extension..."
-
Select your
github-linkify-cmssw
directory -
Select private key. This will be generated the first time you package an extension. See https://developer.chrome.com/extensions/packaging
-
This will output a CRX file
- First make a tag:
git tag -a <tagname> -m <brief description> <commit hash>
git push origin --tags
-
Then navigate to https://github.com/raggleton/github-linkify-cmssw/releases, click "Draft a new release"
-
Choose your new tag, enter title and description
-
Attach the new CRX file
-
Hit "Publish release"
- if on a header page, add link to src file!
- detect if file is PY or CPP from file extension in URL (easy), then customise looping e.g. for C++ stop once you've hit a non-comment line that doens't have include in it
- testing URL: STOP once you've found a succcessful one
- bug: only works on reload?
- Maybe I'll do a Firefox equivalent some day.
Robin Aggleton 2019