Open flexseth opened 5 months ago
I'd say this ask falls under #119, where we're collecting ideas for all kinds of block editor related commands.
The problem is, a convert
command like this is almost impossible to build. All the information about blocks and their markup only exists in JavaScript.
We might be able to hardcode something for the core blocks such as paragraph/heading/image, but that's a maintenance nightmare as we can't possibly keep up with any changes from Gutenberg.
Description
The
convert
command forWP-CLI
changes data from one type to another.Sample use case:
Markdown
toBlock Markup
The idea is to be able to consume a
Markdown
file and turn it into aHTML
file, which could then be copy/pasted or otherwise imported via the CLI into the Block Editor.Given the following
best-chicken-wings-in-scotland.md
fileConverts to
Syntax
wp post convert best-chicken-wings-in-scotland.md
Flags
--create
ā Create the post as a draft in this WordPress instance.--copy
ā CopyHTML
to the clipboard.--no-follow
ā Addno-follow
to any image tags (good for adverts)Behind the scenes
Uploads any images found into the
Media Gallery