All Projects → bytesparadise → Libasciidoc

bytesparadise / Libasciidoc

Licence: apache-2.0
A Golang library for processing Asciidoc files.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Libasciidoc

Pynlpl
PyNLPl, pronounced as 'pineapple', is a Python library for Natural Language Processing. It contains various modules useful for common, and less common, NLP tasks. PyNLPl can be used for basic tasks such as the extraction of n-grams and frequency lists, and to build simple language model. There are also more complex data types and algorithms. Moreover, there are parsers for file formats common in NLP (e.g. FoLiA/Giza/Moses/ARPA/Timbl/CQL). There are also clients to interface with various NLP specific servers. PyNLPl most notably features a very extensive library for working with FoLiA XML (Format for Linguistic Annotation).
Stars: ✭ 426 (+230.23%)
Mutual labels:  library, text-processing
Lingua Franca
Mycroft's multilingual text parsing and formatting library
Stars: ✭ 51 (-60.47%)
Mutual labels:  library, text-processing
Colibri Core
Colibri core is an NLP tool as well as a C++ and Python library for working with basic linguistic constructions such as n-grams and skipgrams (i.e patterns with one or more gaps, either of fixed or dynamic size) in a quick and memory-efficient way. At the core is the tool ``colibri-patternmodeller`` whi ch allows you to build, view, manipulate and query pattern models.
Stars: ✭ 112 (-13.18%)
Mutual labels:  library, text-processing
Orcharts
饼状图、环形图、扇形图、曲线图、折线图
Stars: ✭ 125 (-3.1%)
Mutual labels:  library
Honkit
📖 HonKit is building beautiful books using Markdown - Fork of GitBook
Stars: ✭ 1,901 (+1373.64%)
Mutual labels:  asciidoc
Kite
🪁 Android Resources Wrapper Library
Stars: ✭ 127 (-1.55%)
Mutual labels:  library
Bash Argsparse
An high level argument parsing library for bash
Stars: ✭ 128 (-0.78%)
Mutual labels:  library
Fosite
Extensible security first OAuth 2.0 and OpenID Connect SDK for Go.
Stars: ✭ 1,738 (+1247.29%)
Mutual labels:  library
Arduinosim800l
Arduino HTTP & FTP client for SIM800L/SIM800 boards to perform GET and POST requests to a JSON API as well as FTP uploads.
Stars: ✭ 127 (-1.55%)
Mutual labels:  library
Libideviceactivation
A library to handle the activation process of iOS devices
Stars: ✭ 126 (-2.33%)
Mutual labels:  library
Pulsesensorplayground
A PulseSensor library (for Arduino) that collects our most popular projects in one place.
Stars: ✭ 126 (-2.33%)
Mutual labels:  library
Parser Php
Browser sniffing gone too far — A useragent parser library for PHP
Stars: ✭ 1,626 (+1160.47%)
Mutual labels:  library
Phplrt
PHP Language Recognition Tool
Stars: ✭ 127 (-1.55%)
Mutual labels:  library
Redux Unhandled Action
Redux middleware that logs an error to the console when an action is fired and the state is not mutated,
Stars: ✭ 125 (-3.1%)
Mutual labels:  library
Sensu Plugin
A framework for writing Sensu plugins & handlers with Ruby.
Stars: ✭ 127 (-1.55%)
Mutual labels:  library
Ahk Libs
AutoHotkey library archive.
Stars: ✭ 125 (-3.1%)
Mutual labels:  library
Arare
Lightweight curried functional programming library
Stars: ✭ 127 (-1.55%)
Mutual labels:  library
Arduinoxinput
XInput library for USB capable Arduino boards
Stars: ✭ 126 (-2.33%)
Mutual labels:  library
Typin
Declarative framework for interactive CLI applications
Stars: ✭ 126 (-2.33%)
Mutual labels:  library
Skin
Pure CSS framework designed & developed by eBay for a branded, e-commerce marketplace.
Stars: ✭ 126 (-2.33%)
Mutual labels:  library

= Libasciidoc

image:https://godoc.org/github.com/bytesparadise/libasciidoc?status.svg["GoDoc", link="https://godoc.org/github.com/bytesparadise/libasciidoc"] image:https://goreportcard.com/badge/github.com/bytesparadise/libasciidoc["Go Report Card", link="https://goreportcard.com/report/github.com/bytesparadise/libasciidoc"] image:https://github.com/bytesparadise/libasciidoc/workflows/ci-build/badge.svg["GitHub Action Build Status", link="https://github.com/bytesparadise/libasciidoc/actions?query=workflow%3Aci-build"] image:https://codecov.io/gh/bytesparadise/libasciidoc/branch/master/graph/badge.svg["Codecov", link="https://codecov.io/gh/bytesparadise/libasciidoc"] image:https://img.shields.io/badge/License-Apache%202.0-blue.svg["License", link="https://opensource.org/licenses/Apache-2.0"]

Libasciidoc is an open source Go library to convert from Asciidoc to HTML.

== Supported syntax

Although it does not support the full Asciidoc/Asciidoctor syntax, Libasciidoc already provides users with the following features:

  • Title and Sections level 1 to 6
  • Document authors and revision
  • Attribute declaration and substitution
  • Paragraphs and admonition paragraphs
  • Delimited Blocks (fenced blocks, listing blocks, example blocks, comment blocks, quoted blocks, sidebar blocks, verse blocks)
  • Source code highlighting of delimited blocks (use either chroma or pygments as the source-highlighter)
  • Literal blocks (paragraph starting with a space, with the +++....+++ delimiter or with the [literal] attribute)
  • Quoted text (bold, italic, monospace, marked, superscript and subscript) and substitution prevention using the backslash (\) character
  • Single and double quoted typographic quotes (e.g. 'single' and "double")
  • Explicit and implicit curved apostrophe
  • Copyright (C), Registered (R), and Trademark (TM) symbols
  • Passthrough (wrapping with a single plus or a triple plus, or using the +++pass:[]+++ or +++pass:q[]+++ macros)
  • External links in paragraphs (https://, http://, ftp://, irc://, mailto:)
  • Inline images in paragraphs (image:)
  • Image blocks (image::)
  • Icons including font, graphic icons, both in admonition blocks and inline (icon:)
  • Element attributes (ID, link, title, role, etc.) including short-hand ([#id.role1.role2])
  • Ordered lists including custom numbering types (arabic, upperroman, lowergreek, and so forth)
  • Unordered lists including bullet styles
  • Labeled lists, including [horizontal] and [qanda] styles
  • Nesting of links of different types & attributes
  • Tables (basic support: header line and cells on multiple lines, top-level table styles)
  • Horizontal rules (thematic breaks) and page breaks
  • Table of contents
  • YAML front-matter

See also the link:LIMITATIONS.adoc[known limitations] page for differences between Asciidoc/Asciidoctor and Libasciidoc.

Further elements will be supported in the future. Feel free to open issues https://github.com/bytesparadise/libasciidoc/issues[here] to help prioritizing the upcoming work.

== Output Formats (backend)

Using -b (or --backend) the following formats are supported:

  • html5 (also html), this is the default
  • xhtml5 (also xhtml)

== Installation

This is a standard Go package, and it installs like you might expect.

To install it in your $GOPATH (assuming $GOPATH/bin is on your path), just use go install:

$ go get -u github.com/bytesparadise/libasciidoc

== Usage

=== Command Line

The libasciidoc library includes a minimalist command line interface to generate the HTML content from a given file:

$ libasciidoc -s content.adoc

use libasciidoc --help to check all available options.

=== Code integration

Libasciidoc provides 2 functions to convert an Asciidoc content into HTML:

  1. Converting an io.Reader into an HTML document:

    Convert(r io.Reader, output io.Writer, config configuration.Configuration) (types.Metadata, error)

  2. Converting a file (given its name) into an HTML document:

    ConvertFile(output io.Writer, config configuration.Configuration) (types.Metadata, error)

where the returned types.Metadata object contains the document's title which is not part of the generated HTML <body> part, as well as the other attributes of the source document.

All options/settings are passed via the config parameter.

=== Macro definition

The user can define a macro by calling renderer.WithMacroTemplate() and passing return value to conversion functions.

renderer.WithMacroTemplate() defines a macro by the given name and associates the given template. The template is an implementation of renderer.MacroTemplate interface (ex. text.Template)

Libasciidoc calls Execute() method and passes types.UserMacro object to template when rendering.

An example the following:

var tmplStr = `<span>Example: {{.Value}}{{.Attributes.GetAsString "suffix"}}</span>`
var t = template.New("example")
var tmpl = template.Must(t.Parse(tmplStr))

output := &strings.Builder{}
content := strings.NewReader(`example::hello world[suffix=!!!!!]`)
libasciidoc.Convert(content, output, renderer.WithMacroTemplate(tmpl.Name(), tmpl))

== How to contribute

Please refer to the link:CONTRIBUTE.adoc[Contribute] page.

== License

Libasciidoc is available under the terms of the https://raw.githubusercontent.com/bytesparadise/libasciidoc/LICENSE[Apache License 2.0].

== Trademark

AsciiDoc is a trademark of the Eclipse Foundation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].