From 2402780f5fd37ffc355df81c539bdd09a526c3f9 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 1 Oct 2009 14:08:00 -0700 Subject: Factored out boilerplate from all html docs in doc directory: - 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 --- doc/effective_go.html | 75 ++++------------------------------------- doc/go_for_cpp_programmers.html | 73 +-------------------------------------- doc/go_lang_faq.html | 64 +---------------------------------- doc/go_mem.html | 62 +--------------------------------- doc/go_spec.html | 73 +-------------------------------------- doc/go_tutorial.head | 7 +--- doc/go_tutorial.html | 12 ++----- 7 files changed, 15 insertions(+), 351 deletions(-) (limited to 'doc') diff --git a/doc/effective_go.html b/doc/effective_go.html index e9a1e2581..d72525c99 100644 --- a/doc/effective_go.html +++ b/doc/effective_go.html @@ -1,64 +1,7 @@ - - - + - - Effective Go - - - - - - - - - - - -
- - - - -
-Go Home Page -The Go Programming Language
-
- - - -
- -

Effective Go

- - - - -

Introduction

@@ -187,7 +130,7 @@ x<<8 + y<<16

Commentary

-Go provides C-style /* */ block comments +Go provides C-style /* */ block comments and C++-style // line comments. Line comments are the norm; block comments appear mostly as package comments and @@ -752,7 +695,7 @@ The return or result "parameters" of a Go function can be given names and used as regular variables, just like the incoming parameters. When named, they are initialized to the zero for their type when the function begins; if the function executes a return statement -with no arguments, the current values of the result parameters are +with no arguments, the current values of the result parameters are used as the returned values.

@@ -938,7 +881,7 @@ must be initialized before use. A slice, for example, is a three-item descriptor containing a pointer to the data (inside an array), the length, and the capacity; until those items are initialized, the slice is nil. -For slices, maps, and channels, +For slices, maps, and channels, make initializes the internal data structure and prepares the value for use. For instance, @@ -1066,7 +1009,7 @@ header, body, checksum := buf[0:20], buf[20:n-4], buf[n-4:n]; Especially in libraries, functions tend to have multiple error modes. Instead of returning a boolean to signal success, return an os.Error that describes the failure. -Even if there is only one failure mode now, +Even if there is only one failure mode now, there may be more later.

@@ -1255,9 +1198,9 @@ This data-driven style dominates in the Go package tests.

The reflect.DeepEqual function tests whether two complex data structures have equal values. -If a function returns a complex data structure, +If a function returns a complex data structure, reflect.DeepEqual combined with table-driven testing -makes it easy to check that the return value is +makes it easy to check that the return value is exactly as expected.

@@ -1337,7 +1280,3 @@ lets readers concentrate on big ones.

--> - -
- - diff --git a/doc/go_for_cpp_programmers.html b/doc/go_for_cpp_programmers.html index 14ed14957..055242f71 100644 --- a/doc/go_for_cpp_programmers.html +++ b/doc/go_for_cpp_programmers.html @@ -1,59 +1,4 @@ - - - - - - - - Go For C++ Programmers - - - - - - - - -
- - - - -
-Go Home Page -The Go Programming Language
-
- - - -
- -

Go For C++ Programmers

+

Go is a systems programming language intended as an alternative to C++. @@ -72,11 +17,6 @@ For a detailed description of the Go language, see the

There is more documentation about go. - - -

-

Conceptual Differences

- - - - - diff --git a/doc/go_lang_faq.html b/doc/go_lang_faq.html index 142a22485..e40c3b036 100644 --- a/doc/go_lang_faq.html +++ b/doc/go_lang_faq.html @@ -1,54 +1,4 @@ - - - - - - The Go Programming Language Design FAQ - - - - - - - - -
- - - - -
-Go Home Page -The Go Programming Language
-
- - - -
- -

The Go Programming Language Design FAQ

- - - - +

Origins

@@ -416,15 +366,3 @@ why no automatic numeric conversions? make vs new - - -
- - - - - diff --git a/doc/go_mem.html b/doc/go_mem.html index 9239e9871..d2167a66a 100644 --- a/doc/go_mem.html +++ b/doc/go_mem.html @@ -1,64 +1,4 @@ - - - - - - - - The Go Memory Model - - - - - - - - -
- - - - -
-Go Home Page -The Go Programming Language
-
- - - -
- -

The Go Memory Model

- - - - +

Introduction

diff --git a/doc/go_spec.html b/doc/go_spec.html index d49a4a075..afb85de02 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,64 +1,4 @@ - - - - - - - - The Go Programming Language Specification - - - - - - - - -
- - - - -
-Go Home Page -The Go Programming Language
-
- - - -
- -

The Go Programming Language Specification

- - - - + - +

Introduction

diff --git a/doc/go_tutorial.html b/doc/go_tutorial.html index 1029d744d..755e43db8 100644 --- a/doc/go_tutorial.html +++ b/doc/go_tutorial.html @@ -1,8 +1,4 @@ -

Let's Go

- - - +

Introduction

@@ -602,7 +598,7 @@ Finally we can run the program: % helloworld3 hello, world can't open file; err=No such file or directory - % + %

Rotting cats

@@ -770,7 +766,7 @@ Here it is in action: abcdefghijklmnopqrstuvwxyz % echo abcdefghijklmnopqrstuvwxyz | ./cat --rot13 nopqrstuvwxyzabcdefghijklm - % + %

Fans of dependency injection may take cheer from how easily interfaces @@ -1354,5 +1350,3 @@ at the end of main: There's a lot more to Go programming and concurrent programming in general but this quick tour should give you some of the basics. - - -- cgit v1.2.3