🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

grunt-wp2md

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-wp2md

Convert WordPress XML to static Markdown files.

latest
Source
npmnpm
Version
0.1.7
Version published
Maintainers
1
Created
Source

grunt-wp2md

Build Status

Convert WordPress XML to static Markdown files.

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-wp2md --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-wp2md');

The "wp2md" task

Overview

In your project's Gruntfile, add a section named wp2md to the data object passed into grunt.initConfig().

grunt.initConfig({
  wp2md: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

Options

format

Type: String
Default value: 'yyyy-mm-dd'

Add date prefix name to markdown generated file. Example: 2013-11-27-filename.md

posts

Type: String
Default value: '_posts'

Posts destination folder

drafts

Type: String
Default value: '_drafts'

Drafts destination folder

pages

Type: String
Default value: ''

Pages destination folder

Usage Examples

WordPress XML

Export your content in "Tools" → "Export" → "WordPress" in your WordPress dashboard and put XML file to /path/to/wordpress.xml

wpxml

Default

To simplify might do something like:

grunt.initConfig({
  wp2md: {
    default_options: {
      files: {
        'path/to/': ['/path/to/wordpress.xml'],
      },
    },
  }
});

Custom

grunt.initConfig({
  wp2md: {
    custom_options: {
      options: {
        format: '',
        posts: 'src/_posts',
        drafts: 'src/_drafts',
        pages: 'src/pages'
      },
      files: {
        'tmp/custom_options/': ['test/fixtures/*.xml'],
      },
    },
  }
});

Output

wp2md-output

Author

Hariadi Hinta

Release history

DATE VERSION CHANGES

  • 2013-11-25 v0.1.3 Use external library for async and lodash for great performance.,Upgrade Grunt 0.4.2
  • 2013-07-29 v0.1.2 Add destination options to posts, drafts and pages.
  • 2013-07-28 v0.1.1 Documentation tweaks.,Add Travis.
  • 2013-10-27 v0.1.0 Initial

License

Copyright (c) 2014 Hariadi Hinta, contributors.
Released under the MIT license

Keywords

gruntplugin

FAQs

Package last updated on 27 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts