$ landslide Machine-Learning-Algorithms.md -i -o > test.html && open test.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
## pip 安装 $ sudo pip install landslide The directory '/Users/yanrui/Library/Caches/pip/http'or its parent directory isnot owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/yanrui/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting landslide Requirement already satisfied: Markdown in /usr/local/lib/python2.7/site-packages (from landslide) (2.6.11) Requirement already satisfied: Jinja2 in /usr/local/lib/python2.7/site-packages (from landslide) (2.10) Requirement already satisfied: docutils in /usr/local/lib/python2.7/site-packages (from landslide) (0.14) Requirement already satisfied: Pygments in /usr/local/lib/python2.7/site-packages (from landslide) (2.2.0) Requirement already satisfied: six in /usr/local/lib/python2.7/site-packages (from landslide) (1.11.0) Requirement already satisfied: MarkupSafe>=0.23in /usr/local/lib/python2.7/site-packages (from Jinja2->landslide) (1.0) Installing collected packages: landslide Successfully installed landslide-1.1.3
var fs = require('fs-extra'); var path = require('path');
// All paths are relative to package.json. var pagesPath = './source/_posts'; var copyFolders = ['./images', './css', './js']; var outputPath = './tmp';
// First delete everything in the tmp directory. console.log('Cleaning previous tmp...'); try { for (var file of fs.readdirSync(outputPath)){ fs.removeSync(path.join(outputPath, file)); } } catch (err){ console.log('Error during cleanup: '+err); process.exit(1); }
// Then read everything in the pages directories. var pages = {}, pagesMeta = {};
// Generate each page from the data provided, using the template. console.log('Generating pages...'); try { for(var page ofObject.entries(pages)) { var pageFullName = page[0]; var pageName = page[0].slice(0, page[0].lastIndexOf('.')); var metaData = pagesMeta.hasOwnProperty(pageName+'.json')
var source_file = pagesPath +'/'+ pageFullName; var target_file = outputPath +'/'+ pageFullName;