textrun-repo

Text-Runner actions for verifying the content of the current repository

Usage no npm install needed!

<script type="module">
  import textrunRepo from 'https://cdn.skypack.dev/textrun-repo';
</script>

README

Text-Runner Actions for verifying the content of the current repository

This package provides Text-Runner actions for verifying documentation containing the content of source code files from the repository.

installation

To use these actions, add this package as a development dependency by running npm i -D textrun-repo or yarn i -D textrun-repo.

repo/existing-file

Sometimes you want to mention the name of a file from your application's source code in the documentation. The source/existing-file action verifies this. As an example, consider a codebase contains a file config.yml with content foo: bar. The documentation for this codebase might want to mention this configuration file:

The file <b type="repo/existing-file">config.yml</b> defines configuration
values.

The filename of the source code file is relative to the Markdown file describing it.

repo/existing-file-content

Sometimes you want to just display a file from your application's source code in the documentation. The source/existing-file-content action verifies such documentation. As an example, consider a codebase contains a file config.yml with content foo: bar. The documentation for this codebase might want to mention this configuration file:

<a type="repo/existing-file-content">

The **config.yml** file defines configuration values. The current settings are:

```
foo: bar
```

</a>

This action assumes that the documentation contains the filename in bold or italic and the content as a single or triple fenced code block. The filename of the source code file is relative to the Markdown file describing it. You can also provide a directory in which your file is located via a link in the active region. Let's say you have a file foo/bar/hello.txt in your code base with the content hello world!. You can display its content in your documentation via this active region:

<a type="repo/existing-file-content">

The **hello.txt** file in the [bar folder](foo/bar) contains this section:

`hello world!`

</a>

repo/executable

The repo/executable action verifies that an executable that the documentation mentions exists and is indeed executable. It doesn't run the executable. As an example, consider a codebase that contains an executable scripts/setup. The semantic documentation for this codebase might look like this:

Run the <b type="repo/executable">scripts/setup</b> binary to set up your
environment.