Generate a global index for multiple markdown files recursively

made-with-Go codecov https://goreportcard.com/report/github.com/mmiranda/markdown-index Test

markdown index

Markdown-index is a library to help you generate a global index for multiple markdown files recursively in a directory, containing a summary of every file found.

Installation

The easiest way to install it is using Homebrew:

brew tap mmiranda/mdindex
brew install markdown-index

If you prefer, you also can download the latest binary on the release section, or simply use the pre-built dockerfile image

Usage

You can use this tool using multiple ways:

Running Local

cd some-directory
markdown-index

Dockerfile

docker pull ghcr.io/mmiranda/markdown-index:latest
docker run --rm -it -v /path/to/root/md/files:/data ghcr.io/mmiranda/markdown-index:latest

After running the command, a new markdown file will be created containing a summary of every other file found.

Github Actions

Yes, you can integrate this tool into your pipeline.

Check the live-example for GH Actions and copy it to your own repo!

Contributing

Contributions, issues, and feature requests are welcome!

Give a ⭐️ if you like this project!

License

MIT

Similar Resources

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

Jan 8, 2023

⚙️ Convert HTML to Markdown. Even works with entire websites and can be extended through rules.

⚙️ 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

Jan 6, 2023

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.

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

Dec 19, 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

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

Dec 20, 2022

A markdown renderer package for the terminal

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

Nov 25, 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

Dec 29, 2022

:triangular_ruler:gofmtmd formats go source code block in Markdown. detects fenced code & formats code using gofmt.

: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

Oct 31, 2022

Convert Microsoft Word Document to Markdown

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

Jan 4, 2023
Comments
  • Segfault when running

    Segfault when running

    Running on macOS 10.14.6. Installed using

    brew tap mmiranda/mdindex
    brew install markdown-index
    

    Ran in directory tree holding a bunch of .md files. Ran for 11 seconds, and then segfaulted:

    mbpe-ethernet:dev griscom$ markdown-index
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x110 pc=0x125c5db]
    
    goroutine 1 [running]:
    github.com/mmiranda/markdown-index/markdown.(*rawMarkdown).getFirstParagraph.func1({0x13e9390, 0xc00035a750}, 0x0)
    	/home/runner/work/markdown-index/markdown-index/markdown/markdown.go:176 +0x19b
    github.com/yuin/goldmark/ast.walkHelper({0x13e9390, 0xc00035a750}, 0xc0000afba0)
    	/home/runner/go/pkg/mod/github.com/yuin/[email protected]/ast/ast.go:492 +0x34
    github.com/yuin/goldmark/ast.walkHelper({0x13e9810, 0xc00035a6c0}, 0xc0000afba0)
    	/home/runner/go/pkg/mod/github.com/yuin/[email protected]/ast/ast.go:498 +0x8e
    github.com/yuin/goldmark/ast.walkHelper({0x13e96f0, 0xc00035a630}, 0xc0000afba0)
    	/home/runner/go/pkg/mod/github.com/yuin/[email protected]/ast/ast.go:498 +0x8e
    github.com/yuin/goldmark/ast.walkHelper({0x13e8f10, 0xc00035a120}, 0xc0000afba0)
    	/home/runner/go/pkg/mod/github.com/yuin/[email protected]/ast/ast.go:498 +0x8e
    github.com/yuin/goldmark/ast.Walk(...)
    	/home/runner/go/pkg/mod/github.com/yuin/[email protected]/ast/ast.go:487
    github.com/mmiranda/markdown-index/markdown.(*rawMarkdown).getFirstParagraph(0xc000482210)
    	/home/runner/work/markdown-index/markdown-index/markdown/markdown.go:167 +0x9d
    github.com/mmiranda/markdown-index/markdown.buildIndexContent({0x133d50e, 0x12baea5}, {0x0, 0xc00021fda0, 0xc00021fdc8})
    	/home/runner/work/markdown-index/markdown-index/markdown/markdown.go:269 +0x227
    github.com/mmiranda/markdown-index/markdown.Execute({0x1343ed8, 0x11}, {0x133d50e, 0x1})
    	/home/runner/work/markdown-index/markdown-index/markdown/markdown.go:47 +0x52
    github.com/mmiranda/markdown-index/cmd.glob..func1(0x159ca00, {0x133df65, 0x0, 0x0})
    	/home/runner/work/markdown-index/markdown-index/cmd/root.go:24 +0x35
    github.com/spf13/cobra.(*Command).execute(0x159ca00, {0xc000010200, 0x0, 0x0})
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x5f8
    github.com/spf13/cobra.(*Command).ExecuteC(0x159ca00)
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc
    github.com/spf13/cobra.(*Command).Execute(...)
    	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
    github.com/mmiranda/markdown-index/cmd.Execute()
    	/home/runner/work/markdown-index/markdown-index/cmd/root.go:47 +0x25
    main.main()
    	/home/runner/work/markdown-index/markdown-index/main.go:6 +0x17
    
  • Feature: add `-v`/`--verbose` flag which lists files being processed

    Feature: add `-v`/`--verbose` flag which lists files being processed

    I'm hitting a segfault, which I presume is due to something strange in one of my markdown files. Having a -v/--verbose flag which printed out file names as they were parsed would be really helpful in tracking the problem down.

  • `-- skip` flag broken?

    `-- skip` flag broken?

    The --skip flag seems to be broken:

    mbpe-ethernet:dev griscom$ markdown-index --skip bricks
    Error: unknown flag: --skip
    Usage:
      markdown-index [flags]
      markdown-index [command]
    
    Available Commands:
      help        Help about any command
      version     Version will output the current build information
    
    Flags:
          --directory string       Directory to search markdown files recursively (default ".")
          --heading string         Use this Heading inside the markdown file as summary of the file
      -h, --help                   help for markdown-index
          --output string          Final markdown file to be created (default "markdown-index.md")
          --skipDirectory string   Skip directory in the recursive walk
    
    Use "markdown-index [command] --help" for more information about a command.
    
    Error: unknown flag: --skip
    mbpe-ethernet:dev griscom$ markdown-index --skipbricks
    Error: unknown flag: --skipbricks
    Usage:
      markdown-index [flags]
      markdown-index [command]
    
    Available Commands:
      help        Help about any command
      version     Version will output the current build information
    
    Flags:
          --directory string       Directory to search markdown files recursively (default ".")
          --heading string         Use this Heading inside the markdown file as summary of the file
      -h, --help                   help for markdown-index
          --output string          Final markdown file to be created (default "markdown-index.md")
          --skipDirectory string   Skip directory in the recursive walk
    
    Use "markdown-index [command] --help" for more information about a command.
    
    Error: unknown flag: --skipbricks
    mbpe-ethernet:dev griscom$ 
    
  • Adding Debug mode and renaming skip dir options

    Adding Debug mode and renaming skip dir options

    • Adding --debug mode to help troubleshoot issues with a few list of Markdowns
    • Renaming flag --skipDirectory to --skip since the name was a but confusing
Markdown - Markdown converter for golang

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

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

Dec 18, 2022
Automation Tool to auto generate markdown notes from online classes/talks/presentations.
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

Aug 29, 2021
Generate markdown from go-flags

goflags-markdown -- generate markdown from a go-flags parser TODO Commands/sub-commands/etc Custom formatting Usage package main import ( "os" fla

May 22, 2022
Generate markdown formatted sprint updates based on the Jira tickets were involved in the given sprint.

Generate markdown formatted sprint updates based on the Jira tickets were involved in the given sprint.

Nov 15, 2021
Ngram index for golang

go-ngram N-gram index for Go. Key features Unicode support. Append only. Data can't be deleted from index. GC friendly (all strings are pooled and com

Dec 29, 2022
Go XML sitemap and sitemap index generator

Install go get github.com/turk/go-sitemap Example for sitemapindex func () main(c *gin.Context) { s := sitemap.NewSitemapIndex(c.Writer, true)

Jun 29, 2022
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

Dec 6, 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

Oct 31, 2022
Convert your markdown files to PDF instantly
Convert your markdown files to PDF instantly

Will take a markdown file as input and then create a PDF file with the markdown formatting.

Nov 7, 2022