org

package module
v0.0.0-...-6fde0a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2023 License: BSD-3-Clause Imports: 3 Imported by: 1

README

* org-golang
  convert org-mode to html

  [[https://orgmode.org/worg/org-syntax.html][https://img.shields.io/badge/org-syntax-brightgreen.svg]]
  [[LICENSE][https://img.shields.io/badge/license-BSD-blue.svg]]

** How to use?
   #+begin_src bash
     go get -u github.com/honmaple/org-golang
   #+end_src

   #+begin_src go
     package main

     import (
         "fmt"
         "strings"

         "github.com/honmaple/org-golang"
         "github.com/honmaple/org-golang/render"
     )

     func main() {
         text := `
     * heading
         /italic/ italic/ /italic\/ \/italic\/ \/italic/
         =code= code= =code\= \=code\= \=code=
         ~code1~ code1~ ~code1\~ \~code1\~ \~code~
         #+begin_example
         s *sss* ss
         exam
         #+end_example

         - list1
         sssss
         - list4
             cccc
         - list2
         - title3
         vvvvc

     ** heading2

         | kk  | kv   |
         |-----+------|
         | sss | cccc |
         |     | cccc |
         | ddd | vvv  |`

         r := strings.NewReader(text)
         fmt.Println(org.HTML(r))
         fmt.Println(org.Debug(r))

         r1 := render.HTML{
             Toc: true,
             Document: org.New(r),
         }
         fmt.Println(r1.String())

         r2 := render.Debug{
             Document: org.New(r),
         }
         fmt.Println(r2.String())
     }
   #+end_src

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(r io.Reader, opts ...Option) string

func HTML

func HTML(r io.Reader, opts ...Option) string

func New

func New(r io.Reader, opts ...Option) *parser.Document

Types

type Option

type Option func(*parser.Document)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL