p2-theme-core icon indicating copy to clipboard operation
p2-theme-core copied to clipboard

Makes line width configurable when writing into theme's .info.yml file

Open pm98zz-c opened this issue 7 years ago • 0 comments

When the theme is not "bundled" (or depending on your naming habits) within the patternlab base, you can end up with fairly long "paths" for the various twig templates. This leads to "weird" results in the component-libraries section of the info file.

basics:
    paths:
      - ../../../../prototype/pattern-lab/source/_patterns/01-basics
      - >-
        ../../../../prototype/pattern-lab/source/_patterns/01-basics/00-breakpoints
      - ../../../../prototype/pattern-lab/source/_patterns/01-basics/01-colors
      - ../../../../prototype/pattern-lab/source/_patterns/01-basics/03-images
      - ../../../../prototype/pattern-lab/source/_patterns/01-basics/04-spacing
      - >-
        ../../../../prototype/pattern-lab/source/_patterns/01-basics/05-typography/fonts
      - >-
        ../../../../prototype/pattern-lab/source/_patterns/01-basics/05-typography/headings
      - >-
        ../../../

While the ">" is indeed normally valid, the way this is wrapped up (with extra "-") makes the parsing fail. I suspect this is due to the fact that js-yaml's dumper can't find a whitespace or character to split the line and ends up outputting it anyway.

An easy workaroung is to pass a longer line width as an option to the yaml.safeDump in addTwigNamespaceConfigToDrupal.

MR on its way.

pm98zz-c avatar Sep 12 '17 14:09 pm98zz-c