lynks

command module
v0.0.0-...-eb09d14 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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