pastebin

package module
v0.0.0-...-86dd373 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: GPL-3.0 Imports: 10 Imported by: 1

README

pastebin

PasteBin implement, written in Go.

0 Quick Start

提供多语法解析为 HTML 的接口实现。

1 MarkDown

引用包 blackfriday.v2 ,其 GitHub 地址在 这里

bytes.Replace([]byte(input), []byte("\r"), nil, -1) 消除 \r 换行带来的格式影响;

blackfriday.HardLineBreak 参数旨在消除两行连成一行的情况;

2 GoldMark

Mermaid:

flowchart LR
	nodeA((nodeA))
	nodeB((nodeB))
	nodeA-- dp1/pod1 -->nodeB

Code Block:

int main(int argc, char* argv[]) {
    int a = 666;
    vector<int> b({1, 2, 3});
    string c = "hello world";

    cout << "a=" << a << ", b=" << b << ", c=" << c
         << endl;
    debug(a, b, c);  // a=666, b=[ 1, 2, 3, ], c=hello world

    return 0;
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseContentMD

func ParseContentMD(input string) (string, error)

ParseContentMD parse the markdown syntax directly

Types

type MarkDownImpl

type MarkDownImpl struct {
	// contains filtered or unexported fields
}

MarkDownImpl the markdown impl.

func (*MarkDownImpl) ParseContent

func (impl *MarkDownImpl) ParseContent(input string) (string, error)

ParseContent return the

func (*MarkDownImpl) Syntax

func (impl *MarkDownImpl) Syntax() string

Syntax return the syntax

type PasteBin

type PasteBin interface {
	Syntax() string
	ParseContent(string) (string, error)
}

PasteBin the interface def.

type PasteObj

type PasteObj struct {
	Poster     string
	Syntax     string // enum
	Content    string
	TinyURL    string
	Expiration time.Duration
}

PasteObj the definition

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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