-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from spiegel-im-spiegel/update-packages
Renewal codes
- Loading branch information
Showing
26 changed files
with
569 additions
and
430 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 |
---|---|---|
@@ -1,85 +1,104 @@ | ||
# [mklink] -- Make Link with Markdown Format | ||
# [ml] -- Make Link with Markdown Format | ||
|
||
[](https://github.com/spiegel-im-spiegel/mklink/actions) | ||
[](https://github.com/spiegel-im-spiegel/mklink/actions) | ||
[](https://github.com/spiegel-im-spiegel/mklink/actions) | ||
[](https://raw.githubusercontent.com/spiegel-im-spiegel/mklink/master/LICENSE) | ||
[](https://github.com/spiegel-im-spiegel/mklink/releases/latest) | ||
[](https://github.com/spiegel-im-spiegel/ml/actions) | ||
[](https://github.com/spiegel-im-spiegel/ml/actions) | ||
[](https://github.com/spiegel-im-spiegel/ml/actions) | ||
[](https://raw.githubusercontent.com/spiegel-im-spiegel/ml/master/LICENSE) | ||
[](https://github.com/spiegel-im-spiegel/ml/releases/latest) | ||
|
||
## Declare [mklink] module | ||
## Build and Install | ||
|
||
See [go.mod](https://github.com/spiegel-im-spiegel/mklink/blob/master/go.mod) file. | ||
|
||
## Usage | ||
|
||
```go | ||
link, err := mklink.New("https://git.io/vFR5M") | ||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
fmt.Println(link.Encode(mklink.StyleMarkdown)) | ||
// Output: | ||
// [GitHub - spiegel-im-spiegel/mklink: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/mklink) | ||
``` | ||
$ go install github.com/spiegel-im-spiegel/gpgpdump@latest | ||
``` | ||
|
||
## Command Line Interface | ||
|
||
### Binaries | ||
## Binaries | ||
|
||
See [latest release](https://github.com/spiegel-im-spiegel/mklink/releases/latest). | ||
See [latest release](https://github.com/spiegel-im-spiegel/ml/releases/latest). | ||
|
||
### Usage | ||
## Usage | ||
|
||
``` | ||
$ mklink -h | ||
$ ml -h | ||
Usage: | ||
mklink [flags] [URL [URL]...] | ||
ml [flags] [URL [URL]...] | ||
Flags: | ||
-h, --help help for mklink | ||
--debug for debug | ||
-h, --help help for ml | ||
-i, --interactive interactive mode | ||
--log string output log | ||
-s, --style string link style (default "markdown") | ||
-v, --version output version of mklink | ||
-s, --style string link style [markdown|wiki|html|csv|json] (default "markdown") | ||
-v, --version output version of ml | ||
``` | ||
|
||
``` | ||
$ ml https://git.io/vFR5M | ||
[GitHub - spiegel-im-spiegel/ml: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/ml) | ||
``` | ||
|
||
``` | ||
$ mklink https://git.io/vFR5M | ||
[GitHub - spiegel-im-spiegel/mklink: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/mklink) | ||
$ echo https://git.io/vFR5M | ml | ||
[GitHub - spiegel-im-spiegel/ml: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/ml) | ||
``` | ||
|
||
### Support Other Styles | ||
|
||
``` | ||
$ echo https://git.io/vFR5M | mklink | ||
[GitHub - spiegel-im-spiegel/mklink: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/mklink) | ||
$ ml -s html https://git.io/vFR5M | ||
<a href="https://github.com/spiegel-im-spiegel/ml">GitHub - spiegel-im-spiegel/ml: Make Link with Markdown Format</a> | ||
``` | ||
|
||
Support Styles: `markdown`, `wiki`, `html`, `csv`, `json` | ||
|
||
### logging | ||
|
||
``` | ||
$ mklink --log log.txt https://git.io/vFR5M | ||
[GitHub - spiegel-im-spiegel/mklink: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/mklink) | ||
$ ml --log log.txt https://git.io/vFR5M | ||
[GitHub - spiegel-im-spiegel/ml: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/ml) | ||
$ cat log.txt | ||
[GitHub - spiegel-im-spiegel/mklink: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/mklink) | ||
[GitHub - spiegel-im-spiegel/ml: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/ml) | ||
``` | ||
|
||
### Interactive Mode | ||
|
||
``` | ||
$ mklink -i | ||
$ ml -i | ||
Input 'q' or 'quit' to stop | ||
mklimk> https://git.io/vFR5M | ||
[GitHub - spiegel-im-spiegel/mklink: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/mklink) | ||
mklimk> | ||
ml> https://git.io/vFR5M | ||
[GitHub - spiegel-im-spiegel/ml: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/ml) | ||
ml> | ||
``` | ||
|
||
### Support Other Style | ||
## With Go Codes | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"io" | ||
"os" | ||
|
||
"github.com/spiegel-im-spiegel/ml/makelink" | ||
) | ||
|
||
func main() { | ||
lnk, err := makelink.New(context.Background(), "https://git.io/vFR5M") | ||
if err != nil { | ||
fmt.Fprintln(os.Stderr, err) | ||
return | ||
} | ||
_, _ = io.Copy(os.Stdout, lnk.Encode(makelink.StyleMarkdown)) | ||
// Output: | ||
// [GitHub - spiegel-im-spiegel/ml: Make Link with Markdown Format](https://github.com/spiegel-im-spiegel/ml) | ||
} | ||
``` | ||
$ mklink -s html https://git.io/vFR5M | ||
<a href="https://github.com/spiegel-im-spiegel/mklink">GitHub - spiegel-im-spiegel/mklink: Make Link with Markdown Format</a> | ||
``` | ||
|
||
Support: `markdown`, `wiki`, `html`, `csv` | ||
## Modules Requirement Graph | ||
|
||
[](./dependency.png) | ||
|
||
[mklink]: https://github.com/spiegel-im-spiegel/mklink "spiegel-im-spiegel/mklink: Make Link with Markdown Format" | ||
[dep]: https://github.com/golang/dep "golang/dep: Go dependency management tool" | ||
[ml]: https://github.com/spiegel-im-spiegel/ml "spiegel-im-spiegel/ml: Make Link with Markdown Format" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.