Skip to content

Generate JSON files from Markdown files which can then be consumed by your front-end app. Basically, a static API generator.

License

Notifications You must be signed in to change notification settings

ClydeDz/markdown-to-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Markdown to API Azure DevOps Task icon

Markdown to API

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.

Azure DevOps builds Azure DevOps tests Quality Gate Status Maintainability Rating Visual Studio Marketplace Installs - Azure DevOps Extension Visual Studio Marketplace Version MIT License Azure DevOps builds Tweet about this

Tasks

The extension consists of the following two tasks. You need to add these tasks in this order.

  1. Install Markdown to API Dependencies
  2. Markdown to API

tasks

Install Markdown to API Dependencies

Add this task before the Markdown to API task so all the required dependencies can be installed and ready for use. No inputs required.

tasks

Markdown to API

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!

tasks

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.

Schema of the config 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

Examples

Find more information on the usage and different scenarios in this GitHub repository.

Support

The easiest way is to create an issue on GitHub.

Credits

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