2017 © Pedro Peláez
 

library mannequin-drupal

Drupal extension for the Mannequin template viewer

image

lastcall/mannequin-drupal

Drupal extension for the Mannequin template viewer

  • Monday, May 28, 2018
  • by rbayliss
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,633 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 32 Versions
  • 23 % Grown

The README.md

Mannequin Drupal is brought to you by your friends at Last Call Media, it is a command line application that you can use to visualize and work on your Drupal Twig Templates in the browser. For example, you might use it to work on the templates inside of an existing custom theme., (*1)

Quick Start

Using Composer, install Mannequin Drupal from your project root. From the command line:, (*2)

$ composer require lastcall/mannequin-drupal

Next, create a new .mannequin.php file in your project root. This file is where you will configure Mannequin. Inside of that file:, (*3)

<?php
// .mannequin.php
use LastCall\Mannequin\Core\MannequinConfig;
use LastCall\Mannequin\Drupal\DrupalExtension;
use Symfony\Component\Finder\Finder;

// Describe where to find Drupal templates.
// See https://symfony.com/doc/current/components/finder.html
$drupalFinder = Finder::create()
    // Templates can live in your normal templates directory.
    ->in(__DIR__.'/themes/mytheme/templates')
    ->files()
    ->name('*.twig');

$drupalExtension = new DrupalExtension([
    'finder' => $drupalFinder,
    'drupal_root' => __DIR__,
]);

return MannequinConfig::create()
  ->addExtension($drupalExtension)
  ->setGlobalJs([
    // themes/mytheme/js/theme.js  
  ])
  ->setGlobalCss([
    // themes/mytheme/css/theme.css
  ]);

See all of the configuration options, or view an example project, (*4)

Setting up Components

While the .mannequin.php file tells Mannequin where to find your components, you still need to describe them to Mannequin. To do that, we use a special YAML formatted comment block at the top of your twig files. For example, to describe a "Card" component living inside of card.html.twig, you would add the following at the top of the file:, (*5)

{# @Component
name: Card
group: Molecule
samples:
    Small:
        title: I am a small card
        body: Lorem ipsum...
        classes: ['small']
#}
<div class="{{ classes|join(' ') }}">
  ... 
</div>

See the full YAML reference here, (*6)

Workflow

When you're ready to begin work on your templates, you can use the following worklow:, (*7)

  1. Fire up a live development server so you can see your component. From the command line: bash $ vendor/bin/mannequin start
  2. This will output a URL for the Mannequin UI. Visit it in your browser.
  3. In the UI, find the component you want to work on.
  4. Open the file, and make your changes.
  5. Reload the UI to see how your changes look.

The Versions

28/05 2018

dev-master

9999999-dev

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

12/11 2017

1.0.7

1.0.7.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

02/11 2017

1.0.6

1.0.6.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

02/11 2017

1.0.5

1.0.5.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

26/10 2017

1.0.4

1.0.4.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

21/10 2017

1.0.3

1.0.3.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

21/10 2017

1.0.2

1.0.2.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

15/10 2017

1.0.1

1.0.1.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

30/09 2017

1.0.0

1.0.0.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

30/09 2017

1.0.0-rc3

1.0.0.0-RC3

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

30/09 2017

1.0.0-rc4

1.0.0.0-RC4

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

30/09 2017

1.0.0-rc5

1.0.0.0-RC5

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

30/09 2017

1.0.0-rc6

1.0.0.0-RC6

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

30/09 2017

1.0.0-rc2

1.0.0.0-RC2

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

19/09 2017

0.3.0

0.3.0.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

19/09 2017

0.3.1

0.3.1.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

19/09 2017

1.0.0-beta1

1.0.0.0-beta1

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

19/09 2017

1.0.0-rc1

1.0.0.0-RC1

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

16/09 2017

0.2.7

0.2.7.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

08/09 2017

0.2.6

0.2.6.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

06/09 2017

0.2.4

0.2.4.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

06/09 2017

0.2.5

0.2.5.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

08/08 2017

0.2.1

0.2.1.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

08/08 2017

0.2.2

0.2.2.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

08/08 2017

0.2.3

0.2.3.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

04/08 2017

0.2.0

0.2.0.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

19/07 2017

0.1.5

0.1.5.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

16/07 2017

0.1.3

0.1.3.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

16/07 2017

0.1.4

0.1.4.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

15/07 2017

0.1.2

0.1.2.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

15/07 2017

v0.1.1

0.1.1.0

Drupal extension for the Mannequin template viewer

  Sources   Download

MIT

The Requires

 

The Development Requires

15/07 2017

v0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires