Download the PHP package tinacms/wp-gatsby-markdown-exporter without Composer

On this page you can find all versions of the php package tinacms/wp-gatsby-markdown-exporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-gatsby-markdown-exporter

WP Gatsby Markdown Exporter

A command line WordPress plugin to export WordPress content to Markdown for use with GatsbyJS.

Want to build real-time editing into your Gatsby site? Checkout TinaCMS!

travis ci build status

Features

Usage

  1. Download plugin and enable it, then click "Export to Gatsby" from the WordPress admin sidebar.
  2. Submit the form to download a zip file with exported content.
  3. Place the unzipped files in the content directory of the Markdown based site.

Reminder: always keep a backup of the WordPress database and files in case your export doesn't work as expected!

Checkout the WP-CLI command to run the export from your command line to avoid PHP timeouts!

Installation Methods (choose one)

Download zip file (Easiest)

Download the latest release and unzip the file into wp-content/plugins.

Composer require

Make sure you have Composer installed and navigate to the WordPress site directory, then:

composer require tinacms/wp-gatsby-markdown-exporter

Git clone + Composer

Or clone this repository into wp-content/plugins, then navigate to the wp-gatsby-markdown-exporter directory:

composer install

Enable the plugin

Activate "WordPress to Gatsby Exporter" from the WordPress admin. Or from the plugin's directory:

wp plugin activate wp-gatsby-markdown-exporter

Working with Gatsby

If you're just getting started with Gatsby, we recommend experimenting with a Markdown based Gatsby starter like Tina Grande. Installation is as easy as:

git clone https://github.com/tinacms/tina-starter-grande.git

cd tina-starter-grande

yarn install && gatsby develop

Then copy your exported WordPress Markdown into the content directory or point the wp gatsby-markdown-export command at the content directory.

Want to port your WordPress or HTML theme to Gatsby? Checkout Porting an HTML Site to Gatsby for tips.

Command Line Usage

The command line functionality uses WP-CLI to interact with WordPress. WP-CLI is easy to install if you haven't already.

Once it's installed, you can export content to a directory like this:

wp gatsby-markdown-export --directory=/example/gatsby-starter/src/content

All CLI arguments are optional.

Option Description Default value
--help get help
--directory= export output directory random temp directory
--post_types= post types to export, see: https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters page,post
--post_status= post status to export, see: https://developer.wordpress.org/reference/classes/wp_query/#status-parameters any
--fields_to_markdown= fields to convert to Markdown excerpt
--excluded_front_matter= fields to exclude from front matter
--post_date_format= format for post publish date, see: https://www.php.net/manual/en/function.date.php c
--upload_dir= directory in the export to copy WordPress uploads uploads
--remap_fields= remap front matter field names, example: find1,replace1;find2,replace2
--fields_to_array= convert single value front matter fields to arrays
--include_private_fields= private post meta fields to include (they start with _)
--skip_copy_uploads flag, skips copying WordPress uploads to the export
--skip_original_images flag, skips the use of original dimension images
--skip_enforce_charset flag, skips use of blog_charset for the XML charset
--create_type_directory flag, creates directories based on post type

Hooks

The following hooks can be implemented in a plugin to modify the behaviour of the exporter:

Hook Notes
gatsby_markdown_exporter_posts array of the post ids to be exported
gatsby_markdown_exporter_query_options array of query options for the posts to be exported database query
gatsby_markdown_exporter_post_html_body string of the post's HTML body
gatsby_markdown_exporter_post_converted_body string of the post's body after conversion to Markdown
gatsby_markdown_exporter_post_meta array of the post's meta fields that will become front matter fields

Roadmap

Troubleshooting

What does Warning: The markdown converter encountered invalid HTML and could not convert the content at: mean?

This means that the markdown converter couldn't convert the referenced post to markdown, so we will just copy the HTML as it is.

Acknowledgments

The structure for this plugin was heavily influenced by Ben Balter's excellent WordPress to Jekyll Exporter.

License

This project is licensed under the GPLv3 License - see the LICENSE file for details.


All versions of wp-gatsby-markdown-exporter with dependencies

PHP Build Version
Package Version
Requires symfony/yaml Version ^3.4
league/html-to-markdown Version ^4.8
symfony/filesystem Version ^3.4.32
composer/installers Version ^1.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tinacms/wp-gatsby-markdown-exporter contains the following files

Loading the files please wait ....