Skip to content

Commit

Permalink
Moved formatcore/* to format/formatcore/*
Browse files Browse the repository at this point in the history
Updated imports and added README.md in format/formatcore.
  • Loading branch information
bastantoine committed Jun 16, 2021
1 parent fda14db commit 50b5454
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 3 deletions.
2 changes: 1 addition & 1 deletion format/devops.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"regexp"
"strings"

"github.com/princjef/gomarkdoc/formatcore"
"github.com/princjef/gomarkdoc/format/formatcore"
"github.com/princjef/gomarkdoc/lang"
)

Expand Down
129 changes: 129 additions & 0 deletions format/formatcore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->

# formatcore

```go
import "github.com/princjef/gomarkdoc/format/formatcore"
```

## Index

- [func Bold(text string) string](<#func-bold>)
- [func CodeBlock(code string) string](<#func-codeblock>)
- [func Escape(text string) string](<#func-escape>)
- [func GFMAccordion(title, body string) string](<#func-gfmaccordion>)
- [func GFMAccordionHeader(title string) string](<#func-gfmaccordionheader>)
- [func GFMAccordionTerminator() string](<#func-gfmaccordionterminator>)
- [func GFMCodeBlock(language, code string) string](<#func-gfmcodeblock>)
- [func Header(level int, text string) (string, error)](<#func-header>)
- [func Link(text, href string) string](<#func-link>)
- [func ListEntry(depth int, text string) string](<#func-listentry>)
- [func Paragraph(text string) string](<#func-paragraph>)
- [func PlainText(text string) string](<#func-plaintext>)


## func [Bold](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L14>)

```go
func Bold(text string) string
```

Bold converts the provided text to bold

## func [CodeBlock](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L24>)

```go
func CodeBlock(code string) string
```

CodeBlock wraps the provided code as a code block\. Language syntax highlighting is not supported\.

## func [Escape](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L132>)

```go
func Escape(text string) string
```

Escape escapes the special characters in the provided text\, but leaves URLs found intact\. Note that the URLs included must begin with a scheme to skip the escaping\.

## func [GFMAccordion](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L95>)

```go
func GFMAccordion(title, body string) string
```

GFMAccordion generates a collapsible content\. The accordion's visible title while collapsed is the provided title and the expanded content is the body\.

## func [GFMAccordionHeader](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L108>)

```go
func GFMAccordionHeader(title string) string
```

GFMAccordionHeader generates the header visible when an accordion is collapsed\.

The GFMAccordionHeader is expected to be used in conjunction with GFMAccordionTerminator\(\) when the demands of the body's rendering requires it to be generated independently\. The result looks conceptually like the following:

```
accordion := GFMAccordionHeader("Accordion Title") + "Accordion Body" + GFMAccordionTerminator()
```

## func [GFMAccordionTerminator](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L115>)

```go
func GFMAccordionTerminator() string
```

GFMAccordionTerminator generates the code necessary to terminate an accordion after the body\. It is expected to be used in conjunction with GFMAccordionHeader\(\)\. See GFMAccordionHeader for a full description\.

## func [GFMCodeBlock](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L39>)

```go
func GFMCodeBlock(language, code string) string
```

GFMCodeBlock wraps the provided code as a code block and tags it with the provided language \(or no language if the empty string is provided\)\, using the triple backtick format from GitHub Flavored Markdown\.

## func [Header](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L45>)

```go
func Header(level int, text string) (string, error)
```

Header converts the provided text into a header of the provided level\. The level is expected to be at least 1\.

## func [Link](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L68>)

```go
func Link(text, href string) string
```

Link generates a link with the given text and href values\.

## func [ListEntry](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L83>)

```go
func ListEntry(depth int, text string) string
```

ListEntry generates an unordered list entry with the provided text at the provided zero\-indexed depth\. A depth of 0 is considered the topmost level of list\.

## func [Paragraph](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L120>)

```go
func Paragraph(text string) string
```

Paragraph formats a paragraph with the provided text as the contents\.

## func [PlainText](<https://github.com/princjef/gomarkdoc/blob/master/format/formatcore/base.go#L169>)

```go
func PlainText(text string) string
```

PlainText converts a markdown string to the plain text that appears in the rendered output\.



Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion format/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"strings"

"github.com/princjef/gomarkdoc/formatcore"
"github.com/princjef/gomarkdoc/format/formatcore"
"github.com/princjef/gomarkdoc/lang"
)

Expand Down
2 changes: 1 addition & 1 deletion format/plain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package format
import (
"fmt"

"github.com/princjef/gomarkdoc/formatcore"
"github.com/princjef/gomarkdoc/format/formatcore"
"github.com/princjef/gomarkdoc/lang"
)

Expand Down

0 comments on commit 50b5454

Please sign in to comment.