diff options
| author | Shulhan <ms@kilabit.info> | 2020-12-24 06:29:38 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2020-12-24 06:29:38 +0700 |
| commit | dfcdbe8567c54cb19b470e5c52c23308c0bd4591 (patch) | |
| tree | 90a25328a9394d232bb10d3bd71901e1103c29d5 | |
| parent | 06383abe83ff7e7a7e8717e4546782ce0c3a0aea (diff) | |
| download | asciidoctor-go-dfcdbe8567c54cb19b470e5c52c23308c0bd4591.tar.xz | |
document: rename ToEmbeddedHTML to ToHTMLEmbedded
This is for consistency on exported method names on Document object.
While at it, simplify the documentation for exported methods.
| -rw-r--r-- | document.go | 13 | ||||
| -rw-r--r-- | document_parser_test.go | 4 | ||||
| -rw-r--r-- | html_backend.go | 2 | ||||
| -rw-r--r-- | parser_paragraph_test.go | 2 |
4 files changed, 10 insertions, 11 deletions
diff --git a/document.go b/document.go index 71fb7e1..6d7ea97 100644 --- a/document.go +++ b/document.go @@ -118,10 +118,10 @@ func Open(file string) (doc *Document, err error) { } // -// ToEmbeddedHTML convert the Document object into HTML with content only -// (without header and footer). +// ToHTMLEmbedded convert the Document object into HTML with content only, +// without header and footer. // -func (doc *Document) ToEmbeddedHTML(out io.Writer) (err error) { +func (doc *Document) ToHTMLEmbedded(out io.Writer) (err error) { doc.isEmbedded = true doc.generateClasses() buf := &bytes.Buffer{} @@ -132,8 +132,7 @@ func (doc *Document) ToEmbeddedHTML(out io.Writer) (err error) { } // -// ToHTML convert the asciidoc document into full HTML document, including -// head and body. +// ToHTML convert the Document object into full HTML document. // func (doc *Document) ToHTML(out io.Writer) (err error) { doc.generateClasses() @@ -189,8 +188,8 @@ func (doc *Document) ToHTML(out io.Writer) (err error) { } // -// ToHTMLBody convert the Document object body into HTML, this is including -// header, content, and footer. +// ToHTMLBody convert the Document object into HTML with body only, this is +// including header, content, and footer. // func (doc *Document) ToHTMLBody(out io.Writer) (err error) { doc.generateClasses() diff --git a/document_parser_test.go b/document_parser_test.go index b186a52..e64edd7 100644 --- a/document_parser_test.go +++ b/document_parser_test.go @@ -33,7 +33,7 @@ func TestParse_metaDocTitle(t *testing.T) { for _, c := range cases { doc := Parse([]byte(c.content)) buf.Reset() - err := doc.ToEmbeddedHTML(&buf) + err := doc.ToHTMLEmbedded(&buf) if err != nil { t.Fatal(err) } @@ -259,7 +259,7 @@ Paragraph C. doc := Parse(content) got := bytes.Buffer{} - err := doc.ToEmbeddedHTML(&got) + err := doc.ToHTMLEmbedded(&got) if err != nil { t.Fatal(err) } diff --git a/html_backend.go b/html_backend.go index efe54ec..b789b6a 100644 --- a/html_backend.go +++ b/html_backend.go @@ -669,7 +669,7 @@ func htmlWriteTableRow(doc *Document, table *elementTable, row *tableRow, out io case colStyleAsciidoc: subdoc := parseSub(doc, contentTrimmed) fmt.Fprint(out, "\n<div id=\"content\">") - _ = subdoc.ToEmbeddedHTML(out) + _ = subdoc.ToHTMLEmbedded(out) fmt.Fprint(out, "\n</div>") case colStyleDefault: diff --git a/parser_paragraph_test.go b/parser_paragraph_test.go index f453867..386d6da 100644 --- a/parser_paragraph_test.go +++ b/parser_paragraph_test.go @@ -28,7 +28,7 @@ This is the ultimate paragraph.`), for _, c := range cases { subdoc := parseSub(parentDoc, c.content) out.Reset() - err := subdoc.ToEmbeddedHTML(&out) + err := subdoc.ToHTMLEmbedded(&out) if err != nil { t.Fatal(err) } |
