Skip to content

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

@pm98zz-c

Description

@pm98zz-c

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions