Code Monkey home page Code Monkey logo

md2csv's Introduction

Markdown to CSV Conversion

This app was created to try out https://webtask.io.

The app merely converts a Markdown formatted table into CSV format then emails a HTML formatted version of the same file using Sendgrid.

Webtask.io Deployment

npm install wt-cli -g

wt init <your-email-address>@example.com

wt create md2csv.js \
  --name md2csv \
  -s EMAIL_TO=<[email protected]> \
  -s EMAIL_FROM=<[email protected]> \
  -s EMAIL_SENDGRID_APIKEY=<API-KEY> \
  -s URL=https://gist.githubusercontent.com/<raw-file-name>.md

To get the multiline commands above to work on Windows, replace the \ character with ^:

wt create md2csv.js ^
  --name md2csv ^
  -s EMAIL_TO=<[email protected]> ^
  -s EMAIL_FROM=<[email protected]> ^
  -s EMAIL_SENDGRID_APIKEY=<API-KEY> ^
  -s URL=https://gist.githubusercontent.com/<raw-file-name>.md

For the actual conversion, simply set the emailTo and url query parameters in the url handed to you by wt-cli:

curl https://webtask.it.auth0.com/api/run/wt-<your-email>-0/md2csv?webtask_no_cache=1&emailTo=<your-email>@<domain.com>&url=https://git.io/vK4St

Local Deployment

The app can also be run from the command line. .1. Clone the repository locally.

git clone [email protected]:sah2ed/md2csv.git 
cd md2csv/

.2. Next rename the environment file .env-example to .env.

mv .env-example .env

.3. Then edit the values to suit your environment. At a minimum, you'll need to set the URL variable to a valid markdown file containing the table that you want to convert to CSV. Urls to private gists hosted on GitHub will also work.

.4. The conversion will write the CSV to standard out.

npm install
node index.js

.5. Debugging network problems. On Windows use:

SET NODE_DEBUG=request && node index.js

On Linux use:

NODE_DEBUG=request node index.js 

Motivation

Inspired by https://github.com/tomroy/mdtable2csv

md2csv's People

Contributors

sah2ed avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.