Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@

A tool to help with reading and analyzing the Gray Paper.

# Updating available versions of the gray paper.
# Related repositories
- Gray Paper Reader community notes [graypaper-notes](https://github.com/fluffylabs/graypaper-notes).
- Gray Paper Archive [graypaper-archive](https://github.com/fluffylabs/graypaper-archive).

# Tooling

- [matrix-bot](./tools/matrix-bot) - Listens to Matrix channel messages and
collects the ones containing GP Reader links. These messages can later be
turned into notes JSON file.
- [links-check](./tools/links-check) - Scan a set of files for GP Reader links
and check their versions or generate notes JSON file.

# Updating available versions of the Gray Paper

Gray Paper versions are stored in [a separate repository](https://github.com/fluffylabs/graypaper-archive),
added as a git submodule.
Expand Down
32 changes: 30 additions & 2 deletions tools/links-check/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Gray Paper Reader - Links Checker

This CLI tool allows you to scan files passed as parameters
in a lookout for links to Gray Paper (GP) Reader.
in a lookout for links to the Gray Paper (GP) Reader.

Each of these links is then evaluated:

1. We check if the links points to the latest version of the GP.
2. If not, we propose an updated link.
3. We indicate if the updated link is most likely broken due to changes in the GP.

## Usage
On top the tool is able to:
- automatically update the links to recent version (`--write`)
- generate a JSON file that can be imported to Gray Paper Reader
(or used as remote notes source) containing notes with filenames with the links
(`--generate-notes`)

## Quick Start

```bash
npx @fluffylabs/links-check ./path-to-my-project/**/*.ts
Expand Down Expand Up @@ -43,3 +49,25 @@ scanning 3703: 405.271ms
⚠️ Yet there are 57 outdated links. See above.
```

## Options

```
Usage: gp-links-check [options] <paths...>

Arguments:
paths Paths of files to be scanned. Supports glob patterns.

Options:
--ignore-file <path> Path to a file containing patterns to ignore. Gitignore
format applies. Patterns are resolved according to current
working directory.
--fail-on-broken Exit with an error code when broken links are detected.
--version <name> Commit hash of specific version to update to (instead of
latest).
--write Modify the files and update reader links to
requested/lastest versions.
--fix Alias for --write.
--generate-notes <file.json> Generate notes for the Gray Paper Reader.
--generate-notes-label <label> Label assigned to all generated notes.
-h, --help display help for command
```