md2fs
Markdown to File Structure is a command line tool that converts a single markdown file into separate files and folders based on cli arguments. This tool is made to help coding boot camp instructors develop curriculum using Markdown files on Github and be able to release those files in a managed way.
Markdown Rules
Headers are defined as a single #
# Week 1
These will be the folder names in your output folder. The content for these will be placed into readme.md
, which will by default display on Github.
There are 2 types of activities
## Resources
and ## Exercises
These will be in separate files.
At the end of each activity put ---
to signal that activity has ended.
Example:
# Week 1
- Content
## Exercise
1. Do a thing
2. And another thing
---
Installation
npm install md2fs
Usage
note: File to parse must be in same dir as index.js
With Javascript:
const md2fs = require('md2fs');
md2fs(fileName);
From the Command Line:
node index.js test.md
Goals
Options
--file-in/-fi <path/to/file>
Defines the file to be processed. If left unspecified defaults to the test file in the repo.
--folder-out/-fo <path/to/folder>
Defines the top level output folder. If left unspecified defaults to a folder named output.
--activities/-a <[list of activities]>
Defines the different activity types
ex. md2fs ./readme.md ./dist
How to Contribute
Thank you for considering contributing to this project. To get up and running your going to need to do a few basic things first.
Basic Steps
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Run
npm install
to install local dependencies - Add your changes to
./index.js
and in thesrc
folder - Refer to the Testing section on how to test your changes as you develop
- Run
npm run build
to run babel and prettier on your code. This way we don't have to have a conversation about code formatting. - Commit your changes (
git commit -am "Add some feature"
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Testing
- This project uses new ECMA Script features. You will need to run Babel to propagate your changes in
src
to thelib
folder. - To test your changes use
npm run dev
. This command by default loads the test file in the root of the directory. This file is namedtest.md
. You can change your test file by going into yourpackage.json
and changing where the config is pointing. - note: please remember not commit your custom test change to
package.json
as it would break tests for others.