Documentation ¶
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDigest(name string) ([sha256.Size]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func AssetString(name string) (string, error)
- func Digests() (map[string][sha256.Size]byte, error)
- func MustAsset(name string) []byte
- func MustAssetString(name string) string
- func QuipToMarkdown(q string) (string, error)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
Constants ¶
const ( UnorderedList string = "5" OrderedList string = "6" CheckedList string = "7" )
const ( Bold string = "b" Italic string = "i" Underline string = "u" Strikethrough string = "del" CodeInline string = "code" Anchor string = "a" Highlight string = "annotation" H1 string = "h1" H2 string = "h2" H3 string = "h3" CodeBlock string = "pre" Paragraph string = "p" BlockQuote string = "blockquote" )
const ZERO_WIDTH_SPACE = "\u200b"
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDigest ¶
AssetDigest returns the digest of the file with the given name. It returns an error if the asset could not be found or the digest could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"}, AssetDir("data/img") would return []string{"a.png", "b.png"}, AssetDir("foo.txt") and AssetDir("notexist") would return an error, and AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetString ¶
AssetString returns the asset contents as a string (instead of a []byte).
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func MustAssetString ¶
MustAssetString is like AssetString but panics when Asset would return an error. It simplifies safe initialization of global variables.
func QuipToMarkdown ¶
QuipToMarkdown converts HTML from Quip HTML as string to sane Markdown
Supported Features:
- Headers 1-3
- Bold
- Italics
- Underline [*]
- Strikethrough [*]
- Inline Code
- Hyperlinks
- Unordered Lists
- Ordered Lists
- Checked Lists w/ check marks maintained
- Nested lists w/ a-z and roman numerals on unordered lists
- Quote Blocks w/ maintained text styling
- Code Blocks - including adjacent ones
Caveats [*]:
- Not every Markdown renderer supports underline the same way. We use `_this_`
- Not every Markdown renderer supports strikethrough. We use `~~this~~`
- Highlighted text will be converted with no styling applied
Funny Quip HTML quirks:
- Everything is within a tag. Each tag is on it's own line
- Between paragraphs, there's a paragraph tag with 200b (unicod zero width space)
- <li> ends with </span><br/></li>
- Type of list is dictated by the class with starting value in attr
- Nested lists are tracked with class=parent on <li>
- Checked list checks are tracked by class=checked
- Code blocks are dictated by class=prettyprint. All content on one line in HTML
- For conversion purposes, almost all metadata can be ignored
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory.
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively.
Types ¶
This section is empty.