aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--document.go4
-rw-r--r--document_attribute.go10
2 files changed, 10 insertions, 4 deletions
diff --git a/document.go b/document.go
index aa89434..1fa88ed 100644
--- a/document.go
+++ b/document.go
@@ -215,8 +215,8 @@ func (doc *Document) ToHTML(out io.Writer) (err error) {
var ok bool
- _, ok = doc.Attributes.Entry[docAttrStylesheet]
- if ok {
+ docAttrValue, ok = doc.Attributes.Entry[DocAttrStylesheet]
+ if ok && len(docAttrValue) == 0 {
buf.WriteByte('\n')
buf.WriteString(_defaultCSS)
}
diff --git a/document_attribute.go b/document_attribute.go
index 9419084..3217c16 100644
--- a/document_attribute.go
+++ b/document_attribute.go
@@ -11,6 +11,13 @@ const (
DocAttrGenerator = `generator`
DocAttrKeywords = `keywords`
+ // By default, the document contains ":stylesheet:" attribute, which
+ // means using the default embedded CSS.
+ // To disable it, unset the attribute using ":stylesheet!:".
+ // To overwrite it, set the attribute to path of CSS file
+ // ":stylesheet: my.css".
+ DocAttrStylesheet = `stylesheet`
+
docAttrAuthorInitials = `authorinitials`
docAttrDocdir = `docdir`
docAttrDocTitle = `doctitle`
@@ -36,7 +43,6 @@ const (
docAttrSectNumLevel = `sectnumlevels`
docAttrSectNums = `sectnums`
docAttrShowTitle = `showtitle`
- docAttrStylesheet = `stylesheet`
docAttrTOC = `toc`
docAttrTOCLevels = `toclevels`
docAttrTOCTitle = `toc-title`
@@ -70,7 +76,7 @@ func newDocumentAttribute() DocumentAttribute {
docAttrLastUpdateValue: ``,
docAttrSectIDs: ``,
docAttrShowTitle: ``,
- docAttrStylesheet: ``,
+ DocAttrStylesheet: ``, // Default to embedded CSS.
docAttrTableCaption: ``,
docAttrVersionLabel: ``,
},