This is an Azure DevOps task that generates JSON files from Markdown files which can then be consumed by your front-end app. Basically, a static API generator.
The extension consists of the following two tasks. You need to add these tasks in this order.
- Install Markdown to API Dependencies
- Markdown to API
Add this task before the Markdown to API
task so all the required dependencies can be installed and ready for use. No inputs required.
Add this task to process your Markdown files into JSON files. This task requires one user input - the location of the config file including the name of the file itself. So, in the screenshot below, the JSON config file was located in the Example1
folder and was named markdown-to-api.json
hence that's the value that was entered in the field. Remember, you can name the config anything you like, and as long as your config file follows the schema (details below), you should be sweet!
You can organise your Markdown files as you like. You can also add FrontMatter to each Markdown file. This task will convert each Markdown file into a JSON file and maintain the same folder structure in the output directory. It will also generate a summary JSON file which will contain the details of all Markdown files in a single JSON file.
The following JSON properties are expected in the config file.
Property | Description | Mandatory? | Default value |
---|---|---|---|
inputDir | Path to folder where the input Markdown files are located. | Yes | N/A |
inputFileExtension | The file extension of the input files. | No | .md |
outputDir | Path to folder where the processed JSON files will be placed. | No | output/all |
summaryOutputDir | Path to folder where the summary JSON file will be placed. | No | output/summary |
summaryFilename | The filename of the summary JSON file. | No | summaryJSON<DATETIME_VALUE>.json |
Find more information on the usage and different scenarios in this GitHub repository.
The easiest way is to create an issue on GitHub.
This extension is developed by Clyde D'Souza.
The npm package processmd which converts Markdown to JSON is developed by Tim Scanlin.
Copyright (c) 2020 Clyde D'Souza