Blueprint YAML file autocompletion and validation in your favourite code editor

Like suggested by @kirbyzone on kirbys idea tracker on nolt a JSON Schema for Kirby would bring autocompletion and validation of the flexible blueprints to your code editor like SublimeText, PHPStorm or VSCode.

In the best case such a schema is published on the official JSON Schema store and thus becomes available in most editors automatically. But with Kirbys blueprints thats quiet a complex task. It took me more than 3000 lines of json to cover the

  • four root blueprint types (file, page, user, site),
  • all layout wrappers you can use in page blueprints (tabs, columns, sections, fields),
  • all sections (fields, files, info, pages, stats) and
  • all 31 fields including the new ones from v3.7

I created a preview version and would love to get your feedback and hope that the core team contributes as well – or even better – takes over this project one day.

This also ties in nicely with the highly requested (261 votes) blueprint editor since – well – your code editor will be able do most of that now. :wink:

Follow the easy installation instructions from the repos readme to

  1. clone/download repo then
  2. tell your code editor where to find the schema file and to what folder to apply it to
13 Likes

version 1.1 add support for object field that was introduced in k3.8.

2 Likes

version 4.0.0 added new features introduced in kirby 4 (released today).

2 Likes

hi @bnomei

i tried to add the schema in phpstorm follwed the readme steps. Now i get the behavior that blueprints are marked and show me like before messages like **Schema validation: Property β€˜tabs’ is not allowed ** do you now this? Did i configure something wrong or is there a special intendation of the lines?

thanks for a hint

hi @rapha
depending on which blueprint you are editing the schema does not know about the context. see readme about adding the custom flag. like this for a pages blueprint.

blueprint: page

#rest of your blueprint

also if you have something in the blueprint the schema does not understand the issue might bubble up to the first element (and report that).
try adding things to the blueprint step by step.

it might well be that kirby allows something that the schema cant handle. feel free to create an issue on github if you manage to isolate the issue. thanks

Hi @bnomei sorry for the late reply.

thank you very much for your answer!

i think i did everything right but found out that the problem occours when using tabs in blueprints. i have to check it more detailed.

cheers raph