Coder Social home page Coder Social logo

marifervl / md-links Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.13 MB

A CLI tool to analyze and validate links in Markdown files. Extract link information and ensure their validity effortlessly. JavaScript-based. Easy installation with `npm install @marifervl/md-links`. Enhance analysis with `--validate` and `--stats` options. Examples: `md-links file.md`, `md-links directory/`. Efficient and reliable.

Home Page: https://www.npmjs.com/package/@marifervl/md-links

JavaScript 100.00%
chalk javascript nodejs unit-testing

md-links's Introduction




Index


1. About the project


This package is a command-line interface (CLI) tool that allows you to analyze Markdown files to extract and validate information about the links they contain.

Programming language


2. Installation


To install the package, use the following command:

npm install @marifervl/md-links


Back


3. Usage


El paquete ofrece la siguiente interfaz:

md-links <path> [options]


Where <path> is the absolute or relative path to the file or directory to analyze, and [options] are additional options that can be used to customize the output.

Options:


--validate

If this option is included, the package will make an HTTP request to verify if each link works correctly. If the link redirects to a URL that responds "ok", then it will be considered as a valid link. The output will include the status of the HTTP response received.


--stats

If this option is included, the output will include basic statistics about the links found in the file. The total number of links found and the number of unique links will be displayed.


--validate --stats

If both options are included, the output will include statistics about the links found, including how many links are broken (i.e., do not respond "ok" when making an HTTP request).


Usage examples


md-links file.md

Prints to the console the links found in the file file.md, along with the file path where each link was found and the text that appears within the link.

md-links directory/

Analyzes all Markdown files within the directory directory/ and its subdirectories, and prints to the console the links found.

md-links file.md --validate

Prints to the console the links found in the file file.md, along with the file path where each link was found, the text that appears within the link, and the status of the HTTP response received when making an HTTP request.

md-links file.md --stats

Prints to the console basic statistics about the links found in the file file.md, including the total number of links found and the number of unique links.

md-links file.md --validate --stats

Prints to the console statistics about the links found in the file file.md, including the total number of links found, the number of unique links, and the number of broken links.


Back


4. Demo



MariferVL-MDLinks.mp4


Back


5. Contribution


If you would like to contribute to the package, please follow these steps:
  1. Fork the repository.
  2. Create a new branch for your changes (git checkout -b my-branch).
  3. Make your changes and commit them ( git commit -am "Add new functionality" ).
  4. Push the changes to your fork ( git push origin my-branch ).
  5. Create a pull request from your fork to the main branch of the original repository.
  6. Wait for your pull request to be reviewed and accepted.


6. License


This package is licensed under the ISC license.

7. References



Back

md-links's People

Contributors

marifervl avatar

Stargazers

Gabriela Gomez avatar

Watchers

 avatar

md-links's Issues

Validate true

  • Imprimir href: URL encontrada.
  • Imprimir text: Texto que aparecía dentro del link ().
  • Imprimir file: Ruta del archivo donde se encontró el link.
  • Imprimir status: Código de respuesta HTTP.
  • Imprimir ok: Mensaje fail en caso de fallo u ok en caso de éxito.

Imprimir en consola

  • Imprimir en consola la lista de archivos en una carpeta.

  • Utilizar la versión síncrona de la función para leer directorios, readdirSync.

Options

  • Crear función md-links para recibir 2 argumentos

Investigar

  • Cómo obtener estádisticas acerca de los links detectados.
  • Cómo obtener los valores Total y Unique.

Indicar rutas

  • Indicar en qué lugar de la computadora se encuentran los archivos ( rutas).

  • Usar librería nativa path para unir dos segmentos de ruta, por ejemplo, si queremos unir:

    /home/Laboratoria/
    ./test

El resultado sería: /home/Laboratoria/test

Validate False

  • Imprimir href: URL encontrada.
  • Imprimir text: Texto que aparecía dentro del link ().
  • Imprimir file: Ruta del archivo donde se encontró el link.

Extensión

  • Obtener extensión del archivo leído.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.