Skip to content

Commit

Permalink
Merge pull request #24 from spiegel-im-spiegel/update-packages
Browse files Browse the repository at this point in the history
Renewal codes
  • Loading branch information
spiegel-im-spiegel authored Jan 3, 2021
2 parents e4e961a + 341d5e1 commit e57e0c7
Show file tree
Hide file tree
Showing 26 changed files with 569 additions and 430 deletions.
12 changes: 7 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
project_name: mklink
project_name: ml
release:
github:
owner: spiegel-im-spiegel
name: mklink
name: ml

builds:
-
Expand All @@ -17,9 +17,10 @@ builds:
- amd64
- arm
- arm64
main: ./cli/mklink/
ldflags: -s -w -X github.com/spiegel-im-spiegel/mklink/cli/mklink/facade.Version=v{{ .Version }}
binary: mklink
main: ./
flags:
- -trimpath
ldflags: -s -w -X github.com/spiegel-im-spiegel/ml/facade.Version=v{{ .Version }}

archives:
-
Expand All @@ -40,6 +41,7 @@ archives:
files:
- LICENSE*
- README*
- dependency.png

changelog:
sort: asc
Expand Down
115 changes: 67 additions & 48 deletions README.md
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

[![check vulns](https://github.com/spiegel-im-spiegel/mklink/workflows/vulns/badge.svg)](https://github.com/spiegel-im-spiegel/mklink/actions)
[![lint status](https://github.com/spiegel-im-spiegel/mklink/workflows/lint/badge.svg)](https://github.com/spiegel-im-spiegel/mklink/actions)
[![lint status](https://github.com/spiegel-im-spiegel/mklink/workflows/build/badge.svg)](https://github.com/spiegel-im-spiegel/mklink/actions)
[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/spiegel-im-spiegel/mklink/master/LICENSE)
[![GitHub release](http://img.shields.io/github/release/spiegel-im-spiegel/mklink.svg)](https://github.com/spiegel-im-spiegel/mklink/releases/latest)
[![check vulns](https://github.com/spiegel-im-spiegel/ml/workflows/vulns/badge.svg)](https://github.com/spiegel-im-spiegel/ml/actions)
[![lint status](https://github.com/spiegel-im-spiegel/ml/workflows/lint/badge.svg)](https://github.com/spiegel-im-spiegel/ml/actions)
[![lint status](https://github.com/spiegel-im-spiegel/ml/workflows/build/badge.svg)](https://github.com/spiegel-im-spiegel/ml/actions)
[![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/spiegel-im-spiegel/ml/master/LICENSE)
[![GitHub release](http://img.shields.io/github/release/spiegel-im-spiegel/ml.svg)](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](./dependency.png)](./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"
127 changes: 0 additions & 127 deletions cli/mklink/facade/facade_test.go

This file was deleted.

57 changes: 0 additions & 57 deletions cli/mklink/facade/interactive.go

This file was deleted.

Loading

0 comments on commit e57e0c7

Please sign in to comment.