Coder Social home page Coder Social logo

styleguide's Introduction

styleguide

Implementation of kss-php intended to help quickly creating a styleguide. This is still in very early development.

Use composer to get the dependencies

composer install

Create a styleguide

<?php

require_once('../Packages/Libraries/autoload.php');
$styleguide = new \Thopra\Styleguide\Styleguide('less', 'Example Styleguide');

?>

<!DOCTYPE html>
<html>
<head>
    <title>My Styleguide</title>
</head>
<body>

	<?php $styleguide->render(); ?>

</body>
</html>

Add a reference source to the styleguide

$bootstrap = new \Thopra\Styleguide\Source\BootstrapSource();
$styleguide->addSource($bootstrap);

You can also exclude sections from the styleguide

$bootstrap = new \Thopra\Styleguide\Source\BootstrapSource();
//exclude section "code"
$bootstrap->excludeSections(array('1.1'));

Add your own additional source

(currently, the package only comes with twitter bootstrap)

$myReference = new \Thopra\Styleguide\Source\Source('path/to/files', "myKey", "My Reference Title");
$styleguide->addSource($myReference);

Or you can write your own source class that implements \Thopra\Styleguide\Source\SourceInterface

Additional Features

In Addition to the basic KSS-Syntax, kss-php features a "Markup:" comment section in which you can provide some example Markup. This library extends this idea with a new Keyword: "Partial", that specifies a path to a Partial, that should be rendered as the example Markup.

/*
 * Partial: Components/Dropdown
 *
 * PartialParams: {"foo": "bar"}
 */

Should render the contents of /Components/Dropdown.phtml while setting the variable $foo to "bar".

styleguide's People

Contributors

tck avatar thopra avatar tobiasgraeber avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.