Skip to content

sftsrv/lynks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lynks

A CLI tool for interactively fixing links in markdown files

Features

  • Interactively view list of markdown files in a repository and links between them
  • Support for markdown style links
  • Basic configuration of link aliases
  • Basic linting for links

Installation

The project is still in the early stages of development, at the moment it's only possible to install using go get

Using go install

go install github.com/sftsrv/lynks@latest

Usage

Config

Create a lynks.config.json file from the directory you want to run the command, It should have the following structure:

{
  // root folder from which pages should be resolved
  "root": "./src/docs",
  // if not provided will defult to `relative`
  "resolution": {
    "strategy": "root", // options are `root | relative`
    "keepExtension": false
  },
  "aliases": {
    // aliases resolve relative to the `root`
    // the key can be any value that you use within pages for linking
    "@api": "./generated/api"
  }
}

Running

There are two ways to run the tool:

Interactive

You can run the tool interactively in order to browser files and fix links in all markdown files within the root as defined in the lynks.config.json by simply running lynks

lynks

Linter

The tool can also be run as a linter which will make use of the lynks.config.json and can be run using:

lynks lint

Project Roadmap

Some things that I still want to do before considering this project complete:

  • Add filter to view only broken links
  • Add tests for like everything
  • Respect resolution strategy when reading files as well
  • Flags for more specific behavior like:
    • Interactive "fix" mode
    • Better control of linting
      • Only show files with errors
      • Only show links with errors
  • Help, informative errors, etc.
  • Management of image and mdx links
  • Support for index pages
  • Imporove overall UX
  • Support links with hashes
  • Make resolution more strict
    • e.g. will not accept relative links if resolution mode is root

About

A link-fixer for markdown files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages