go-md2man - 转换 Markdown 为 man 手册内容

Overview

go-md2man

Converts markdown into roff (man pages).

Uses blackfriday to process markdown into man pages.

Usage

./md2man -in /path/to/markdownfile.md -out /manfile/output/path

How to contribute

We use go modules to manage dependencies. As such you must be using at lest go1.11.

Comments
  • Curly braces not escaped

    Curly braces not escaped

    On my shiny Ubuntu machine with a docker 1.6 install, man docker inspect reads as follows:

    Getting the IP address of a container instance
           To get the IP address of a container use:
    
                  # docker inspect --format='.NetworkSettings.IPAddress' 1eb5fabf5a03
                  172.17.0.2
    

    For comparison, here is the markdown source that generated that; note the curly braces in the original.

    opened by asazernik 14
  • Build / dependencies broken

    Build / dependencies broken

    I'm using spf13/cobra/doc which depends on this module. Running go get -u I'm seing the following errors:

    # github.com/cpuguy83/go-md2man/md2man
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/md2man.go:11:16: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/md2man.go:12:16: undefined: blackfriday.EXTENSION_TABLES
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/md2man.go:13:16: undefined: blackfriday.EXTENSION_FENCED_CODE
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/md2man.go:14:16: undefined: blackfriday.EXTENSION_AUTOLINK
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/md2man.go:15:16: undefined: blackfriday.EXTENSION_SPACE_HEADERS
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/md2man.go:16:16: undefined: blackfriday.EXTENSION_FOOTNOTES
    ../go/pkg/mod/github.com/cpuguy83/[email protected].10/md2man/md2man.go:17:16: undefined: blackfriday.EXTENSION_TITLEBLOCK
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/md2man.go:19:29: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(doc, renderer, extensions)
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/roff.go:19:9: cannot use &roffRenderer literal (type *roffRenderer) as type blackfriday.Renderer in return argument:
            *roffRenderer does not implement blackfriday.Renderer (missing RenderFooter method)
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/roff.go:102:11: undefined: blackfriday.LIST_TYPE_ORDERED
    ../go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/roff.go:102:11: too many errors
    
    opened by andig 13
  • blackfriday version issue

    blackfriday version issue

    my golang env:

    go 1.13.5
    
    

    when I run

    
    go get -u github.com/swaggo/swag/cmd/swag
    
    

    the CLI tool output:

    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\md2man.go:11:16: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\md2man.go:12:16: undefined: blackfriday.EXTENSION_TABLES
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\md2man.go:13:16: undefined: blackfriday.EXTENSION_FENCED_CODE
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\md2man.go:14:16: undefined: blackfriday.EXTENSION_AUTOLINK
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\md2man.go:15:16: undefined: blackfriday.EXTENSION_SPACE_HEADERS
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\md2man.go:16:16: undefined: blackfriday.EXTENSION_FOOTNOTES
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\md2man.go:17:16: undefined: blackfriday.EXTENSION_TITLEBLOCK
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\md2man.go:19:29: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(doc, renderer, extensions)
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\roff.go:19:9: cannot use &roffRenderer literal (type *roffRenderer) as type blackfriday.Renderer in return argument:
            *roffRenderer does not implement blackfriday.Renderer (missing RenderFooter method)
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\roff.go:102:11: undefined: blackfriday.LIST_TYPE_ORDERED
    D:\tools\GoPath\pkg\mod\github.com\cpuguy83\[email protected]\md2man\roff.go:102:11: too many errors
    
    

    I thinkthis line should be:

    
    github.com/russross/blackfriday v1.5.2
    

    Or, you may need update this repo.

    opened by suifengtec 10
  • Can we get this updated for blackfriday v2 and/or get a go.mod?

    Can we get this updated for blackfriday v2 and/or get a go.mod?

    If you're using cobra with modules, a go get will end up getting blackfriday v2, which is not compatible with this library. Therefore, you have to manually push blackfriday back to v1.5.2, which is annoying if you're doing a blanket update of your deps.

    Can we either:

    • Update this to blackfriday v2
    • Add a go.mod in this repository specifying the blackfriday v1 dependency

    It would be a huge help.

    Related:

    https://github.com/spf13/cobra/issues/805 https://github.com/cpuguy83/go-md2man/issues/42

    opened by bufdev 10
  • Prob since update to Blackfriday V2

    Prob since update to Blackfriday V2

    This package is being used in spf13/cobra/docs to generate man pages.

    It seems that since commit revision 124c15a91abbd0570c8510ba7e5a22eecfb5ba86, the following error appears.

    vendor/github.com/cpuguy83/go-md2man/md2man/roff.go:15:15: undefined: blackfriday.Extensions

    opened by ghost 8
  • Runtime Error invalid memory...

    Runtime Error invalid memory...

     make  GOMD2MAN=~/bin/go-md2man 
    /home/dwalsh/bin/go-md2man -in buildah.md -out buildah.1
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4daf1b]
    
    goroutine 1 [running]:
    github.com/cpuguy83/go-md2man/md2man.(*roffRenderer).handleTableCell(0xc4200784b0, 0x5b14e0, 0xc4200dbb20, 0xc4200f2dc0, 0x201)
    	/home/dwalsh/go/src/github.com/cpuguy83/go-md2man/md2man/roff.go:269 +0x5b
    github.com/cpuguy83/go-md2man/md2man.(*roffRenderer).RenderNode(0xc4200784b0, 0x5b14e0, 0xc4200dbb20, 0xc4200f2dc0, 0x1, 0x0)
    	/home/dwalsh/go/src/github.com/cpuguy83/go-md2man/md2man/roff.go:156 +0x66c
    github.com/cpuguy83/go-md2man/vendor/github.com/russross/blackfriday.Run.func1(0xc4200f2dc0, 0x4d9e01, 0x0)
    	/home/dwalsh/go/src/github.com/cpuguy83/go-md2man/vendor/github.com/russross/blackfriday/markdown.go:392 +0x5a
    github.com/cpuguy83/go-md2man/vendor/github.com/russross/blackfriday.(*Node).Walk(0xc4200b0500, 0xc4200d7e18)
    	/home/dwalsh/go/src/github.com/cpuguy83/go-md2man/vendor/github.com/russross/blackfriday/node.go:284 +0x56
    github.com/cpuguy83/go-md2man/vendor/github.com/russross/blackfriday.Run(0xc4200e6000, 0x1110, 0x1e00, 0xc4200d7e98, 0x2, 0x2, 0xc42000c050, 0x200, 0xc4200e6000)
    	/home/dwalsh/go/src/github.com/cpuguy83/go-md2man/vendor/github.com/russross/blackfriday/markdown.go:391 +0x281
    github.com/cpuguy83/go-md2man/md2man.Render(0xc4200e6000, 0x1110, 0x1e00, 0x1110, 0x1e00, 0x0)
    	/home/dwalsh/go/src/github.com/cpuguy83/go-md2man/md2man/md2man.go:11 +0xdc
    main.main()
    	/home/dwalsh/go/src/github.com/cpuguy83/go-md2man/md2man.go:35 +0x143
    make: *** [Makefile:9: buildah.1] Error 2
    
    opened by rhatdan 8
  • Do not escape dash, underscore, and ampersand

    Do not escape dash, underscore, and ampersand

    Currently, we escape a few characters, such as

    • - (dash) becomes \- (arithmetic minus sign)
    • _ (underscore) becomes \_ (underline character)
    • & (ampersand) becomes \& (zero-width space!)

    As a result, we have two bugs:

    1. All & characters disappear from the resulting man page.

    2. Dashes are quite longer, and underscores becomes underlines (the latter are lower). This is not reflected in text output, only in PDF etc, and in most cases (like file names, command line options etc) does not look good.

    In fact, the only character that needs escaping is the backslash itself. This is what this patch does, together with fixes to expected test output.

    The following commands were used to generate the example PDFs:

    $ bin/go-md2man < go-md2man.1.md > go-md2man.1
    $ man -Tpdf ./go-md2man.1 > go-md2man.pdf
    

    Before: go-md2man-old.pdf

    After: go-md2man.pdf

    Visual comparison: Screenshot from 2021-07-13 14-30-22

    Source for the above:

    .PP
    .RS
    
    .nf
    Old: go\-md2man \-\-example \-in=go\-md2man.1.md \-out=go\-md2man.1.out
    New: go-md2man --example -in=go-md2man.1.md -out=go-md2man.1.out
    
    Old: \-\-\- \_\_\_ \&\&\& k\_p\_q\_\_y\_z
    New: --- ___ &&& k_p_q__y_z
    .fi
    .RE
    
    opened by kolyshkin 7
  • glide install error

    glide install error

    glide install it depend go-md2man ,and shows :

    Error scanning github.com/cpuguy83/go-md2man/v2/md2man: cannot find package "." in:
            /Users/xxxx/.glide/cache/src/https-github.com-cpuguy83-go-md2man/v2/md2man
    

    it seems need go mod , I update go to go1.13 ,it still install err ,what can I do can avoid "github.com/cpuguy83/go-md2man/v2/md2man" import error ? thanks

    opened by herohenu 5
  • Update to Blackfriday v2 API

    Update to Blackfriday v2 API

    My initial attempt at migrating go-md2man to use the v2 API and add support for "definition lists" which make argument/option listings more like traditional manpages (IMHO). Working on containerd man pages was the impetus for this :)

    I would like to add a test for all the features claimed to be supported here with a example input and verified output before calling this complete. But, it is working for simple manpage tests I've performed so far.

    Closes #28

    opened by estesp 5
  • General cleanup

    General cleanup

    • Add documentation surrounding building and using md2man.
    • Modify the dockerfile so that a version is included that can be used for development.
    • Add a -v version flag.
    • Error when the input file/stdin is zero-length
    • Send errors to stderr.
    • Add support for running tests via travis-ci.
    opened by josegonzalez 5
  • `go install` not working as expected

    `go install` not working as expected

    It is not possible to use go install to have latest go-md2man installed :(

    Using go install from Go 1.18 to install go-md2man, I see some strange results.

    1. By default, @latest installs v1.0.10, not v2.0.1.
    [[email protected] ~]$ go install -v -x  github.com/cpuguy83/[email protected]
    # get https://proxy.golang.org/github.com/@v/list
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/list
    # get https://proxy.golang.org/github.com/cpuguy83/@v/list
    # get https://proxy.golang.org/github.com/cpuguy83/@v/list: 410 Gone (0.110s)
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/list: 200 OK (0.116s)
    # get https://proxy.golang.org/github.com/@v/list: 410 Gone (0.117s)
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/v1.0.10.info
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/v1.0.10.info: 200 OK (0.014s)
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/v1.0.10.mod
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/v1.0.10.mod: 200 OK (0.017s)
    # get https://proxy.golang.org/sumdb/sum.golang.org/supported
    # get https://proxy.golang.org/sumdb/sum.golang.org/supported: 410 Gone (0.015s)
    # get https://sum.golang.org/tile/8/0/x038/464.p/109
    # get https://sum.golang.org/tile/8/2/000.p/150
    # get https://sum.golang.org/tile/8/1/150.p/64
    # get https://sum.golang.org/tile/8/1/150.p/64: 200 OK (0.126s)
    # get https://sum.golang.org/tile/8/0/x038/464.p/109: 200 OK (0.128s)
    # get https://sum.golang.org/tile/8/2/000.p/150: 200 OK (0.135s)
    # get https://sum.golang.org/lookup/github.com/cpuguy83/[email protected]
    # get https://sum.golang.org/lookup/github.com/cpuguy83/[email protected]: 200 OK (0.014s)
    # get https://sum.golang.org/tile/8/0/013
    # get https://sum.golang.org/tile/8/1/000
    # get https://sum.golang.org/tile/8/0/013: 200 OK (0.014s)
    # get https://sum.golang.org/tile/8/1/000: 200 OK (0.016s)
    go: downloading github.com/cpuguy83/go-md2man v1.0.10
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/v1.0.10.zip
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/v1.0.10.zip: 200 OK (0.019s)
    # get https://proxy.golang.org/github.com/russross/blackfriday/@v/v1.5.2.mod
    # get https://proxy.golang.org/github.com/russross/blackfriday/@v/v1.5.2.mod: 200 OK (0.017s)
    # get https://sum.golang.org/lookup/github.com/russross/[email protected]
    # get https://sum.golang.org/lookup/github.com/russross/[email protected]: 200 OK (0.018s)
    # get https://sum.golang.org/tile/8/0/001
    # get https://sum.golang.org/tile/8/0/001: 200 OK (0.017s)
    go: downloading github.com/russross/blackfriday v1.5.2
    # get https://proxy.golang.org/github.com/russross/blackfriday/@v/v1.5.2.zip
    # get https://proxy.golang.org/github.com/russross/blackfriday/@v/v1.5.2.zip: 200 OK (0.014s)
    # get https://proxy.golang.org/github.com/russross/blackfriday/@v/v1.5.2.info
    # get https://proxy.golang.org/github.com/russross/blackfriday/@v/v1.5.2.info: 200 OK (0.019s)
    WORK=/tmp/go-build3425548627
    github.com/russross/blackfriday
    mkdir -p $WORK/b045/
    cat >$WORK/b045/importcfg << 'EOF' # internal
    # import config
    packagefile bytes=/home/kir/sdk/go1.18/pkg/linux_amd64/bytes.a
    packagefile fmt=/home/kir/sdk/go1.18/pkg/linux_amd64/fmt.a
    packagefile regexp=/home/kir/sdk/go1.18/pkg/linux_amd64/regexp.a
    packagefile strconv=/home/kir/sdk/go1.18/pkg/linux_amd64/strconv.a
    packagefile strings=/home/kir/sdk/go1.18/pkg/linux_amd64/strings.a
    packagefile unicode=/home/kir/sdk/go1.18/pkg/linux_amd64/unicode.a
    packagefile unicode/utf8=/home/kir/sdk/go1.18/pkg/linux_amd64/unicode/utf8.a
    EOF
    cd /home/kir
    ./sdk/go1.18/pkg/tool/linux_amd64/compile -o $WORK/b045/_pkg_.a -trimpath "$WORK/b045=>" -p github.com/russross/blackfriday -lang=go1.16 -complete -buildid 0vcZLU3osy8Ia58Ojzmy/0vcZLU3osy8Ia58Ojzmy -goversion go1.18 -c=4 -nolocalimports -importcfg $WORK/b045/importcfg -pack ./go/pkg/mod/github.com/russross/[email protected]/block.go ./go/pkg/mod/github.com/russross/[email protected]/doc.go ./go/pkg/mod/github.com/russross/[email protected]/html.go ./go/pkg/mod/github.com/russross/[email protected]/inline.go ./go/pkg/mod/github.com/russross/[email protected]/latex.go ./go/pkg/mod/github.com/russross/[email protected]/markdown.go ./go/pkg/mod/github.com/russross/[email protected]/smartypants.go
    /home/kir/sdk/go1.18/pkg/tool/linux_amd64/buildid -w $WORK/b045/_pkg_.a # internal
    cp $WORK/b045/_pkg_.a /home/kir/.cache/go-build/13/13048e2972b277fc5d62ad42ad5aceb8887825948e956a162fe358e20910bd68-d # internal
    github.com/cpuguy83/go-md2man/md2man
    mkdir -p $WORK/b043/
    cat >$WORK/b043/importcfg << 'EOF' # internal
    # import config
    packagefile bytes=/home/kir/sdk/go1.18/pkg/linux_amd64/bytes.a
    packagefile fmt=/home/kir/sdk/go1.18/pkg/linux_amd64/fmt.a
    packagefile github.com/russross/blackfriday=$WORK/b045/_pkg_.a
    packagefile html=/home/kir/sdk/go1.18/pkg/linux_amd64/html.a
    packagefile strings=/home/kir/sdk/go1.18/pkg/linux_amd64/strings.a
    EOF
    ./sdk/go1.18/pkg/tool/linux_amd64/compile -o $WORK/b043/_pkg_.a -trimpath "$WORK/b043=>" -p github.com/cpuguy83/go-md2man/md2man -lang=go1.12 -complete -buildid IYWFJkyd3N6Fr0N9cZJm/IYWFJkyd3N6Fr0N9cZJm -goversion go1.18 -c=4 -nolocalimports -importcfg $WORK/b043/importcfg -pack ./go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/md2man.go ./go/pkg/mod/github.com/cpuguy83/[email protected]/md2man/roff.go
    /home/kir/sdk/go1.18/pkg/tool/linux_amd64/buildid -w $WORK/b043/_pkg_.a # internal
    cp $WORK/b043/_pkg_.a /home/kir/.cache/go-build/d2/d2d28bf2e7269051b8e0d584c13a89917647a1a2f109dacf1a39979a356ebb4f-d # internal
    
    1. If v2 is explicitly specified, it does not work (I guess this is due to lack of v2 tag; maybe not):
    [[email protected] ~]$ go install -v -x  github.com/cpuguy83/[email protected]
    # get https://proxy.golang.org/github.com/@v/list
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/list
    # get https://proxy.golang.org/github.com/cpuguy83/@v/list
    # get https://proxy.golang.org/github.com/@v/list: 410 Gone (0.207s)
    # get https://proxy.golang.org/github.com/cpuguy83/@v/list: 410 Gone (0.224s)
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/list: 200 OK (0.228s)
    go: github.com/cpuguy83/[email protected]: no matching versions for query "v2"
    
    1. It is not possible to install either v2.0.0 or v2.0.1:
    [[email protected] ~]$ go install github.com/cpuguy83/[email protected]
    go: github.com/cpuguy83/[email protected]: github.com/cpuguy83/[email protected]: invalid version: go.mod has post-v2 module path "github.com/cpuguy83/go-md2man/v2" at revision v2.0.0
    

    Same with more output:

    [[email protected] ~]$ go install -v -x  github.com/cpuguy83/[email protected]
    # get https://proxy.golang.org/github.com/@v/v2.0.0.info
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/v2.0.0.info
    # get https://proxy.golang.org/github.com/cpuguy83/@v/v2.0.0.info
    # get https://proxy.golang.org/github.com/cpuguy83/@v/v2.0.0.info: 410 Gone (0.104s)
    # get https://proxy.golang.org/github.com/@v/v2.0.0.info: 410 Gone (0.111s)
    # get https://proxy.golang.org/github.com/cpuguy83/go-md2man/@v/v2.0.0.info: 410 Gone (0.114s)
    mkdir -p /home/kir/go/pkg/mod/cache/vcs # git3 https://github.com/cpuguy83/go-md2man
    # lock /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0.lockmkdir -p /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0 # git3 https://github.com/cpuguy83/go-md2man
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git init --bare
    0.008s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git init --bare
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git remote add origin -- https://github.com/cpuguy83/go-md2man
    0.005s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git remote add origin -- https://github.com/cpuguy83/go-md2man
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git tag -l
    0.006s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git tag -l
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git ls-remote -q origin
    0.462s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git ls-remote -q origin
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' f79a8a8ca69da163eee19ab442bedad7a35bba5a --
    0.005s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' f79a8a8ca69da163eee19ab442bedad7a35bba5a --
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git fetch -f --depth=1 origin refs/tags/v2.0.0:refs/tags/v2.0.0
    0.706s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git fetch -f --depth=1 origin refs/tags/v2.0.0:refs/tags/v2.0.0
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' refs/tags/v2.0.0 --
    0.005s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' refs/tags/v2.0.0 --
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' 7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19 --
    0.004s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' 7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19 --
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git fetch -f --depth=1 origin refs/tags/v1.0.10:refs/tags/v1.0.10
    0.773s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git fetch -f --depth=1 origin refs/tags/v1.0.10:refs/tags/v1.0.10
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' refs/tags/v1.0.10 --
    0.005s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git -c log.showsignature=false log -n1 '--format=format:%H %ct %D' refs/tags/v1.0.10 --
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git cat-file blob 7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19:go.mod
    0.004s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git cat-file blob 7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19:go.mod
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git cat-file blob 7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19:go.mod
    0.005s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git cat-file blob 7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19:go.mod
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git cat-file blob f79a8a8ca69da163eee19ab442bedad7a35bba5a:go.mod
    0.004s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git cat-file blob f79a8a8ca69da163eee19ab442bedad7a35bba5a:go.mod
    cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git cat-file blob f79a8a8ca69da163eee19ab442bedad7a35bba5a:go.mod
    0.003s # cd /home/kir/go/pkg/mod/cache/vcs/af686cb350700dd71341e2df4d234a7ecf75459b3ee587660c6d179152b68ea0; git cat-file blob f79a8a8ca69da163eee19ab442bedad7a35bba5a:go.mod
    go: github.com/cpuguy83/[email protected]: github.com/cpuguy83/[email protected]: invalid version: go.mod has post-v2 module path "github.com/cpuguy83/go-md2man/v2" at revision v2.0.0
    
    opened by kolyshkin 4
  • Bump golangci/golangci-lint-action from 3.3.0 to 3.3.1

    Bump golangci/golangci-lint-action from 3.3.0 to 3.3.1

    Bumps golangci/golangci-lint-action from 3.3.0 to 3.3.1.

    Release notes

    Sourced from golangci/golangci-lint-action's releases.

    v3.3.1

    What's Changed

    Full Changelog: https://github.com/golangci/golangci-lint-action/compare/v3...v3.3.1

    Commits
    • 0ad9a09 build(deps-dev): bump @​typescript-eslint/parser from 5.41.0 to 5.42.0 (#599)
    • 235ea57 build(deps-dev): bump eslint from 8.26.0 to 8.27.0 (#598)
    • a6ed001 build(deps-dev): bump @​typescript-eslint/eslint-plugin from 5.41.0 to 5.42.0 ...
    • 3a7156a build(deps-dev): bump @​typescript-eslint/parser from 5.40.1 to 5.41.0 (#596)
    • 481f8ba build(deps): bump @​types/semver from 7.3.12 to 7.3.13 (#595)
    • 06edb37 build(deps-dev): bump @​typescript-eslint/eslint-plugin from 5.40.1 to 5.41.0 ...
    • c2f79a7 build(deps): bump @​actions/cache from 3.0.5 to 3.0.6 (#593)
    • d6eac69 build(deps-dev): bump @​typescript-eslint/eslint-plugin from 5.40.0 to 5.40.1 ...
    • 7268434 build(deps-dev): bump eslint from 8.25.0 to 8.26.0 (#591)
    • a926e2b build(deps-dev): bump @​typescript-eslint/parser from 5.40.0 to 5.40.1 (#590)
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Handle <br> inside <dl>

    Handle
    inside

    The following input (instead of <br>, two spaces can also be used):

    **ADD_IMAGE_EXCLUDES**=*"/etc/ltsp/add-image.excludes"*<br>
    **OMIT_IMAGE_EXCLUDES**=*"home/\*"*
    :   Add or omit items to the `ltsp image` exclusion list.
    

    gives a completely messed up output, with some parts missing and some other parts getting duplicated:

    .TP
    \fBOMIT_IMAGE_EXCLUDES\fP=\fI"home/*"\fP
    Add or omit items to the \fB\fCltsp image\fR exclusion list.
    
    .PP
    Add or omit items to the \fB\fCltsp image\fR exclusion list.
    

    To work around this, currently I'm using sed to change the initial markdown code to:

    **ADD_IMAGE_EXCLUDES**=*"/etc/ltsp/add-image.excludes"*
    :
    
    **OMIT_IMAGE_EXCLUDES**=*"home/\*"*
    :   Add or omit items to the `ltsp image` exclusion list.
    
    

    With a bit of pre-processing and post-processing and special casing, go-md2man produces nice output! We'll switch to that again for ltsp.org, thank you!

    opened by alkisg 0
  • Don't duplicate <url>

    Don't duplicate

    With this input:

    <https://ltsp.org>
    

    this output is produced:

    https://ltsp.org
    \[la]https://ltsp.org\[ra]
    

    That would make sense for the [text](url) syntax, but it doesn't make sense for the <url> syntax where the text is the link itself. There's no need to see it twice.

    Ronn produces this instead:

    \fIhttps://ltsp\.org\fR
    

    Pandoc produces this instead:

    <https://ltsp.org>
    

    Both of them are acceptable. Thank you!

    opened by alkisg 0
  • Behave more like a regular POSIX utility

    Behave more like a regular POSIX utility

    Don't close stdin, even at end-of-file. (Although this doesn't affect the code as it stands, it makes it brittle when incorporating into a larger program, where closing fd#0 could lead to it being reassigned to some other purpose.)

    When '-' is used as the input or output name, use stdin or stdout instead (in line with POSIX guidelines).

    opened by kurahaupo 2
  • Add release script for GitHub Actions

    Add release script for GitHub Actions

    I'll be testing this to verify, but it's probably 99% correct. Generates a Windows and Linux amd64 binary, puts it in a tarball, creates a sha256 sum and uploads those 4 items to the release downloads. Would require that the release notes are attached to the signed tag so it can be pulled from there to make the release notes in the GH release page.

    Questions: do we want another binary for arm64 or anything else? It wouldn't be tested of course, and I guess the Windows one isn't being tested either. This could be simplified just to create and upload the amd64 Linux binary as well.

    Signed-off-by: Phil Estes [email protected]

    opened by estesp 1
Releases(v2.0.2)
  • v2.0.2(Apr 25, 2022)

    This is just a housekeeping patch to bring in Dockerfile changes into the v2.0.x tree. Changes include:

    • Cross compile support
    • Bump go from 1.8 to latest (1.18)
    • Make go version and go image used configurable
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Jul 20, 2021)

    This release has a number of rendering bugs resolved. I’d hoped to squash a few more but the fixes were a little more tricky and need more time to get right.

    Thanks to all the contributors!

    Full changelog:

    • df89e5f - Fix go version var in ci yaml (Brian Goff)
    • ed62554 - Merge pull request #74 from kolyshkin/overescape (Brian Goff)
    • 1c88e95 - Do not escape dash, underscore, and ampersand (Kir Kolyshkin)
    • 934d1d5 - Fix wrapping for longer cell content (Sebastiaan van Stijn)
    • 817886f - Set up Dependabot (#71) (Matthieu MOREL)
    • 9962558 - Fix inline markup causing table cells to split (Sebastiaan van Stijn)
    • 9414b4c - Fix missing carriage return before .TE if last table cell is empty (Sebastiaan van Stijn)
    • 9654f2a - Revert "added linebreak before .TE (table end)" (Sebastiaan van Stijn)
    • 2d04436 - Revert "Fix newline in table test" (Sebastiaan van Stijn)
    • 129c806 - Makefile: rm check and lint targets (Kir Kolyshkin)
    • 8a6c065 - ci/gha: add golangci-lint run (Kir Kolyshkin)
    • 2ed4073 - ci/gha: update (Kir Kolyshkin)
    • da4e952 - Fix handling multiple definition descriptions (Kir Kolyshkin)
    • 563aa3a - Ignore unknown HTML tags to prevent noisy warnings (Sebastiaan van Stijn)
    • b0a9a12 - Bump github.com/russross/blackfriday/v2 to v2.1.0 (Tobias Klauser)
    • f96407e - remove travis config, as CI now runs as GitHub action (Sebastiaan van Stijn)
    • 1029f53 - Add testing action (Brian Goff)
    • 6615cdb - Fix newline in table test (Brian Goff)
    • 1fc61ec - added linebreak before .TE (table end) (bud)
    • 45be6e4 - chore: set go minimal version to 1.11 (Quentin Brosse)
    • 1f4b25f - Remove escaping tilde character (Ivan Valdes (@ivanvc))
    Source code(tar.gz)
    Source code(zip)
  • v1.0.10(Mar 14, 2019)

  • v1.0.9(Mar 14, 2019)

  • v1.0.8(Feb 6, 2018)

  • v1.0.7(Aug 30, 2017)

    • Switch vendor tool to dep https://github.com/cpuguy83/go-md2man/pull/29
    • Update blackfriday vendoring to v1.5 https://github.com/cpuguy83/go-md2man/pull/29

    Thanks to @zevdg for working on getting this over to dep!

    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(Sep 7, 2016)

    • Vendor in dependencies (#23)
    • Use stdin/stdout if no -in or -out is specified (#22)
    • Fix issue where link text was not being printed (#21)

    Thanks to contributors for this release: @AkihiroSuda

    Source code(tar.gz)
    Source code(zip)
Owner
Brian Goff
Brian Goff
Markdown - Markdown converter for golang

markdown ?? Talks ?? Join ?? Youtube ❤️ Sponsor Install via nami nami install ma

TxThinking 3 Jun 2, 2022
Mdfmt - A Markdown formatter that follow the CommonMark. Like gofmt, but for Markdown

Introduction A Markdown formatter that follow the CommonMark. Like gofmt, but fo

杨英明 15 Aug 24, 2022
Blackfriday: a markdown processor for Go

Blackfriday Blackfriday is a Markdown processor implemented in Go. It is paranoid about its input (so you can safely feed it user-supplied data), it i

Russ Ross 5k Nov 26, 2022
⚙️ Convert HTML to Markdown. Even works with entire websites and can be extended through rules.

html-to-markdown Convert HTML into Markdown with Go. It is using an HTML Parser to avoid the use of regexp as much as possible. That should prevent so

Johannes Kaufmann 429 Nov 27, 2022
Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.

Tagify Gets STDIN, file or HTTP address as an input and returns a list of most popular words ordered by popularity as an output. More info about what

ZoomIO 24 Sep 27, 2022
Upskirt markdown library bindings for Go

Goskirt Package goskirt provides Go-bindings for the excellent Sundown Markdown parser. (F/K/A Upskirt). To use goskirt, create a new Goskirt-value wi

Jukka-Pekka Kekkonen 32 Oct 23, 2022
A CLI markdown converter written in Go.

MDConv is a markdown converter written in Go. It is able to create PDF and HTML files from Markdown without using LaTeX. Instead MDConv u

null 43 Nov 12, 2022
A markdown renderer package for the terminal

go-term-markdown go-term-markdown is a go package implementing a Markdown renderer for the terminal. Note: Markdown being originally designed to rende

Michael Muré 252 Nov 23, 2022
A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.

goldmark A Markdown parser written in Go. Easy to extend, standards-compliant, well-structured. goldmark is compliant with CommonMark 0.29. Motivation

Yusuke Inuzuka 2.4k Nov 27, 2022
:triangular_ruler:gofmtmd formats go source code block in Markdown. detects fenced code & formats code using gofmt.

gofmtmd gofmtmd formats go source code block in Markdown. detects fenced code & formats code using gofmt. Installation $ go get github.com/po3rin/gofm

po3rin 91 Oct 31, 2022
Convert Microsoft Word Document to Markdown

docx2md Convert Microsoft Word Document to Markdown Usage $ docx2md NewDocument.docx Installation $ go get github.com/mattn/docx2md Supported Styles

mattn 560 Nov 15, 2022
Stylesheet-based markdown rendering for your CLI apps 💇🏻‍♀️

Glamour Write handsome command-line tools with Glamour. glamour lets you render markdown documents & templates on ANSI compatible terminals. You can c

Charm 1.4k Nov 18, 2022
A PDF renderer for the goldmark markdown parser.

goldmark-pdf goldmark-pdf is a renderer for goldmark that allows rendering to PDF. Reference See https://pkg.go.dev/github.com/stephenafamo/goldmark-p

Stephen Afam-Osemene 91 Oct 21, 2022
Markdown to Webpage app

mark2web Markdown to webpage link Usage $ mark2web test.md https://mark2web.test/aa32d8f230ef9d44c3a7acb55b572c8599502701 $ mark2web /tmp/session/test

Faithfulness Alamu 5 Apr 18, 2021
Markdown Powered Graph API

What is Arachne? Arachne, (Greek: “Spider”) in [[greek/mythology]], the [[Arachne:daughter of:Idmon of Colophon]] in Lydia, a dyer in purple. Arachne

Jesus Moreno 7 Dec 19, 2021
Schedule daily tweets from markdown files in your repo, posted via github actions.

markdown-tweet-scheduler Schedule daily tweets from markdown files in your repo, posted to twitter via github actions. Setup Fork this repo Get your t

reid j sherman 87 Oct 26, 2022
Hugo-to-Gemini Markdown converter

Hugo-to-Gemini converter This repo holds a converter of Hugo Markdown posts to text/gemini (also named Gemtext in this README). The converter is suppo

Timur Demin 21 Nov 19, 2022
Parse data and test fixtures from markdown files, and patch them programmatically, too.

go-testmark Do you need test fixtures and example data for your project, in a language agnostic way? Do you want it to be easy to combine with documen

Eric Myhre 20 Oct 31, 2022
Automation Tool to auto generate markdown notes from online classes/talks/presentations.

autonotes Automation tool to autocapture screenshots and join them with a supplied .srt or .txt file and output a notes file in markdown. Problem? Wat

Marcos Soares 3 Aug 29, 2021