troff

package module
v0.0.0-...-cc28d85 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Left align the picture
	Left Position = iota
	// Center align the picture
	Center
	// Right align the picture
	Right

	// Outline the picture with a box.
	Outline PictureFlag = iota
	// Scale freely scales both picture dimensions.
	Scale
	// White out the area to be occupied by the picture.
	White
)

Variables

This section is empty.

Functions

func Abstract

func Abstract(w io.Writer, abstract string)

Abstract prints

.AB
<abstract>
.AE

func AuthorBio

func AuthorBio(w io.Writer, a markdown.Author)

AuthorBio prints

.AU
.I <a.Name>
.I <a.Email>
.AI <a.Affiliation>

func Bold

func Bold(w io.Writer, lit ...interface{})

Bold prints

.B

func ChangeDate

func ChangeDate(w io.Writer, d time.Time)

ChangeDate changes the date to the given date by printing .ND May 8, 1945

func CodeBlock

func CodeBlock(w io.Writer, code []byte)

CodeBlock prints codeblock

.P1
<codeblock>
.P2

func Display

func Display(w io.Writer, p []byte)

Display prints

.DS
<p>
.DE

func Esc

func Esc(w io.Writer, p []byte)

Esc should print escaped bytes, but it just writes it. TODO(sevki): fix!

func Figure

func Figure(w io.Writer, link string, verticalSize string)

Figure prints

.FG <link> <size>

func HTML

func HTML(w io.Writer, attribute string)

HTML prints .HTML <attribute>\n

func Indent

func Indent(w io.Writer)

Indent prints

.RS\n

func IndentParagraph

func IndentParagraph(w io.Writer, title string)

IndentParagraph takes a <title> and prints

.IP <title>\n

func Italic

func Italic(w io.Writer)

Italic prints

.I

func LeftAlignedParagraph

func LeftAlignedParagraph(w io.Writer, title string, level int)

LeftAlignedParagraph prints

.LP

func LineBreak

func LineBreak(w io.Writer)

LineBreak prints a new line

\n

func NewRenderer

func NewRenderer() markdown.Renderer

NewRenderer returns a blackfriday.Renderer that will print plan9 troff macros https://plan9.io/sys/doc/troff.pdf

func Outdent

func Outdent(w io.Writer)

Outdent prints

.RE\n

func Picture

func Picture(w io.Writer, source string, height, width float32, position Position, offset float32, flags PictureFlag)

Picture is the mpicture macro https://9p.io/magic/man2html/6/mpictures

func Roman

func Roman(w io.Writer)

Roman prints

.R

func Table

func Table(w io.Writer, p []byte)

Table prints

.TS
.DS
<p>
.DE
.TE

func TableHeading

func TableHeading(w io.Writer)

TableHeading prints

.TH\n

func Title

func Title(w io.Writer, tl string)

Title prints

.TL
<title>\n

func Underline

func Underline(w io.Writer)

Underline prints

.UL

Types

type Macro

type Macro string

Macro is a troff macro

type PictureFlag

type PictureFlag int

PictureFlag sets the picture options like scale and outline

type Position

type Position int

Position of the picture

Notes

Bugs

  • we get things that are not title blocks here

Jump to

Keyboard shortcuts

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