-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathasciidocgo.go
63 lines (45 loc) · 1.29 KB
/
asciidocgo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Asciidocgo implements an AsciiDoc renderer in Go.
Methods for parsing Asciidoc input files and rendering documents using eRuby
templates.
Asciidoc documents comprise a header followed by zero or more sections.
Sections are composed of blocks of content. For example:
= Doc Title
== Section 1
This is a paragraph block in the first section.
== Section 2
This section has a paragraph block and an olist block.
. Item 1
. Item 2
Examples:
Use built-in templates:
lines = File.readlines("your_file.asc")
doc = Asciidoctor::Document.new(lines)
html = doc.render
File.open("your_file.html", "w+") do |file|
file.puts html
end
Use custom (Tilt-supported) templates:
lines = File.readlines("your_file.asc")
doc = Asciidoctor::Document.new(lines, :template_dir => 'templates')
html = doc.render
File.open("your_file.html", "w+") do |file|
file.puts html
end
*/
package asciidocgo
import "io"
// Accepts input as a string
func LoadString(input string) *Document {
return nil
}
// Accepts input as an array of strings
func LoadStrings(inputs ...string) *Document {
return nil
}
// Accepts input as an IO.
// If the input is a File, information about the file is stored in attributes on
// the Document object.
func Load(input io.Reader) *Document {
return nil
}