parser

package module
v0.0.0-...-5c1395a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 8 Imported by: 3

README ¶

Markdown Parser Docs

Go library to parse markdown to grab various things

This library will parse a given markdown file and grab all links from it and put it into a hashmap map[string]string to use.

Install

go get -u github.com/nikitavoloboev/markdown-parser

Usage

See Docs.

You can see this library being used in Alfred Awesome Lists to grab all links from Sindre's awesome lists and filter the results in Alfred.

Contribute

Always open to useful ideas or fixes in form of issues or PRs.

Can open new issue (search existing issues first) or start discussion.

It's okay to submit draft PR as you can get help along the way to make it merge ready.

Join Discord for more indepth discussions on this repo and others.

🖤

Support on GitHub or look into other projects.

Discord X nikiv.dev

Documentation ¶

Overview ¶

Package parser provides methods to grab all links from markdown files.

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

func DownloadURL ¶

func DownloadURL(URL string) (string, error)

DownloadURL returns Body response from the URL.

func GetAllLinks(markdown string) map[string]string

GetAllLinks returns all links and their names from a given markdown file.

func ParseImageLink(line string) string

ParseImageLink parses an image line and grabs the Link attached to it. The format of the line should be as follows: `![](Link)`.

func ParseLink(line string) map[string]string

ParseLink parses a line and grabs the Link, Title and the Description attached to it. The format of the line should be as follows: `- [Title](Link) - Description`. Description can be omitted.

func ParseMarkdownFile ¶

func ParseMarkdownFile(fileName string) (map[string]string, error)

ParseMarkdownFile parses a markdown file and returns all markdown links from it.

func ParseMarkdownURL ¶

func ParseMarkdownURL(URL string) (map[string]string, error)

ParseMarkdownURL parses an URL and returns all markdown links from it.

Types ¶

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL