Skip to content

Rust tool to generate markdown tables from JSON files, built for Locatarr's website

License

Notifications You must be signed in to change notification settings

Locatarr/markdown-table-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Table Generator

Generate markdown tables from a JSON definition for publication on locatarr.github.io.

Usage

JSON file format

{
    "applications": [
        {
            "name": "AppName",
            "description": "App Description",
            "github_slug": "github/link", // github_slug is an optional field
            "subreddit": "r/subreddit" // subreddit is an optional field
        }
    ]
}

GitHub Actions Format

- name: Generate MD Table
  id: generate-md-table
  uses: Locatarr/markdown-table-generator@<version> # Specific release version tag to pull from
  with:
    file-path: ${{ github.workspace }}/my-json.json

When run the action will generate a file that will live for the rest of the job at a random location on disk. To obtain the file name, use the output-file step output. (Ex. cat ${{ steps.generate-md-table.outputs.output-file }})

CLI

Generate from a file

$ markdown-table-generator myfile.json
| **Application** | **Description** | **Github** | **Reddit** |
|-|-|-|-|
| AppName | App Description | GitHub Link | Subreddit |
...

Generate from standard input

$ cat myfile.json | markdown-table-generator -
| **Application** | **Description** | **Github** | **Reddit** |
|-|-|-|-|
| AppName | App Description | GitHub Link | Subreddit |
...

OR

$ cat myfile.json | markdown-table-generator
| **Application** | **Description** | **Github** | **Reddit** |
|-|-|-|-|
| AppName | App Description | GitHub Link | Subreddit |
...