Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #249 from garyburd/issue248
Browse files Browse the repository at this point in the history
Move documentation to wiki
  • Loading branch information
adg committed Feb 24, 2015
2 parents 27ec2ee + 1852ba0 commit 4ada458
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 108 deletions.
100 changes: 3 additions & 97 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,101 +19,7 @@ starting work on anything major. Contributors retain their copyright, so we
need you to fill out a short form before we can accept your contribution:
https://developers.google.com/open-source/cla/individual

Development Environment Setup
-----------------------------
More Documentation
------------------

- Install and run [Redis 2.8.x](http://redis.io/download). The redis.conf file included in the Redis distribution is suitable for development.
- Install Go 1.4.
- Install and run the server:

$ go get github.com/golang/gddo/gddo-server
$ gddo-server

- Browse to [http://localhost:8080/](http://localhost:8080/)
- Enter an import path to have the server retrieve & display a package's documentation

Optional:

- Create the file gddo-server/config.go using the template in [gddo-server/config.go.template](gddo-server/config.go.template).

API
---

The GoDoc API is comprised of these endpoints:

**api.godoc.org/search?q=`Query`**—Returns search results for Query, in JSON format.

```json
{
"results": [
{
"path": "import/path/one",
"synopsis": "Package synopsis is here, if present."
},
{
"path": "import/path/two",
"synopsis": "Package synopsis is here, if present."
}
]
}
```

**api.godoc.org/packages**—Returns all indexed packages, in JSON format.

```json
{
"results": [
{
"path": "import/path/one"
},
{
"path": "import/path/two"
},
{
"path": "import/path/three"
}
]
}
```

**api.godoc.org/importers/`ImportPath`**—Returns packages that import ImportPath, in JSON format. Not recursive, direct imports only.

```json
{
"results": [
{
"path": "import/path/one",
"synopsis": "Package synopsis is here, if present."
},
{
"path": "import/path/two",
"synopsis": "Package synopsis is here, if present."
}
]
}
```

**api.godoc.org/imports/`ImportPath`**—Returns packages that ImportPath imports, in JSON format. Not recursive, direct imports only.

```json
{
"imports": [
{
"path": "import/path/one",
"synopsis": "Package synopsis is here, if present."
},
{
"path": "import/path/two",
"synopsis": "Package synopsis is here, if present."
}
],
"testImports": [
{
"path": "import/path/three",
"synopsis": "Package synopsis is here, if present."
}
]
}
```

A plain text interface is documented at <http://godoc.org/-/about>.
More documentation about this project is available on the [wiki](https://github.com/golang/gddo/wiki).
15 changes: 4 additions & 11 deletions gddo-server/assets/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ <h4 id="feedback">Feedback</h4>
<p>Send your ideas, feature requests and questions to the <a href="https://groups.google.com/group/golang-dev">golang-dev mailing list</a>.
Report bugs using the <a href="https://github.com/golang/gddo/issues/new">GitHub Issue Tracker</a>.

<h4 id="plain-text">Plain Text</h4>

GoDoc provides plain text output for integration with shell scripts. Use the
HTTP Accept header to request a plain text response.

<p>Search for packages with the term 'sql':
<pre>$ curl -H 'Accept: text/plain' http://godoc.org/?q=sql</pre>

<p>Get the documentation for the standard math package:
<pre>$ curl -H 'Accept: text/plain' http://godoc.org/math</pre>

<h4 id="shortcuts">Keyboard Shortcuts</h4>

<p>GoDoc has keyboard shortcuts for navigating package documentation
Expand All @@ -76,4 +65,8 @@ <h4 id="bookmarklet">Bookmarklet</h4>
bookmarklet, click and drag the following link to your bookmark bar: <a
href="javascript:window.location='http://{{.Host}}/?q='+encodeURIComponent(window.location)">GoDoc</a>

<h4>More Documentation</h4>

<p>More documentation about GoDoc is available on <a href="https://github.com/golang/gddo/wiki">the project's GitHub wiki</a>.

{{end}}

0 comments on commit 4ada458

Please sign in to comment.