Giter Club home page Giter Club logo

edition-php-twig-standard's People

Contributors

dmolsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edition-php-twig-standard's Issues

Concat vars in include

whe use {% include 'molecules-' ~ view.item ~ '-' ~ view.mode %} and generate patternlab the console show a warning {> molecules- }} is not a valid pattern... but the pattern is printed normally

create project snippet installs code with a syntax error

Just ran this from the readme:

composer create-project pattern-lab/edition-development-twig pattern-library && cd $_

And got this:

> PatternLab\Installer::postUpdateCmd
PHP Parse error:  syntax error, unexpected ')' in /Users/bdub/Projects/envirovantage-web-api-symfony/pattern-library/vendor/pattern-lab/core/src/PatternLab/InstallerUtil.php on line 353

Sure enough, in that file, there's an extra paren:

line 353:

					$pathName = $file->getPathname());

How to use shorthand syntax outside of patternlab itself

We're building a WordPress starter theme which uses patternlab as a dependency in order for us to work using atomic design.

The idea is to re-use the templates created in patternlab in our theme. However, using the normal twig way of doing things doesn't work as it can't interpret the shorthand syntax (http://patternlab.io/docs/pattern-including.html).

Where is this set in the patternlab twig code? And how can we reuse it outside of patternlab?

Thanks!

PS The theme will be open source and we'd love to share it with the patternlab community!

30 minutes timeout on core/console

Have you considered adding a flag to disable the 30 minute timeout on core/console commands? I find it a bit annoying having to start the server every time I come back to patternlab and would love to have a flag to allow it to run infinitely.

Clicking "VIEW ALL" links for each folder/section (like "molecules") produce unexpected results

After a clean install of the Twig standard edition, ie:

composer create-project pattern-lab/edition-twig-standard your-project-name && cd $_
php core/console --server --with-watch

the "VIEW ALL" link for each section produce a variety of unexpected results, including:

  • Broken component pattern info buttons (the down arrows)
  • Two patternlab menus sitting on top of each other
  • Patternlab menu links that don't work.

Here's screenshot of the view all link referred to above:

selection_196

Watch option is broken.

When running php core/console --watch I get the following error.

PHP Fatal error:  __clone method called on non-object in /Users/Mike/Sites/Sources/patternlab/vendor/pattern-lab/core/src/PatternLab/Watcher.php on line 94

This only started happening today, previously it would at least run. Additionally, when it was running, it seems that hardcoded references to mustache in Watcher.php means twig files are not being watched and therefore not triggering a regeneration.

Lineage links broken

Lineage links are broken in every Twig-based Pattern Lab I've generated. I get the spinner, but the linked pattern never loads.

Unable to install StarterKit

Steps to reproduce:

  1. Run command
    composer create-project pattern-lab/edition-twig-standard [project-name]
  2. When prompted for the desired starterkit, input 1 and hit Enter.

The wizard attempts to download the starter kit, but exists with the error:

the starterkit needs to contain a dist/ directory before it can be installed...

As we plan to build our own StarterKit, we do not require the base nor the demo to function properly, but I do need to understand how they should be structured as the demo, according to the Github source, appears to contain a dist/ directory, contrary to what the error message says.

Failing installations are very laconic

Hello,

I have been trying to install Patternlab PHP Twig to develop my website using Grav (Twig is the main reason I will use those two generating tools), but the installation is failing. Why is it failing?

I would provide more details but this is all I have :

[user@brix user]$ php core/console --starterkit --init
configuring pattern lab...
downloading the starterkit. this may take a few minutes...
finished downloading the starterkit...
failed to extract the starterkit. easiest solution is to manually download it and copy <path>./dist</path to ./source/...

I did once the manual directive. This is quite annoying, because finding Twig Starterkit in that README.md asks reading the same files over and over again to find it and not mix up with the Styleguidekit.

Is there any way to make it simpler to install it manually and if it's not succeeding, extensively telling why it does not?

Thank you!

Documentation on working with json data and twig?

Hi, not sure if Im asking this in the right place but any direction would be helpful.

Aside from documentation on the Pattern Lab site are there any other sources that go into more detail on working with json data and twig files?

Specifically what Im looking for is how to handle twig "if, for, set, etc..." statements as well as populating variables when set like foo[bar]. Ive been able to find examples of working with arrays so I was able to get that handled but Ive been looking high and low for examples of the above and just keep coming up short.

Thanks!

"php patternlab/core/console -generate" works local but not via jenkins

Hi everyone,

I have integrated pattern lab (php/twig version via download, not composer) into an existing project (in a folder called patternlab/ )and I've got everything running locally (both via vagrant box and fully local with mamp).

I can run "php patternlab/core/console -generate" and all files in public/ are created as they should be. I even integrated that command via grunt shell and can run it automatically when needed.

If I push the project to gitlab and my jenkins does his thing (npm install -> grunt prod etc.) the command is fires as well, I can see the moment jenkins executes the script and get the usual log:

Running "shell:patternlab" (shell) task
configuring pattern lab...
your site has been generated...
site generation took 0.18935704231262 seconds and used 8.25MB of memory...

Done.

my local generate command is a bit slower
site generation took 1.3047921657562 seconds and used 8MB of memory...

If I browse to the deployed site, I'm getting a lot of 404s as a lot of stuff is missing.
public/css/ #missing
public/js/ #missing
public/fonts/ #missing
public/images/ #missing

from my public/patterns/ folder, most files are missing
00-atoms
00-atoms-04-images
00-atoms-04-images-00-logo #missing
00-atoms-06-buttons
00-atoms-06-buttons-01-buttons #missing
00-atoms-09-links
01-molecules
01-molecules-05-navigation
01-molecules-05-navigation-00-primary-nav #missing
01-molecules-05-navigation-01-language-nav #missing

02-organisms
02-organisms-00-global
02-organisms-00-global-00-header #missing
02-organisms-00-global-01-footer #missing
02-organisms-00-global-02-social #missing

02-organisms-04-forms
02-organisms-04-forms-00-contact #missing
03-templates
03-templates-00-layouts
03-templates-00-layouts-00-site #missing
03-templates-00-layouts-01-page-detail #missing
03-templates-00-layouts-01-page-legal #missing
03-templates-00-layouts-01-page-listing #missing
03-templates-00-layouts-01-page-scroll #missing
03-templates-01-index #missing
04-pages-01-index #missing

this is my output from php -v from jenkins log

PHP 5.6.33-0+deb8u1 (cli) (built: Jan  5 2018 15:46:26) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

and this is local (in vagrant)

PHP 5.5.9-1ubuntu4.24 (cli) (built: Mar 16 2018 12:41:43) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Could not open input file: core/console

I've tried installing PatternLab both as a pre-built project and with Composer. Whenever I try to do anything with the command line I get this error:

Could not open input file: core/console

What do I need to do to fix this? I'm on Mac OS Sierra, PHP version 5.6.25. MAMP is installed.

Watcher reloads content in twig file, but not its references.

Info:

  • os: windows 10

To reproduce

  • add reference to a molecule in an organism
  • php core/console --server
  • php core/console --watch
  • add a css class on an html element in the molecules twig file
  • reload page
  • navigate to the molecule under molecules pages
  • navigate to an organism under organism pages where the molecule is referenced

Expected result:
Both the molecule and the organism referencing the molecule should now contain the new class.

Result:
The new class is included under the molecules pages, but not under the organisms pages where the molecule is referenced.

Temporary workaround:
Reload watcher when looking at a referenced atom or molecule.

can't generate

I can't use the generate command to build out patternlab.

I get this error:

Fatal Error Class ......\PatternEngineRule
not found in ......\patternEngine.php on line 76

Wot sure why this is occurring.

I've used composer to build the demo (option 2)
I did see this in the command line:
[Alchemy\Zippy\Exception\RuntimeException]
Unable to create the inflator

Maybe that has something to do with it?
Thanks in advance!

I can't replace data.json in pages

for some reason my pages are ignoring the json file with the same name of the page file and can't replace data.json values. i followed the same structure as in patternlab mustache and my templates are using embed layout

Failed to extract the starterkit

Hi guys, Im new in gulp and emulsify, using windows 10 1703, php 7.1 and nvm for windows.

In our project, we need to use emulsify, but I have problem to install it. Everything looks ok when emulsify is installing, but when pattern-lab is installing, there is problem with extracting starterkit:

suggested starterkits that work with this edition:

  1: pattern-lab/starterkit-twig-base
  2: pattern-lab/starterkit-twig-demo


downloading the starterkit. this may take a few minutes...
finished downloading the starterkit...
failed to extract the starterkit. easiest solution is to manually download it and copy <path>./dist</path to ./source/...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `rm -rf pattern-lab && composer create-project -n pattern-lab/edition-twig-standard pattern-lab && rm -rf pattern-lab/source && ln -s ../components pattern-lab/source && git clone https://github.com/drupal-pattern-lab/bem-twig-extension.git && cp bem-twig-extension/bem.function.php components/_twig-components/functions && rm -rf bem-twig-extension/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 

I tried to download and copy dist from git, but when I type npm start, there is error for missing 'clean' task in gulpfile.js

Thanks for suggestions

Configuring export directories

Hoping this is the appropriate place to ask this question. Apologies if it isn't.

I'm looking to use the clean export function within PL to get a directory structure exported of my twig files that matches what's in the source directory. Ideally, this would include:

- _data
- _layouts
- _macros
- _meta
- _patterns <-- with all variants etc.
- _twig-components
- images
- js
- etc. <-- any files and dirs that would normally export to public or export directories.

In our shop we use a WordPress framework that makes use of twig files to build our templates with an MVC setup.

I can copy and paste or setup a deploy of some sort to dump out, but the export feature seems to be the more "tool centric" way to go. Is it extensible at all? Could I customize that in some way? Thanks and I'll hang up and listen. :-)

P.S. @dmolsen said to post here and maybe @aleksip or @EvanLovely could help me out. Thanks!

link variable not work

when I try to create links to patterns as i did with patternlab + mustache {{ link.templates-mypattern }} fails, returns 0. I think it is because twig handle{{ link.templates }} as a simple variable and not like it should be

matching organisms name problem

hi ...
i can't match organisms name... i have a layout with {% include 'organisms-' ~ header_layout %} in data.json I set the variable hader_layout...
my list of organisms header is:

000-h-hn(nmain+sprofiles)
001-h-hf(sprofiles+cinfo+nmain)
002-h-ht(sprofiles+cinfo)hf(nmain)
003-h-ht(cinfo)hf(cinfo)hn(nmain)

but when set header_layout: h-ht(cinfo)hf(cinfo)hn(nmain) this show the organisms 002 or anything that start with h-ht, always show me 002... i try full format but nothing is displayed and i print a
{{ dump(header_layout) }} in my layout and show me the correct var set in data.json ...

any idea how to solve this ?? thanks for help

styleguide.html construction process

the styleguide.html file located in /patternlab/public/styleguide/html/ includes head.twig and foot.twig files ,but when it generated json vars and all twig logic is ignored ... seems a bug

Error upon generation from downloaded dev preview

I've installed PHP and composer on Windows10 and am attempting to get PHP v2 running.

I downloaded the dev release
C:\src\standard-edition-twig>php core/console --version
configuring pattern lab...
you're running v2.0.0-DP1 of the PHP version of Pattern Lab...

C:\src\standard-edition-twig>php core/console --generate
configuring pattern lab...
-colors wasn't found for loading. the given path: C:/src/standard-edition-twig\source/_patterns/C:/src/standard-edition-twig\source/_patterns\00-atoms\01-global\00-colors.twig

This error looks like a funny pathing problem.
I am now going to attempt to install via composer, which I suspect will load more recent code.

Is Faker integration easy/possible? Any tips on how?

I see a older thread in the php edition that talked about adding Faker. Did that ever happen?

Quick research says Faker can be autoloaded in Symfony projects… might make a good addition to the Twig version of PL. I don't have the experience or knowledge to know how.

If it can be added into PL-twig easily or someone could give me the quick rundown of how to add it myself, I'd appreciate it.

Watcher doesn't update browser display

Background:

  • I got super excited reading Atomic Design and listening to the style guide podcast, so I installed the pre-built Twig standard version today on Windows 10. ✨
  • I'm using Wampserver64 to serve the project. I've been using wamp successfully for other PHP projects for a while. However, I'm not familiar with PHP CLI.
  • I first tried php core/console --serve in a Git Bash terminal and everything looked good in the terminal, but when I go to localhost:8080 there's a "connection refused" error.
  • With wamp I can access the site at http://localhost/pattern-lab/public.
  • My system PHP version is PHP 5.6.19 (cli) (built: Mar 2 2016 20:09:42).
  • php core/console --generate seems to work perfectly.

Problem:

When I type php core/console --watch in the terminal, it looks good:

$ php core/console --watch
configuring pattern lab...
spawning the watch process...

But then nothing else happens, either in the terminal or in the browser, when I update and save files. I have to run --generate again to see my changes in the browser.

Possibly related to #pattern-lab/patternlab-php#371 and/or #21?

I realize there might be something deeper going on, since I ran into problems with --server too. DevOps gets me every time. 🙄

Any tips? Thanks! 😄

Installation within an existing project?

I have an existing project (Laravel-based, if you're curious), and we use Twig templates for our output.

I was hoping to incorporate a styleguide system within my project, with the goal being that my SCSS/CSS and templates exist only in one place and are used for the live site and for the styleguide.

My first step was to run composer require --dev pattern-lab/edition-twig-standard in my project (which actually required a bit of jiggling to keep dependencies in check). Then I thought I could run php vendor/pattern-lab/edition-twig-standard/core/console ... to get things going, but all I get is:

it doesn't appear that pattern lab has been set-up yet...
please install pattern lab's dependencies by typing: php core/bin/composer.phar install...

The problem is that console is explictly expecting the vendor directory to be within the package, not the other way around:

// set-up the project base directory
$baseDir = __DIR__."/../";

// auto-load classes
if (file_exists($baseDir."vendor/autoload.php")) {
    require($baseDir."vendor/autoload.php");
} else {
    print "it doesn't appear that pattern lab has been set-up yet...\n";
    print "please install pattern lab's dependencies by typing: php core/bin/composer.phar install...\n";
    exit;
}

I'm sure there is another way to check that dependencies are installed (or simply remove this check, since things will fail anyway which should be indication that the user missed something).

But I'm also wondering whether other things (e.g. configuration) would work in a setup where Patternlab is a required package instead of an app in and of itself. Has anyone else done something like this?

Thanks!

starterkit-twig-base/starterkit-twig-demo styleguide files not found

Picking either of these options when I install gives me this error when I tried to generate:

configuring pattern lab... your styleguide won't render because i can't find your styleguide files. are you sure they're at .\C:\Users\Andrew\sites\sinceileftyou3\public\wp-content\themes\since ileftyou\pattern-lab\vendor/pattern-lab/styleguidekit-twig-default? you can fix this in ./config/config.yml by editing styleguideKitPath...

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.