diff --git a/.gitignore b/.gitignore index 76add87..79eb783 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules -dist \ No newline at end of file +tmp \ No newline at end of file diff --git a/README.md b/README.md index 0c2246e..5afac3e 100644 --- a/README.md +++ b/README.md @@ -3,24 +3,24 @@ Chrome extension to display GitHub code in tree format. Useful for developers wh * Easy-to-navigate code tree like IDEs * Fast browsing with pjax -* Work with both public and private repositories +* Support private repositories (require [personal access token](#github-api-rate-limit)) ## Install * Download and install [Octotree](https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc) from the Chrome store * Navigate to any GitHub project (or just refresh this page as an example) * The code tree should show as follows: -![When extension is active](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/screen_ext.png) +![When extension is active](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/chrome.png) ## GitHub API Rate Limit Octotree uses [GitHub API](https://developer.github.com/v3/) to retrieve repository metadata. By default, it makes unauthenticated requests to the GitHub API. However, there are two situations when requests must be authenticated: -* You are accessing a private repository +* You access a private repository * You exceed the [rate limit of unauthenticated requests](https://developer.github.com/v3/#rate-limiting) When that happens, Octotree will show the following screen to ask for your [GitHub personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use). -![Enter personal access token](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/screen_token.png) +![Enter personal access token](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/token.png) If you don't already have one, create one at [this page](https://github.com/settings/tokens/new). Then enter the generated token into the textbox and save. diff --git a/dist/octotree.safariextz b/dist/octotree.safariextz new file mode 100644 index 0000000..7b049b0 Binary files /dev/null and b/dist/octotree.safariextz differ diff --git a/dist/octotree.xpi b/dist/octotree.xpi new file mode 100644 index 0000000..f886b30 Binary files /dev/null and b/dist/octotree.xpi differ diff --git a/docs/screen_ext.png b/docs/chrome.png similarity index 100% rename from docs/screen_ext.png rename to docs/chrome.png diff --git a/docs/firefox.png b/docs/firefox.png new file mode 100644 index 0000000..c8b4d86 Binary files /dev/null and b/docs/firefox.png differ diff --git a/docs/screen_token.png b/docs/token.png similarity index 100% rename from docs/screen_token.png rename to docs/token.png diff --git a/gulpfile.js b/gulpfile.js index 0af67ce..018621a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,7 +3,6 @@ var gulp = require('gulp') , es = require('event-stream') , rseq = require('gulp-run-sequence') -// helpers function pipe(src, transforms, dest) { if (typeof transforms === 'string') { dest = transforms @@ -17,33 +16,32 @@ function pipe(src, transforms, dest) { return stream } -// tasks gulp.task('clean', function() { - return pipe('./dist', [clean()]) + return pipe('./tmp', [clean()]) }) gulp.task('chrome', function() { return es.merge( - pipe('./src/lib/**/*', './dist/chrome/lib'), - pipe('./src/icons/**/*', './dist/chrome/icons'), - pipe(['./src/inject.js', './src/inject.css', './src/manifest.json'], './dist/chrome/') + pipe('./src/lib/**/*', './tmp/chrome/lib'), + pipe('./src/icons/**/*', './tmp/chrome/icons'), + pipe(['./src/inject.js', './src/inject.css', './src/manifest.json'], './tmp/chrome/') ) }) gulp.task('safari', function() { return es.merge( - pipe('./src/lib/**/*', './dist/safari/octotree.safariextension/lib'), - pipe('./src/icons/**/*', './dist/safari/octotree.safariextension/icons'), - pipe(['./src/inject.js', './src/inject.css', './src/Info.plist'], './dist/safari/octotree.safariextension/') + pipe('./src/lib/**/*', './tmp/safari/octotree.safariextension/lib'), + pipe('./src/icons/**/*', './tmp/safari/octotree.safariextension/icons'), + pipe(['./src/inject.js', './src/inject.css', './src/Info.plist'], './tmp/safari/octotree.safariextension/') ) }) gulp.task('firefox', function() { return es.merge( - pipe('./src/lib/**/*', './dist/firefox/data/lib'), - pipe('./src/icons/**/*', './dist/firefox/data/icons'), - pipe(['./src/inject.js', './src/inject.css', './src/firefox.js'], './dist/firefox/data'), - pipe('./src/package.json', './dist/firefox') + pipe('./src/lib/**/*', './tmp/firefox/data/lib'), + pipe('./src/icons/**/*', './tmp/firefox/data/icons'), + pipe(['./src/inject.js', './src/inject.css', './src/firefox.js'], './tmp/firefox/data'), + pipe('./src/package.json', './tmp/firefox') ) }) diff --git a/src/firefox.js b/src/firefox.js index 816d549..1e43634 100644 --- a/src/firefox.js +++ b/src/firefox.js @@ -11,6 +11,6 @@ pageMod.PageMod({ data.url('lib/js/github.js'), data.url('inject.js')], contentStyleFile: [data.url('lib/css/jstree.css'), - data.url('inject.css'),], + data.url('inject.css')], contentScriptWhen: 'start' }) \ No newline at end of file