Documentation
¶
Overview ¶
Package docx provides the public API for creating, reading, and modifying WordprocessingML (.docx) files. It re-exports the internal types as type aliases so that callers import a single package. This package mirrors the top-level API of python-docx.
Index ¶
- Constants
- func Cm(v float64) shared.Length
- func Emu(v int) shared.Length
- func Inches(v float64) shared.Length
- func Mm(v float64) shared.Length
- func Pt(v float64) shared.Length
- func Twips(v float64) shared.Length
- type BreakType
- type Cell
- type ColorFormat
- type Column
- type Comment
- type Comments
- type Document
- type Font
- type HeaderFooter
- type HeaderFooterType
- type Hyperlink
- type Image
- type InlineShape
- type InlineShapes
- type LatentStyle
- type LatentStyles
- type Length
- type MsoColorType
- type MsoThemeColor
- type NumberingPart
- type Paragraph
- type ParagraphFormat
- type RGBColor
- type RenderedPageBreak
- type Row
- type Run
- type Section
- type Settings
- type Style
- type Styles
- type TabStop
- type TabStops
- type Table
Constants ¶
const ( // BreakLine specifies a line break. BreakLine = otext.BreakLine // BreakPage specifies a page break. BreakPage = otext.BreakPage // BreakColumn specifies a column break. BreakColumn = otext.BreakColumn // BreakLineClearLeft specifies a line break with left-side text wrapping cleared. BreakLineClearLeft = otext.BreakLineClearLeft // BreakLineClearRight specifies a line break with right-side text wrapping cleared. BreakLineClearRight = otext.BreakLineClearRight // BreakLineClearAll specifies a line break with both-side text wrapping cleared. BreakLineClearAll = otext.BreakLineClearAll )
const ( HeaderFooterDefault = osect.HeaderFooterDefault HeaderFooterFirst = osect.HeaderFooterFirst HeaderFooterEven = osect.HeaderFooterEven )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ColorFormat ¶
type ColorFormat = dml.ColorFormat
ColorFormat represents the color formatting properties.
type Comments ¶
Comments represents a collection of document comments.
func NewComments ¶
func NewComments() *Comments
NewComments creates a new empty Comments collection.
type Document ¶
Document represents a WordprocessingML (docx) document.
func NewDocument ¶
func NewDocument() *Document
NewDocument creates a new empty Document with default styles and a single section.
type HeaderFooter ¶
type HeaderFooter = osect.HeaderFooter
HeaderFooter represents a header or footer associated with a section.
type HeaderFooterType ¶
type HeaderFooterType = osect.HeaderFooterType
HeaderFooterType identifies the type of header or footer (default, first, even).
type InlineShape ¶
type InlineShape = odoc.InlineShape
InlineShape represents an inline drawing or picture shape.
func NewInlineShape ¶
func NewInlineShape(typ string, width, height shared.Length) *InlineShape
NewInlineShape creates a new InlineShape with the given type, width, and height.
type InlineShapes ¶
type InlineShapes = odoc.InlineShapes
InlineShapes represents a collection of inline shapes (pictures, etc.).
func NewInlineShapes ¶
func NewInlineShapes() *InlineShapes
NewInlineShapes creates a new empty InlineShapes collection.
type LatentStyle ¶
type LatentStyle = styles.LatentStyle
LatentStyle represents a single latent (exception) style entry.
type LatentStyles ¶
type LatentStyles = styles.LatentStyles
LatentStyles provides access to latent style settings.
type MsoColorType ¶
type MsoColorType = dml.MsoColorType
MsoColorType identifies the type of color specification.
type MsoThemeColor ¶
type MsoThemeColor = dml.MsoThemeColor
MsoThemeColor identifies a theme color in the document theme.
type NumberingPart ¶
type NumberingPart = odoc.NumberingPart
NumberingPart manages numbered list definitions and numbering instances.
type ParagraphFormat ¶
type ParagraphFormat = otext.ParagraphFormat
ParagraphFormat provides access to paragraph-level formatting properties.
type RenderedPageBreak ¶
type RenderedPageBreak = otext.RenderedPageBreak
RenderedPageBreak represents a page break that has been rendered.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
dml
Package dml provides DrawingML types for working with Office Open XML drawing and color constructs.
|
Package dml provides DrawingML types for working with Office Open XML drawing and color constructs. |
|
enums
Package enums provides generic utilities for mapping between integer enum values and their XML string representations.
|
Package enums provides generic utilities for mapping between integer enum values and their XML string representations. |
|
image
Package image provides image decoding and DPI extraction for formats supported by OOXML.
|
Package image provides image decoding and DPI extraction for formats supported by OOXML. |
|
odoc
Package odoc provides the core document implementation for opening, creating, saving, and manipulating WordprocessingML documents.
|
Package odoc provides the core document implementation for opening, creating, saving, and manipulating WordprocessingML documents. |
|
opc
Package opc implements the Open Packaging Conventions (OPC) standard for reading and writing OOXML packages (.docx, .xlsx, .pptx).
|
Package opc implements the Open Packaging Conventions (OPC) standard for reading and writing OOXML packages (.docx, .xlsx, .pptx). |
|
opc/parts
Package parts provides higher-level OPC part implementations that wrap the core opc package types with domain-specific behaviour.
|
Package parts provides higher-level OPC part implementations that wrap the core opc package types with domain-specific behaviour. |
|
osect
Package osect provides types for document sections and headers/footers.
|
Package osect provides types for document sections and headers/footers. |
|
otable
Package otable provides high-level table objects (Table, Row, Cell, Column) wrapping oxml table proxy types, analogous to python-docx's table layer.
|
Package otable provides high-level table objects (Table, Row, Cell, Column) wrapping oxml table proxy types, analogous to python-docx's table layer. |
|
otext
Package otext provides high-level text formatting objects (Paragraph, Run, Font, Hyperlink, TabStops, etc.) that wrap oxml proxy types, analogous to the python-docx text layer.
|
Package otext provides high-level text formatting objects (Paragraph, Run, Font, Hyperlink, TabStops, etc.) that wrap oxml proxy types, analogous to the python-docx text layer. |
|
oxml
Package oxml provides Go proxy types for OOXML elements used in WordprocessingML documents.
|
Package oxml provides Go proxy types for OOXML elements used in WordprocessingML documents. |
|
oxml/dom
Package dom implements a lightweight in-memory XML DOM for OOXML document manipulation.
|
Package dom implements a lightweight in-memory XML DOM for OOXML document manipulation. |
|
oxml/ns
Package ns provides OOXML namespace URI constants, a prefix-to-URI map, and helpers for converting between Clark notation ({URI}local) and prefix:local notation.
|
Package ns provides OOXML namespace URI constants, a prefix-to-URI map, and helpers for converting between Clark notation ({URI}local) and prefix:local notation. |
|
oxml/stypes
Package stypes provides simple-type converters for OOXML schema types (ST_OnOff, ST_DecimalNumber, ST_String, ST_HexColor, ST_HpsMeasure).
|
Package stypes provides simple-type converters for OOXML schema types (ST_OnOff, ST_DecimalNumber, ST_String, ST_HexColor, ST_HpsMeasure). |
|
oxml/text
Package text provides XML proxy types for text-related OOXML elements: paragraph (w:p), run (w:r), font (w:rPr), hyperlink (w:hyperlink), and related formatting types.
|
Package text provides XML proxy types for text-related OOXML elements: paragraph (w:p), run (w:r), font (w:rPr), hyperlink (w:hyperlink), and related formatting types. |
|
oxml/xmodel
Package xmodel provides a declarative schema registry for OOXML parent-child relationships and the functions to query/manipulate elements according to that schema.
|
Package xmodel provides a declarative schema registry for OOXML parent-child relationships and the functions to query/manipulate elements according to that schema. |
|
parts
Package parts provides OPC part wrappers for document parts (DocumentPart, StylesPart, ImagePart, etc.), analogous to python-docx's parts layer.
|
Package parts provides OPC part wrappers for document parts (DocumentPart, StylesPart, ImagePart, etc.), analogous to python-docx's parts layer. |
|
shared
Package shared provides common types and utilities used across the go-docx library, including length units and RGB color representation.
|
Package shared provides common types and utilities used across the go-docx library, including length units and RGB color representation. |
|
styles
Package styles provides types for working with Word document styles, including Style, LatentStyles, and LatentStyle.
|
Package styles provides types for working with Word document styles, including Style, LatentStyles, and LatentStyle. |
|
testutil
Package testutil provides test helpers for the go-docx acceptance tests.
|
Package testutil provides test helpers for the go-docx acceptance tests. |
|
tpl
Package tpl embeds the default blank Word document template (default.docx).
|
Package tpl embeds the default blank Word document template (default.docx). |
|
test
|
|