Download the PHP package pug-php/pug-filter-base without Composer

On this page you can find all versions of the php package pug-php/pug-filter-base. 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 pug-filter-base

pug-filter-base

Example for Pug-php filter, use this base to create and publish your own

Latest Stable Version Build Status Code Climate Test Coverage StyleCI

How to create and publish your own filter

Install composer: https://getcomposer.org/download/

Then create a project based on this package:

Replace yourfilter with the directory name you wish, composer will create it and install pug-filter-base inside.

If your filter require somes other packages to work, add them with composer, for example:

NB: By default, the composer.json file is set to "minimum-stability": "stable", but some packages have no stable version. To install them, set it to dev:

Then rename src/Pug/Filter/Base.php to src/Pug/Filter/YourFilter.php For example, to create a filter you will call with , call the file Foo.php, , FooBarBaz.php and so on.

Then give the class inside this file the same name, and edit the __invoke method, you get the filter node of the Pug structure tree and the Pug compiler and you can treat each line to iterate on $node->block->nodes or get all the text with Here begin the fun part, execute any action as you want then return a string that will be rendered in the HTML.

Test your filter

Please do not publish a filter with no test. Give us one or more examples in the directory examples to see how to use your filter by creating a file with .pug extension then create another file with the same name but .html extension to show the result. (Replace or remove the basic example.)

You can now check that everyting work as expected with phpunit, execute at your project root:

If your filter render all your examples as expected, you get 100% and OK, else you will see the difference between the expected result and the rendered pug for each broken example.

Configure it

To publish your filter, you will need an account on https://packagist.org If you haven't already, create one. The username you choose will appear as the filter author on http://pug-filters.selfbuild.fr/.

Now you can set the name of your package in composer.json. It must follow this syntax: or (jade, the old name of pug is also accepted instead of pug) with username your packagist username and filtername the filter name as it will be called in the pug template, so if you sign up as dark-vador on https://packagist.org and create a package you will call with in your template, your composer.json should contains:

Then explain what your filter do in the description field.

Document it

Replace the project README.md with informations about how to install, for example:

Publish it

Now you can host your filter on any Git, Svn or Hg server.

We encourage you to use https://github.com as http://pug-filters.selfbuild.fr/ is optimized for it and you can follow this instructions: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

You can add Packagist as a service in GitHub with Settings > Webhooks & services > Add service > Packagist, enter your username and your token and each time you will draft a release in GitHub or push a tag, it will publish a version on Packagist and on http://pug-filters.selfbuild.fr/. It can take one minute or two.

Last step, go to https://packagist.org/packages/submit and enter the URL of your repository.


All versions of pug-filter-base with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
pug-php/pug Version >=1.11
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 pug-php/pug-filter-base contains the following files

Loading the files please wait ....