meta: add more documentation

This commit is contained in:
Todd 2017-08-29 23:07:54 -05:00
parent d27beada57
commit 9237920cf3
5 changed files with 59 additions and 1 deletions

14
common/doc.go Normal file
View File

@ -0,0 +1,14 @@
// Copyright 2017 Baliance. All rights reserved.
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
/*
Package common contains wrapper types and utilities common to all of the OOXML
document formats.
*/
package common

View File

@ -28,7 +28,8 @@ func RegisterConstructor(ns, name string, fn interface{}) {
creatorFns[ns+"/"+name] = fn creatorFns[ns+"/"+name] = fn
} }
// CreateElement creates an element with the given namespace and name. // CreateElement creates an element with the given namespace and name. It is
// used to unmarshal some xsd:any elements to the appropriate concrete type.
func CreateElement(start xml.StartElement) (Any, error) { func CreateElement(start xml.StartElement) (Any, error) {
fn, ok := creatorFns[start.Name.Space+"/"+start.Name.Local] fn, ok := creatorFns[start.Name.Space+"/"+start.Name.Local]
if !ok { if !ok {

26
doc.go Normal file
View File

@ -0,0 +1,26 @@
// Copyright 2017 Baliance. All rights reserved.
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
/*
Package gooxml provides creation, reading, and writing of ECMA 376 Open Office
XML documents, spreadsheets and presentations. It is still early in
development, but is progressing quickly. This library takes a slightly
different approach from others, in that it starts by trying to support all of
the ECMA-376 standard when marshaling/unmarshaling XML documents. From there it
adds wrappers around the ECMA-376 derived types that provide a more convenient
interface.
The raw XML based types reside in the ```schema/``` directory. These types are
always accessible from the wrapper types via a ```X()``` method that returns the
raw type. Except for the base documents (document.Document,
spreadsheet.Workbook and presentation.Presentation), the other wrapper types are
value types with non-pointer methods. They exist solely to modify and return
data from one or more XML types.
*/
package gooxml

View File

@ -7,39 +7,49 @@
package gooxml package gooxml
// Float64 returns a copy of v as a pointer.
func Float64(v float64) *float64 { func Float64(v float64) *float64 {
x := v x := v
return &x return &x
} }
// Uint32 returns a copy of v as a pointer.
func Uint32(v uint32) *uint32 { func Uint32(v uint32) *uint32 {
x := v x := v
return &x return &x
} }
// Int32 returns a copy of v as a pointer.
func Int32(v int32) *int32 { func Int32(v int32) *int32 {
x := v x := v
return &x return &x
} }
// Int64 returns a copy of v as a pointer.
func Int64(v int64) *int64 { func Int64(v int64) *int64 {
x := v x := v
return &x return &x
} }
// Bool returns a copy of v as a pointer.
func Bool(v bool) *bool { func Bool(v bool) *bool {
x := v x := v
return &x return &x
} }
// String returns a copy of v as a pointer.
func String(v string) *string { func String(v string) *string {
x := v x := v
return &x return &x
} }
// Int returns a copy of v as a pointer.
func Int(v int) *int { func Int(v int) *int {
x := v x := v
return &x return &x
} }
// Uint64 returns a copy of v as a pointer.
func Uint64(v uint64) *uint64 { func Uint64(v uint64) *uint64 {
x := v x := v
return &x return &x

7
update-godoc.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
for file in `find . -type d -not -ipath "*git*" -print`; do
url=`echo $file | sed 's#^.#https://godoc.org/baliance.com/gooxml#'`
echo $url
curl -s $url -o /dev/null
sleep 10
done