Documentation
¶
Overview ¶
Package blocks provides some of the Mycomarkup's blocks.
Index ¶
- func LinkParts(addr, display, hyphaName string) (href, text, class string)
- func MatchesImg(line string) bool
- func MatchesList(line string) bool
- func MatchesTable(line string) bool
- func ParagraphToHtml(hyphaName, input string) string
- func Rocketlink(src, hyphaName string) (href, text, class string)
- type Block
- type HorizontalLine
- type Img
- type ImgEntry
- type List
- type NestingBlock
- type Paragraph
- type Table
- type TerminalBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LinkParts ¶
LinkParts determines what href, text and class should resulting <a> have based on mycomarkup's addr, display and hypha name.
=> addr display [[addr|display]] TODO: deprecate
func MatchesImg ¶
func MatchesList ¶
func MatchesTable ¶
func ParagraphToHtml ¶
func Rocketlink ¶
Parse markup line starting with "=>" according to wikilink rules. See http://localhost:1737/page/wikilink
Types ¶
type Block ¶
type Block interface { // String returns a debug string representation of the block. String() string // ID returns an id for the block which may be utilised in markup languages. It may not be unique. ID() string // IsNesting returns true if the block can contain other blocks. IsNesting() bool }
Block is a unit of Mycomarkup. It is somewhat analogous to HTML's tags.
type HorizontalLine ¶
type HorizontalLine struct { TerminalBlock // contains filtered or unexported fields }
HorizontalLine represents the horizontal line block.
In Mycomarkup it is written like that:
----
func MakeHorizontalLine ¶
func MakeHorizontalLine(src string) HorizontalLine
func (*HorizontalLine) ID ¶
func (h *HorizontalLine) ID() string
func (*HorizontalLine) String ¶
func (h *HorizontalLine) String() string
type Img ¶
type Img struct { Entries []ImgEntry // contains filtered or unexported fields }
func ImgFromFirstLine ¶
func (*Img) HasOneImage ¶ added in v0.1.1
HasOneImage returns true if img has exactly one image and that images has no description.
func (*Img) MarkExistenceOfSrcLinks ¶ added in v0.1.1
func (img *Img) MarkExistenceOfSrcLinks()
type ImgEntry ¶ added in v0.1.1
ImgEntry is an entry of an image gallery. It can only be nested into Img.
func (*ImgEntry) DescriptionAsHtml ¶ added in v0.1.1
func (*ImgEntry) SizeHAsAttr ¶ added in v0.1.1
func (*ImgEntry) SizeWAsAttr ¶ added in v0.1.1
type List ¶
type List struct {
// contains filtered or unexported fields
}
A structure representing ordered and unordered lists in the AST.
func (*List) RenderAsHtml ¶
type NestingBlock ¶
type NestingBlock struct{}
func (*NestingBlock) IsNesting ¶
func (ns *NestingBlock) IsNesting() bool
type Paragraph ¶
type Paragraph struct { TerminalBlock *bytes.Buffer // contains filtered or unexported fields }
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func TableFromFirstLine ¶
type TerminalBlock ¶
type TerminalBlock struct{}
func (*TerminalBlock) IsNesting ¶
func (tb *TerminalBlock) IsNesting() bool
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package img_helper is an encapsulated helper module for the Img block.
|
Package img_helper is an encapsulated helper module for the Img block. |