Skip to content

πŸ“„πŸ”— ✨ This library allows you to find links within markdown files, filter them in an array, validate them, provide statistics and look for broken links. / Project for Laboratoria πŸ’›πŸ˜Š

Notifications You must be signed in to change notification settings

mysticBel/LIM015-md-links

Β 
Β 

Repository files navigation

Markdown Links πŸ”— ✨

`
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ             Welcome to             β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–€β–„β–€β–ˆ β–ˆβ–€β–€β–„ β–‘β–‘ β–ˆβ–‘β–‘ β–‘β–€β–‘ β–ˆβ–€β–€β–„ β–ˆβ–‘β–ˆ β–ˆβ–€β–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–‘β–€β–‘β–ˆ β–ˆβ–‘β–‘β–ˆ β–€β–€ β–ˆβ–‘β–‘ β–€β–ˆβ–€ β–ˆβ–‘β–‘β–ˆ β–ˆβ–€β–„ β–€β–€β–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–€β–‘β–‘β–‘β–€ β–€β–€β–€β–‘ β–‘β–‘ β–€β–€β–€ β–€β–€β–€ β–€β–‘β–‘β–€ β–€β–‘β–€ β–€β–€β–€β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–„β–„β–„β–ˆβ–€β–€β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–€β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–ˆβ–ˆβ–ˆβ–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–ˆβ–„β–„β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   . . .   β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–„β–€β–€β–‘β–ˆβ–‘β–‘β–‘β–‘β–€β–ˆβ–„β–€β–„β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–€β–ˆβ–„β–€β–„β–€β–ˆβ–ˆβ–ˆβ–ˆβ–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   aw      β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–€β–ˆβ–„β–ˆβ–„β–ˆβ–ˆβ–ˆβ–€β–‘β–‘β–‘β–‘β–€β–€β–€β–€β–€β–€β–€β–‘β–€β–€β–„β–‘β–‘β–‘β–‘β–‘β–‘ yeaah !!  β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–ˆβ–‘β–„β–„β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–€β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘   . . .   β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–€β–ˆβ–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–„β–‘β–‘β–‘β–‘β–„β–‘β–‘β–‘β–‘β–‘β–€β–ˆβ–ˆβ–ˆβ–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–€β–„β–‘β–‘β–‘β–‘β–‘β–‘β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–€β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–„β–„β–€β–‘β–‘β–‘β–‘β–‘β–€β–€β–„β–„β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–„β–„β–€β–‘β–€β–„β–„β–„β–„β–„β–€β–€β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–€β–€β–€β–€β–€β–€β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–€β–ˆβ–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–„β–€β–€β–‘β–‘β–‘β–€β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘`

Index


1. About md-links

Markdown is a very popular lightweight markup language among developers. It is used in many platforms that handle plain text (GitHub, forums, blogs, ...), and it is very common to find several files in that format in any type of repository (starting with the traditional README.md).

These Markdown files usually contain links that are often broken or no longer valid and that greatly damages the value of the information that you want to share.

In this project, md-links is an executable that reads and analyzes files in Markdown format, to verify the links they contain and report some statistics.

Options:

  • --validate (OK, Fail)
  • --stats (total, unique, broken)

2. How to install mdLinks?

⬇️Install :

Install this library with this command :

npm install mysticbel-mdlinks

or you can also download it from github:

npm install mysticbel/LIM015-md-links

πŸ”Usage:

// Usage: 
  md-links <path-to-file> [options]

// Commands:
  --v, --validate       Show validate links, makes an HTTP request to find out if the link works or not
  --s, --stats          Show basic statistics about links
  --v --s               Show statistics about links : total, unique, broken
  --validate --stats    Show statistics about links : total, unique, broken
  
// Global options:
  -h, --help            display help for command

Options:

--validate

If we pass the --validate option, the module must make an HTTP request to find out if the link works or not. If the link results in a redirect to a URL that responds ok, then we will treat the link as ok.

Example: validate

--stats

If we pass the --stats option, the output will be a text with basic statistics about the links.

Example: stats

We can also combine --stats and --validate to obtain needed statistics from the validation results.

val&stats

--help

If we pass the --help option, the output will be a help menu with all commands.

help

other option

If we pass a non existant option, the output will be a help menu with an 'invalid command' message.

opt-not-valid

no option

What if we put a wrong path or a non-existance file?

If we do not pass any option(s) , the output will be a 'links not found' message and the path doesn't exist.

image6-wrong-path

What if we put a path without an option?

the output will be an array with all the links extracted from the file.

image7-no-opt

3. Flowchart

CLI API

4. Backlog & Planning

I love using Github Projects !! 😍

backlog

5. Learning Objectives

Checklist

General

  • [βœ”οΈπŸ±] Can be installed via npm install --global <github-user>/md-links

README.md

  • [βœ”οΈπŸ³] A board with the backlog for the implementation of the library.
  • [βœ”οΈπŸ³] Technical documentation of the library.
  • [βœ”οΈπŸ³] Library installation and use guide.

API mdLinks(path, opts)

  • [βœ”οΈπŸΌ] The module exports a function with the expected interface (API).
  • [βœ”οΈπŸΌ] Implement single file support.
  • [βœ”οΈπŸΌ] Implement directory support.
  • [βœ”οΈπŸΌ] Implement options.validate

CLI

  • [βœ”οΈπŸ¦„] Exposes executable md-links in the path (configured in package.json)
  • [βœ”οΈπŸ¦„] Runs without errors / expected output
  • [βœ”οΈπŸ¦„] Implement --validate
  • [βœ”οΈπŸ¦„] Implement --stats

Unit tests

  • [βœ”οΈπŸ±] Unit tests cover a minimum of 70% of statements, functions, lines, and branches.
  • [βœ”οΈπŸ±] Pass tests (and linters) (npm test).

test

NodeSchool workshoppers

Otros recursos

image
'md-links' is a project done by Maribel Maza for Laboratoria ,
October 2021 πŸ€—


LinkedIn Github Β 

About

πŸ“„πŸ”— ✨ This library allows you to find links within markdown files, filter them in an array, validate them, provide statistics and look for broken links. / Project for Laboratoria πŸ’›πŸ˜Š

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%