Skip to content

Metalsmith plugin to query excel files with Alasql and convert to markdown

Notifications You must be signed in to change notification settings

patm2013/metalsmith-excel-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metalsmith-excel-markdown

This metalsmith plugin allows you to query excel files using AlaSQL and then convert them into Markdown tables using markdown-tables.

##Usage

var exlmd = require('metalsmith-excel-markdown');
Metalsmith(__dirname)
  .destination('./build')
  .use(exlmd(config({folder: "path/to/excel_files"}))
  .build(function(err) {
    if (err) { throw err; }
  });

Example Source File

---
table: 'people.xlsx'
select: 'First_Name, Age, Email'
additional: 'WHERE First_Name = "Patrick" ORDER BY Age ASC
---
#This table shows users first names, their age, and their email.

<TABLE WILL BE APPENDED AT THE BOTTOM OF THE FILE>

##General Info

It works by scanning files for 'table', 'select', and/or 'additional' attributes.

  • table corresponds to the Excel file to query
  • select lets you add select statements
    • If no select statement is specified, the default statement is '*'
  • additional lets you add other SQL statements such as WHERE and ORDER BY
    • If no additional attribute is specified then it is ignored

###Config A config option ('folder') can also be passed to specify the location of your excel files. By default this is set to 'xlsx/'

###Examples See the example src files for more examples on how to format the original markdown files. There is also an example repo you can clone here

About

Metalsmith plugin to query excel files with Alasql and convert to markdown

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published