summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/godoc.go
AgeCommit message (Collapse)AuthorFilesLines
2009-12-15 1) Change default gofmt default settings forRobert Griesemer1-300/+300
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 1st set of files. R=rsc CC=agl, golang-dev, iant, ken2, r http://codereview.appspot.com/180047
2009-12-14don't show semicolons anymore with godocRobert Griesemer1-1/+1
R=rsc http://codereview.appspot.com/174078
2009-12-02move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.Rob Pike1-5/+6
this breaks the dependency of package io on package bytes. R=rsc CC=golang-dev http://codereview.appspot.com/163085
2009-12-01some godoc cleanup:Robert Griesemer1-97/+27
- simplified dealing with parse errors: no need to intersperse them in the source - improve visibility of highlighted identifiers by showing them in bold R=rsc http://codereview.appspot.com/163051
2009-11-24godoc: plug file descriptor leakRuss Cox1-0/+1
R=gri CC=r http://codereview.appspot.com/157149
2009-11-20gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkgRuss Cox1-5/+5
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
2009-11-16Don't emit line tags when source code is printed as part ofRobert Griesemer1-3/+10
package documentation using templates. The line tag interferes with the anchor tag introduces by the template. This fixes an an issue where some headers lost their ability to link to the respective source code. R=rsc http://codereview.appspot.com/154166
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer1-13/+13
rsc's algorithm - applied gofmt -w misc src - partial CL (remaining files in other CLs) R=rsc, r http://go/go-review/1024040
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer1-64/+64
R=rsc, r http://go/go-review/1025029
2009-11-08Addressing issue brought up by dsymonds:Robert Griesemer1-1/+2
- When providing alternative spellings to a query, do not prefix it with a package qualifier as the suggestion may not have any results. Correctly filtering is quite a bit of work, and clicking the alternative spelling will always also show the qualified hits if they exist (but also others). Seems good enough for now. - Give user feedback when the query syntax was wrong. - Package names in search results are now links to the respective package documentation. - Experimented with excluding main packages and test files from index with inconclusive results. Code is present and can be enabled by changing a flag in the source. This needs some more work. R=rsc CC=r, dsymonds http://go/go-review/1026033
2009-11-08improved sentence extraction:Robert Griesemer1-10/+28
- don't forget first periods - look at capitalization of last char before periods R=rsc http://go/go-review/1024027
2009-11-08a nagging inconsistency: capitalization ofRuss Cox1-42/+42
HTML vs Html, URL vs Url, HTTP vs Http, current source is 6:1 in favor of the former, so change instances of the latter. R=r CC=go-dev http://go/go-review/1024026
2009-11-08use grouping instead of colors to show non-global search hits:Robert Griesemer1-16/+14
- introduced a new run per file containing all spots belonging to the same kind (e.g. var decl, const decl, etc.) - more comments, better index.go file organization R=rsc http://go/go-review/1026028
2009-11-08fix sentence extractionRobert Griesemer1-6/+13
R=rsc http://go/go-review/1026027
2009-11-08- properly align package synopsesRobert Griesemer1-31/+153
(this was surprisingly hard to get right in HTML) - show modification times in source directory listings - various tweaks R=rsc http://go/go-review/1024024
2009-11-08TBRRobert Griesemer1-1/+1
1st step of renaming dirList.html -> dirlist.html (OS X filenames are not capitalization-sensitive) R=rsc http://go/go-review/1024021
2009-11-08- better support for text files: show them nicely formattedRobert Griesemer1-21/+88
instead of serving them raw - path-related cleanups R=rsc http://go/go-review/1026021
2009-11-07- added link to sourcesRobert Griesemer1-5/+5
- renamed listing.html -> dirList.html (there is a dirs.html already, it should probably have a better name, too) R=rsc http://go/go-review/1025020
2009-11-07nice directory listingsRobert Griesemer1-9/+46
R=rsc http://go/go-review/1026020
2009-11-07- support to extract one-line package synopsis for package listingsRobert Griesemer1-2/+25
- formatting in dirs.html is crude, needs better html (open to suggestions), but shows the synopsis - many package comments should probably be adjusted such that the first sentence is more concise R=rsc, iant http://go/go-review/1025014
2009-11-05gofmt'ed src/cmdRobert Griesemer1-26/+25
R=rsc http://go/go-review/1024004
2009-11-04remove reference to /home/rRobert Griesemer1-1/+1
R=rsc http://go/go-review/1018039
2009-11-03support for command documentation:Robert Griesemer1-35/+82
- made package tree handler generic so it can work on any fs tree - cleanups along the way R=rsc CC=r http://go/go-review/1017020
2009-11-03use default styler when there is no other givenRobert Griesemer1-2/+6
(No visual change yet since the comments for exported code snippets - as shown on the pkg page - are not yet formatted using the standard comment intersperse mechanism in the printer. This is a TODO in the printer.) R=rsc http://go/go-review/1016031
2009-11-02- show recursive package directory structure in package pagesRobert Griesemer1-78/+89
- removed some underbars in section headings for better looks - various minor tweaks R=rsc http://go/go-review/1018026
2009-11-02forgot to count newlines when scanning white space.Rob Pike1-2/+2
also fix a error-printing bug in godoc. R=gri http://go/go-review/1016030
2009-11-02- initial steps towards showing directory tree instead ofRobert Griesemer1-7/+85
just a single directory - all pieces present but not well integrated - directory tree served at the moment under /tree R=rsc http://go/go-review/1018016
2009-10-30split godoc/godoc.go into godoc/godoc.goRuss Cox1-204/+23
and godoc/main.go. R=gri CC=r http://go/go-review/1017005
2009-10-28- added missing formatters in templatesRobert Griesemer1-6/+16
- replaced deprecated use of </font> with </span> tag - added html escaping to godoc formatters where missing - enabled text format for package documentation R=rsc http://go/go-review/1017001
2009-10-27godoc search bug fixes:Robert Griesemer1-0/+1
- sort by package name (instead of package path) for results with snippets - sort line numbers in results without snippets - properly characterize package clauses - experiment with a leaner look: no underlines for top-level godoc links in the left side bar Still using colors to distinguish results. Next step. R=rsc http://go/go-review/1015016
2009-10-27code search for godoc:Robert Griesemer1-46/+163
- added goroutine to automatically index in the background - added handler for search requests - added search box to top-level godoc template - added search.html template for the display of search results - changes to spec.go because of name conflicts - added extra styles to style.css (for shorter .html files) R=rsc http://go/go-review/1014011
2009-10-24remove reference to p4 in comment.Rob Pike1-1/+1
R=gri CC=rsc http://go/go-review/1014008
2009-10-23fix computation of sync delayRobert Griesemer1-3/+3
R=rsc http://go/go-review/1013011
2009-10-22- make printer interface easily extensible w/o breaking clients (in the future)Robert Griesemer1-1/+1
- replacement for p4 CL 35999 (abandoned) R=rsc http://go/go-review/1012010
2009-10-22go/printer:Robert Griesemer1-51/+98
- handle HTML tagging via (client-installable) Stylers go/doc: - basic styler support - some factoring - ready to contain the search code (but for now excluded) doc/style.css: - updated doc/go_spec.css: - cleanup: replace deprecated uses of <font> tag with <span> tag R=rsc DELTA=302 (160 added, 62 deleted, 80 changed) OCL=35973 CL=35996
2009-10-08more lgtm files from gofmtRuss Cox1-79/+85
R=gri OCL=35485 CL=35488
2009-10-01Factored out boilerplate from all html docs in doc directory:Robert Griesemer1-42/+75
- the first HTML comment in those files is extracted as page title when serving them - lib/godoc.html is top-level template for all pages served - experimented a bit with package documentation layout (feedback welcome) - various related cleanups TODO: - The / page (doc/root.html) content repeats links that are in the navigation bar. It needs to be cleaned up. R=rsc DELTA=826 (86 added, 692 deleted, 48 changed) OCL=35230 CL=35245
2009-09-17unused importsRuss Cox1-2/+0
R=r OCL=34731 CL=34731
2009-09-16rename bytes.Buffer.Data() to bytes.Buffer.Bytes()Rob Pike1-10/+10
R=rsc DELTA=152 (6 added, 0 deleted, 146 changed) OCL=34695 CL=34701
2009-09-03linkify EBNF sections in spec when served via godocRobert Griesemer1-1/+15
R=rsc DELTA=217 (216 added, 0 deleted, 1 changed) OCL=34279 CL=34306
2009-08-28- exponentially back off auto-sync'ing instead disabling it in case of failureRobert Griesemer1-12/+44
R=rsc DELTA=48 (35 added, 3 deleted, 10 changed) OCL=34030 CL=34034
2009-08-20exclude _test from godoc as well as _obj.Russ Cox1-1/+1
R=gri DELTA=1 (0 added, 0 deleted, 1 changed) OCL=33586 CL=33590
2009-08-19produce diagnostic forRuss Cox1-3/+3
import "fmt" var fmt = 1 R=ken OCL=33556 CL=33561
2009-08-03printer.go:Robert Griesemer1-7/+26
- emit line tag id's in html mode - support for general html tags - better names for a few identifiers godoc.go: - emit links from exported names to source code (actual placement needs fine-tuning) R=rsc DELTA=108 (68 added, 4 deleted, 36 changed) OCL=32639 CL=32654
2009-07-31printer:Robert Griesemer1-31/+36
- prepare for generation of HTML id tags and links - do HTML-escaping in central print routine - move tabwriter setup into printer - fixed various TODOs godoc: - removed tabwriter setup, need for various HTML-escaping R=rsc DELTA=210 (107 added, 36 deleted, 67 changed) OCL=32612 CL=32616
2009-07-30- don't call String method of AST nodes when converting them to textRobert Griesemer1-3/+5
- make token.Position.String more robust TBR=rsc DELTA=20 (10 added, 6 deleted, 4 changed) OCL=32564 CL=32564
2009-07-30go/ast/filter.go:Robert Griesemer1-6/+2
- more orthogonal functionality of filter functions for better re-use go/doc/doc.go: - simplified interface - collect filenames of packages so that they can be shown godoc: - removed TODO, show list of package (linked) files used to create documentation R=rsc DELTA=130 (68 added, 24 deleted, 38 changed) OCL=32549 CL=32552
2009-07-29parser:Robert Griesemer1-136/+69
- Changed filter function for parser.ParsePackage to take an *os.Dir instead of a filename for more powerful filters - Removed TODO in ast.PackageInterface: Now collect package comments from all package files - Cleanups in godoc: Use the new ParsePackage and PackageInterface functions; as a result computing package information is much simpler now. R=rsc DELTA=285 (80 added, 110 deleted, 95 changed) OCL=32473 CL=32486
2009-07-28Intersperse comments nicely when printing an AST.Robert Griesemer1-5/+1
gofmt formatted source code looks pretty good already; with a bit more fine-tuning it should be great. printer.go: - Implemented comment intersperse algorithm. The approach is a result of many trial-and-error experiments but at this point reasonably simple and open to arbitrary fine-tuning. parser.go: - Simplified handling of lead and line comments (formerly called leading and trailing comments). - Use a comments list instead of an array (I may change this back - this is not obviously better and uses more space). doc.go: - Remove comments from AST nodes that have been 'consumed' in the documentation to avoid duplicate printing of them. Allows for better control of what is printed w/o use of printing control flags (which are hard to use and not fine-grained enough). Corresponding adjustments to various clients of these files. R=rsc DELTA=478 (275 added, 108 deleted, 95 changed) OCL=32185 CL=32380
2009-07-16ast:Robert Griesemer1-9/+11
- renamed Program -> SourceFile - added Package node representing the AST for an entire package - added filter function to create a source file mimicking the interface of an entire package parser: - parser entry to parse entire packages - unified naming of parser entry points - factored out entry points into new file (interface.go) gofmt: - extended to accept single .go files, and package paths: gofmt file.go // formatting of a single file gofmt -x file.go // interface of a single file gofmt -x ./MyPackage // interface of a local package gofmt -x math // interface of a $GOROOT relative package Various adjustments in dependent files, documentation. R=rsc DELTA=634 (369 added, 153 deleted, 112 changed) OCL=31743 CL=31748