Go to file
Erik Winter 969230f461 text edit 2022-04-06 06:43:31 +02:00
element fix codeblock ending 2022-03-31 06:27:37 +02:00
format fix html in code block formatting 2022-03-31 06:56:26 +02:00
parser fix codeblock ending 2022-03-31 06:27:37 +02:00
token decouple packages 2022-03-16 20:01:47 +01:00
LICENSE.txt start project 2022-03-10 06:09:17 +01:00
README.adoc text edit 2022-04-06 06:43:31 +02:00
adoc.go rename adoc.NewADoc to adoc.New 2022-03-29 06:13:52 +02:00
go.mod initial feature set 2022-03-12 17:13:37 +01:00
go.sum initial feature set 2022-03-12 17:13:37 +01:00

README.adoc

= README.adoc
2022-04-06

The beginnings of a parser for the https://asciidoc-py.github.io/index.html[Asciidoc] markup language.

== Example

----
package main

import (
  "fmt"
  "strings"

  "ewintr.nl/adoc/format"
  "ewintr.nl/adoc/parser"
)

func main() {
  sourceDoc := `= This is the title

And this is the first paragraph. With some text. Lists are supported too:

* Item 1
* Item 2
* Item 3

And we also have things like *bold* and _italic_.`

  par := parser.New(strings.NewReader(sourceDoc))
  doc := par.Parse()

  htmlDoc := format.HTML(doc)
  fmt.Println(htmlDoc)

  // output:
  //
  // <!DOCTYPE html>
  // <html>
  // <head>
  // <title>This is the title</title>
  // </head>
  // <body>
  // <p>And this is the first paragraph. With some text. Lists are supported too:</p>
  // <ul>
  // <li>Item 1</li>
  // <li>Item 2</li>
  // <li>Item 3</li>
  // </ul>
  // <p>And we also have things like <strong>bold</strong> and <em>italic</em>.</p>
  // </html>
}
----