-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved formatcore/* to format/formatcore/*
Updated imports and added README.md in format/formatcore.
- Loading branch information
1 parent
fda14db
commit 50b5454
Showing
6 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters