Open ecotechie opened 5 years ago
@ecotechie If you have the package properly loaded, you can simply run:
$ wp present my-presentation.md
It looks like the command is registered... Can you share the Markdown file you're using?
Got it working :confetti_ball:
Looking further into it, I now realize you must register the command on one of the yml files using:
require:
- packages/local/present.php
Right?
Was hoping to be able to just do a quick wp eval-file.... my bad.
The command should register as soon as the PHP file is loaded: https://github.com/danielbachhuber/wp-cli-present-command/blob/master/present.php#L203
How would you load the php file in the command line without first setting the require:
in a yml file?
Clearly, I'm lacking in skills here :disappointed:
Sorry, taking a step all of the way back, here's how I was able to get it working locally:
First, I cloned the repository locally:
$ cd ~/.wp-cli
$ git clone git@github.com:danielbachhuber/wp-cli-present-command.git
Second, I edited ~/.wp-cli/config.yml
to load the command:
require:
- wp-cli-present-command/present.php
At this point, I could run wp present
and see some output:
$ wp present
usage: wp present <file>
Then you just load your presentation file into the command:
The contents of presentation.md
is this:
# This is the first presentation slide
It has some text in the body.
***
# This is the second presentation slide
The ***
splits the content into multiple slides.
Oh. If you installed this with wp package install
, then the present
command wouldn't be registered because there's no autoloader defined.
Thanks for all the info!!!
I got it working as you suggested. Cloned with git.
Pretty fun package :smile: I'll provably change some things and get back to you with a pull request (just some additional formatting or such). I hope you don't mind me using it for a WordCamp talk. Giving credit to you of course!
I got it working as you suggested. Cloned with git.
Glad to hear :)
I'll provably change some things and get back to you with a pull request (just some additional formatting or such)
That'd be great! It'd be really helpful to have a README too. I haven't used this in such a long time that I've mostly forgotten how it works.
I hope you don't mind me using it for a WordCamp talk.
Sounds good, good luck! Let me know how it goes.
What are best practices for using this command?
I was able to run the command by creating a config.yml file under ~/.wp-cli:
I've tried running the command with:
Fairly certain I'm missing an easy solution to running the command :smile: