Skip to content

Option to add extra fields #1

@roaldarbol

Description

@roaldarbol

Since pubmatter does rigid checks on fields, currently, to add extra fields (options) inside with frontmatter. Could we imagine an extra field options which can be user-defined and either escape checks or be checked according to their specifications inside template.yml?

The issue is that currently, if you add extra options, you also need to add the options separately in the custom template. Not a massive issue, but add adds some confusion if you think you're relying on pubmatter for all your input from template.yml.

E.g. say I want to add degree. Currently, the workflow is this:

  • In template.yml, add degree under options.
  • In template.typ, add degree after frontmatter.
  • In my-custom-template.typ, add degree after frontmatter.
  • In my-custom-template.typ, for use, reference it with degree.

If we could have options in pubmatter, it could look like this:

  • In template.yml, add degree under options.
  • In template.typ, add degree in frontmatter.
  • In my-custom-template.typ, for use, reference it with fm.degree (or fm.options.degree).

Another idea would be to create another class that handles loading of extra fields, e.g. load_custom so it makes checks according to rules based on input type rather than for specific input names.

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