diff options
| -rw-r--r-- | godoc-links.user.js | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/godoc-links.user.js b/godoc-links.user.js index c1f44ba..ab5ac3d 100644 --- a/godoc-links.user.js +++ b/godoc-links.user.js @@ -52,6 +52,18 @@ function pkg_go_dev () {  	var parent_el = import_path_el.parentNode;  	parent_el.removeChild(import_path_el);  	parent_el.prepend(link_el); + +	pkg_go_dev_add_godoc_link(parent_el, import_path_el.textContent); +} + + +// Add a link in the header to the GoDoc version of the docs. +function pkg_go_dev_add_godoc_link (container_el, import_path) { +	var link_el = document.createElement('a'); +	link_el.href = 'https://godoc.org/' + import_path; +	link_el.textContent = '(GoDoc)'; + +	container_el.appendChild(link_el);  }  | 
