Skip to content

Commit

Permalink
Added configuration values table
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-nelson committed Jun 23, 2024
1 parent dc7f1a5 commit f6e9a1d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,23 @@ dirs:
useGitIgnore: true
```

If you are defining a custom configuration, you must include the `dirs` or `files` section in the configuration file.

Following are the available configuration options:

| Option| Description| Required |
|---|---|---|
| [`files`](#files-to-check) | The list of Markdown files to check for broken links. | Yes, if `dirs` is not specified. |
| [`dirs`](#directories-to-search) | The list of directories to search for Markdown files. | Yes, if `files` is not specified. |
| [`excludedFiles`](#excluded-files) | The list of Markdown files to exclude from the link checking process. | No |
| [`excludedDirs`](#excluded-directories) | The list of directories to exclude from the link checking process. | No |
| [`baseUrl`](#base-url) | The base URL to use when checking relative links in Markdown files. | No |
| [`ignorePatterns`](#ignore-patterns) | The list of regular expressions that match URLs to be ignored during link checking. | No |
| [`replacementPatterns`](#replacement-patterns) | The list of regular expressions and replacement strings to modify URLs during link checking. | No |
| [`aliveStatusCodes`](#alive-status-codes) | The list of HTTP status codes that are considered as "alive" links. | No |
| [`useGitIgnore`](#use-gitignore) | Indicates whether to use the rules defined in the `.gitignore` file to exclude files and directories. | No |
| [`modifiedFilesOnly`](#check-modified-files-only) | Indicates whether to check only the files that have been modified in the last git commit. | No |

### Files to Check

The `files` section specifies the Markdown files that Linkspector should check for broken links. You can add the file paths you want to include in this list. For example:
Expand Down
2 changes: 1 addition & 1 deletion index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test('linkspector should check top-level relative links in Markdown file', async
}

expect(hasErrorLinks).toBe(false)
expect(results.length).toBe(7)
expect(results.length).toBe(17)
})

test('linkspector should add back the removed duplicates when returning the results', async () => {
Expand Down

0 comments on commit f6e9a1d

Please sign in to comment.