Skip to content

Conversation

cscheid
Copy link
Collaborator

@cscheid cscheid commented Oct 10, 2024

Towards #10249.

This PR contributes what's (aspirationally) the schema that will ship with the 1.0 version of the spec.

Copy link
Collaborator Author

@cscheid cscheid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about alt text in Typst - neat.

@gordonwoodhull
Copy link
Contributor

I've updated the Typst implementation.

Could probably use more tests, and I think brand.ts should prepend brandDir on paths it returns. Run out of time for the moment, will try that later.

Note that with the current implementation we can directly use an image path as a string under small, medium, or large, but we can't provide alt text there - only in images. I'm not sure if it this is intentional.

I can't tell what the alt text does in a PDF, not getting hover in Preview.

@cscheid
Copy link
Collaborator Author

cscheid commented Oct 11, 2024

I think brand.ts should prepend brandDir on paths it returns. Run out of time for the moment, will try that later.

That's almost certainly true. I thought I had tested that for typography with system files, but I think you're talking about logo here.

In any case, I echo the sentiment that Brand should resolve its paths to become absolute.

Note that with the current implementation we can directly use an image path as a string under small, medium, or large, but we can't provide alt text there - only in images. I'm not sure if it this is intentional.

It wasn't intentional, but since there's some "path vs named image" ambiguity in the schema which we won't be able to address, I think we can leave that for now. A fix would be to change brand-string-light-dark:

- id: brand-string-light-dark
  anyOf:
    - string # we could change this to `ref: brand-logo-resource`
    - object:
        closed: true
        properties:
          light:
            schema: string
            description: >
              A link or path to the brand's light-colored logo or icon.
          dark:
            schema: string
            description: >
              A link or path to the brand's dark-colored logo or icon.

I can't tell what the alt text does in a PDF, not getting hover in Preview.

Huh. I wonder if they snuck that in only to "secretly" use it in their HTML targets. I know they use an unpublished tool to create their docs, and note how https://typst.app/docs/tutorial/writing-in-typst/ has alt text in it:

image

@cscheid cscheid merged commit aca2088 into main Oct 11, 2024
47 checks passed
@cscheid cscheid deleted the feature/brand-yaml-schema-consolidation branch October 11, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants