Where is the complete syntax reference for creating Bases?

I’m trying to create a base inside a code block, with the card view, but I can’t find any way to control the image size or aspect ratio.

I was able to figure out that “image” corresponds to the cover Image property field, but I haven’t been able to figure out the other options.

filters:
  and:
    - file.folder == "movies"
views:
  - type: cards
    image: cover

Am I missing something?

It would also be great to have a “Copy Base embed code” command.

From my quick test, these properties would be the relevant ones, I think :blush: :

    image: note.cover
    imageAspectRatio: 1.35
    imageFit: contain

AFAIK, the value of image here can also be a formula property (if you rely on the image() function or possibly the icon() one)

If you want to set the “Image fit” (in the Base GUI) to Cover you can use:

    imageFit: ""

Or remove the imageFit property all together from the code block :smile:

If you need to change the size of the card, you can also add:

    cardSize: 170

(If you omit it, the size of the card size will be set to its default value (200))

Here’s a very small example:

~~~base
filters:
  and:
    - file.inFolder("Berserk")
views:
  - type: cards
    name: cardView
    filters:
      and:
        - file.inFolder("Berserk/Volumes")
    order:
      - file.name
    sort: []
    image: note.cover
    imageAspectRatio: 1.35
    imageFit: ""
    cardSize: 200

~~~

And there are potentially some more info here :blush: :

Thank you so much! It works, indeed.
How did you figure them out? Did you find them just by trial and error, or by looking somewhere else?

The title question remains… where is all this documented?
Is it me or are these properties not documented at all? Otherwise, where I can find them?

Thank you, again!

My pleasure :smile: !

Well, .base files are just text files underneath (like .canvas files) so I just opened a .base file which was configured using the base GUI, on the side, using a text editor :blush:

Reading the raw (YAML) syntax used in .base files is pretty much how I learned about/discovered them :smile:

How dumb of me. Totally forgot that. Thanks for ponting it out!

1 Like

My pleasure (once again) :smile: !

… And lol, you were probably just distracted :wink: