GitCodeTree/README.md

54 lines
3.1 KiB
Markdown
Raw Normal View History

2014-05-10 08:06:38 +08:00
## Octotree
2014-05-14 14:35:58 +08:00
Browser extensions (Chrome, Firefox and Safari) to display GitHub code in tree format. Useful for developers who frequently read source in GitHub and do not want to download or checkout too many repositories. Features:
2014-05-12 01:14:25 +08:00
2014-05-12 01:24:39 +08:00
* Easy-to-navigate code tree like IDEs
2014-05-13 13:47:49 +08:00
* Fast browsing with pjax
* Support private repositories (require [personal access token](#github-api-rate-limit))
2014-05-10 08:06:38 +08:00
2014-05-14 14:35:58 +08:00
## Install on Chrome
2014-05-10 08:32:07 +08:00
* Download and install [Octotree](https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc) from the Chrome store
2014-05-10 08:06:38 +08:00
* 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/chrome.png)
2014-05-10 08:06:38 +08:00
2014-05-14 14:35:58 +08:00
## Install on Firefox and Safari
I'm in the process of submitting the extensions to Mozilla and Safari stores. Meanwhile, you can install the prebuilt extensions located in the [dist](https://github.com/buunguyen/octotree/tree/master/dist) folder.
* Firefox: drag `octotree.xpi` to the browser and follow the instructions
* Safari: drag `octotree.safariextz` to the browser and follow the instructions
2014-05-10 08:06:38 +08:00
## 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 access a private repository
2014-05-10 08:06:38 +08:00
* You exceed the [rate limit of unauthenticated requests](https://developer.github.com/v3/#rate-limiting)
2014-05-10 08:14:43 +08:00
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).
2014-05-10 08:06:38 +08:00
![Enter personal access token](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/token.png)
2014-05-10 08:06:38 +08:00
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.
Alternatively, you can always manually enter or update the token by following these steps:
* Navigate to any GitHub page
2014-05-14 14:35:58 +08:00
* Open the Chrome (or Safari, Firefox) developer console
2014-05-10 08:06:38 +08:00
* Execute the following line:
```javascript
localStorage.setItem('octotree.github_access_token', JSON.stringify('REPLACE WITH TOKEN'))
2014-05-10 08:06:38 +08:00
```
## Contribution
There are several improvements that can be made to Octotree. Contribution is very welcome.
2014-05-11 07:26:50 +08:00
- [ ] Hide sidebar when navigating to non-code pages like Issues, PRs...
2014-05-12 01:22:18 +08:00
- [ ] Make the width of the sidebar resizable.
2014-05-12 12:08:19 +08:00
- [ ] Allow docking sidebar to either the left or right side.
2014-05-12 01:22:18 +08:00
- [ ] Allow users to enter access token any time.
- [ ] Synchronize (two-way) between sidebar selection and GitHub selection.
- [ ] Show progress indicator while the code tree or a file is being loaded (with Pjax). (Showing spinner in the toggle button?)
2014-05-10 08:06:38 +08:00
## Credit
2014-05-14 14:35:58 +08:00
* [Icon](https://github.com/pstadler/octofolders) by [pstadler](https://github.com/pstadler)
* Thanks to many people submitting pull requests, reporting bugs and suggesting ideas here and on [HN](https://news.ycombinator.com/item?id=7740226)