-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e192aa
commit 931a394
Showing
22 changed files
with
453 additions
and
27 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
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
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,41 @@ | ||
# Code | ||
|
||
## API | ||
|
||
### Interface | ||
|
||
```go | ||
func Code(c *tgframe.Container, code string) | ||
func CodeWithConf(c *tgframe.Container, code string, conf *CodeConf) | ||
``` | ||
|
||
### Parameters | ||
|
||
* `c`: Parent container. | ||
* `code`: Code to display. | ||
* `conf`: Configuration for the code component. | ||
|
||
```go | ||
// CodeConf provide extra config for Code Component. | ||
type CodeConf struct { | ||
// Language is language of code block, leave empty to use `go` | ||
Language string | ||
|
||
// ID is id of the component | ||
ID string | ||
} | ||
``` | ||
|
||
## Example | ||
|
||
```go | ||
tgcomp.Code(c, "package main\n\nfunc main() {\n\tprintln(\"Hello, World!\")") | ||
``` | ||
|
||
```go | ||
tgcomp.CodeWithConf(c, "package main\n\nfunc main() {\n\tprintln(\"Hello, World!\")", | ||
&tgcomp.CodeConf{ | ||
Language: "go", | ||
ID: "mycode", | ||
}) | ||
``` |
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
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,19 @@ | ||
# Latex | ||
|
||
Latex component is used to display LaTeX content. | ||
|
||
## API | ||
|
||
```go | ||
func Latex(c *tgframe.Container, latex string) | ||
``` | ||
|
||
* `c` is the container to add the LaTeX component to. | ||
* `latex` is the LaTeX content to display. | ||
|
||
## Example | ||
|
||
```go | ||
tgcomp.Latex(c, "E = mc^2") | ||
``` | ||
|
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,26 @@ | ||
# Markdown | ||
|
||
## API | ||
|
||
### Interface | ||
|
||
```go | ||
func Markdown(c *tgframe.Container, markdown string) | ||
func MarkdownWithID(c *tgframe.Container, markdown string, id string) | ||
``` | ||
|
||
### Parameters | ||
|
||
* `c`: Parent container. | ||
* `markdown`: Markdown content to display. | ||
* `id`: Unique component ID. | ||
|
||
## Example | ||
|
||
```go | ||
tgcomp.Markdown(c, "* Hello, World!") | ||
``` | ||
|
||
```go | ||
tgcomp.MarkdownWithID(c, "* Hello, World!", "my-markdown") | ||
``` |
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
Oops, something went wrong.