-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release: MVP published to chrome web store 🎉
- Loading branch information
1 parent
c2061f6
commit 8f2a5fc
Showing
12 changed files
with
168 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,36 @@ | ||
# docgo | ||
A browser extension 🧱 to redirect from Go source code repositories to official go documentation | ||
# DOCGO! | ||
|
||
![Chrome Web Store](https://img.shields.io/chrome-web-store/users/jllcbbemppedmpfjjeaoifdogcinmjpm) | ||
[![Rating](https://img.shields.io/chrome-web-store/stars/jllcbbemppedmpfjjeaoifdogcinmjpm.svg)](https://chrome.google.com/webstore/detail/docgo/jllcbbemppedmpfjjeaoifdogcinmjpm) | ||
[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/jllcbbemppedmpfjjeaoifdogcinmjpm)](https://chrome.google.com/webstore/detail/docgo/jllcbbemppedmpfjjeaoifdogcinmjpm) | ||
![GitHub manifest.json dynamic](https://img.shields.io/github/manifest-json/permissions/akshaybharambe14/docgo) | ||
[![GitHub](https://img.shields.io/github/license/akshaybharambe14/docgo)](LICENSE) | ||
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/) | ||
|
||
|
||
A browser extension 🧱 to redirect from Go source code repositories to official go documentation 📄. | ||
|
||
I made if for fun and it might help you. Enjoy! | ||
|
||
## How to use it | ||
|
||
1. Add the extension from [chrome wb store](https://chrome.google.com/webstore/detail/docgo/jllcbbemppedmpfjjeaoifdogcinmjpm) to your browser. | ||
|
||
2. Head over to any Go package/module ex. [The Go repository](https://github.com/golang/go). | ||
|
||
3. Click on the extension and Go! | ||
|
||
![Click "Go" to get redirected](./images/example.png) | ||
|
||
**Pro tip:** You can pin the extension. | ||
|
||
## Why | ||
|
||
Sometimes, Go developers fail to mention official documentation URL for their repository. We have to manually go to [pkg.go.dev](pkg.go.dev) and search for that repository. This extension helps to go to the documentation right from where ypu are. | ||
|
||
## Contributing | ||
|
||
If you have any idea, feel free to open an issue. | ||
|
||
## Thank You! | ||
If you like it, please rate it on chrome store and keep coding! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// package docgo is here make Go community aware of this extension. DOCGO is a browser extension 🧱 to redirect from Go source code repositories to official go documentation 📄. | ||
package docgo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.center { | ||
text-align: center; | ||
} | ||
.container { | ||
height: 100px; | ||
position: relative; | ||
} | ||
|
||
.btn-center { | ||
margin: 0; | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
-ms-transform: translate(-50%, -50%); | ||
transform: translate(-50%, -50%); | ||
} | ||
|
||
button { | ||
display: inline-block; | ||
background-color: #7b38d8; | ||
border-radius: 10px; | ||
border: 4px double #cccccc; | ||
color: #eeeeee; | ||
text-align: center; | ||
font-size: 28px; | ||
padding: 20px; | ||
width: 100px; | ||
transition: all 0.5s; | ||
cursor: pointer; | ||
margin: 5px; | ||
} | ||
button span { | ||
cursor: pointer; | ||
display: inline-block; | ||
position: relative; | ||
transition: 0.5s; | ||
} | ||
button span:after { | ||
content: "\00bb"; | ||
position: absolute; | ||
opacity: 0; | ||
top: 0; | ||
right: -20px; | ||
transition: 0.5s; | ||
} | ||
button:hover { | ||
background-color: #f7c2f9; | ||
} | ||
button:hover span { | ||
padding-right: 25px; | ||
} | ||
button:hover span:after { | ||
opacity: 1; | ||
right: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Load package documentation</title> | ||
<script src="docgo.js"></script> | ||
<link rel="stylesheet" href="docgo.css" /> | ||
</head> | ||
<body> | ||
<div class="center"> | ||
<h1>DOCGO</h1> | ||
<h3> | ||
Redirect from Go source code repositories(ex. Github) to official | ||
documentation | ||
</h3> | ||
</div> | ||
<div class="container"> | ||
<div class="btn-center"> | ||
<button id="go"> | ||
<span>Go!</span> | ||
</button> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const splitChar = '//' | ||
const goDocURL = 'https://pkg.go.dev/' | ||
|
||
const clean = (url = '') => { | ||
const start = url.indexOf(splitChar) | ||
|
||
return url.substring(start + splitChar.length) | ||
} | ||
|
||
const redirect = (tabs = [] /* active tabs */) => { | ||
if (tabs.length == 0) { | ||
alert("You don't have any active tabs!") | ||
return | ||
} | ||
const tab = tabs[0] | ||
const repoURL = clean(tab.url) | ||
const docURL = goDocURL + repoURL | ||
window.open(docURL, '_blank').focus(); // open new tab with documentation | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', (e) => { | ||
|
||
var goBtn = document.getElementById('go'); | ||
|
||
goBtn.addEventListener('click', () => { | ||
chrome.tabs.query({ active: true, currentWindow: true }, redirect) | ||
}) | ||
|
||
}, false); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/akshaybharambe14/docgo | ||
|
||
go 1.16 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "DOCGO", | ||
"description": "Redirect from Go source code repositories(ex. Github) to official documentation", | ||
"version": "1.0", | ||
"action": { | ||
"default_icon": "icons/icon500.png", | ||
"default_popup": "docgo.html" | ||
}, | ||
"icons": { | ||
"16": "icons/icon16.png", | ||
"48": "icons/icon48.png", | ||
"128": "icons/icon128.png" | ||
}, | ||
"permissions": [ | ||
"activeTab" | ||
] | ||
} |