Download the PHP package mallardduck/prettier-php-runner without Composer
On this page you can find all versions of the php package mallardduck/prettier-php-runner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mallardduck/prettier-php-runner
More information about mallardduck/prettier-php-runner
Files in mallardduck/prettier-php-runner
Package prettier-php-runner
Short Description Reformat code using Prettier in PHP
License MIT
Homepage https://github.com/mallardduck/prettier-php-runner
Informations about the package prettier-php-runner
Code highlighting with Shiki in PHP
Prettier is an opinionated code formatter based on NodeJS that supports a variety of languages. Now you can use the power of Prettier with your PHP projects too!
Installation
You can install the package via composer:
In your project, you should have the JavaScript package prettier
installed. You can install it via npm...
... or Yarn.
Make sure you have installed Node 10 or higher.
Usage
Here's an example where we are going to highlight some PHP code.
The output is this chunk of HTML which will render beautifully in the browser:
Using Node Version Manager
Under the hood, this package will run a node command beautify your HTML input.
If you use NVM during development, then the package will be unlikely to find your version of node as it
looks for the node executable in /usr/local/bin
and /opt/homebrew/bin
.
If this is the case for you, then you should create a symlink between the node distributable in your NVM folder.
Such a command might look like this:
Creating this symlink will allow the package to find your NPM executable. Please note, if you change your NPM version you will have to update your symlinks accordingly.
Testing
You can run all the tests with this command:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.