2017 © Pedro Peláez
 

library kss-php-markup

An extension of kss-php for get markup by url and html selector.

image

keverage/kss-php-markup

An extension of kss-php for get markup by url and html selector.

  • Wednesday, August 30, 2017
  • by Keverage
  • Repository
  • 1 Watchers
  • 0 Stars
  • 50 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 67 % Grown

The README.md

KSS PHP Markup

This is an extension of Knyle Style Sheets PHP (KSS). KSS PHP Markup add a new method to write markup in styles files. The markup can be generated by url and html selector and it can be cached., (*1)

Before

/*
Markup: 

  • Title

    ... ...
Styleguide Lists - Primary */ .list--primary { ... }

After

/*
Markup: url(http://site.com/news)->find(.list--primary)->filter(.list-item)

Styleguide Lists - Primary
*/
.list--primary {
    ...
}

PHP library

<?php

require_once '../vendor/autoload.php';
$styleguide = new \Kss\Parser('public/stylesheets');

$section = $styleguide->getSection('Lists - Primary');
$markup = new \Kss\Markup($section);

echo $markup->getNormal();
// echoes 

    ...
$markup->flushcache(); // clean all markup cache, if enabled

Syntax

/*
Get html markup
Markup: url(http://site.com/news)->find(.classSelector)

Get html markup with urlPrefix option
Markup: url(/news)->find(.classSelector)

Get html markup with filter result
Markup: url(/news)->find(.classSelector)->filter(.classSelector)

Get html markup with filter result and choose length
Markup: url(/news)->find(.classSelector)->filter(.classSelector, 4)
*/

Options

<?php

$options = new \StdClass;
$options->cache = true;
$options->urlPrefix = 'http://site.com';

$markup = new \Kss\Markup($section, $options);
Option Type Default Comment
cache boolean false Enable cache for store the markup result
modifier string '$modifierClass' The modifier variable name
urlPrefix string null Set a prefix url for url() selector

The Versions

30/08 2017

dev-master

9999999-dev

An extension of kss-php for get markup by url and html selector.

  Sources   Download

MIT

The Requires

 

by Avatar Kévin Baubet

styleguide kss css documentation kss php

30/08 2017

1.0.0

1.0.0.0

An extension of kss-php for get markup by url and html selector.

  Sources   Download

MIT

The Requires

 

by Avatar Kévin Baubet

styleguide kss css documentation kss php