Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More "naive" book cover features (master document / book matters) #93

Closed
Omikhleia opened this issue Sep 28, 2024 · 2 comments · Fixed by #95
Closed

More "naive" book cover features (master document / book matters) #93

Omikhleia opened this issue Sep 28, 2024 · 2 comments · Fixed by #95
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@Omikhleia
Copy link
Owner

Omikhleia commented Sep 28, 2024

When introducing the master document and "book matters" in v2.2.0, I went for my minimal need:

  • front cover = image
  • back cover = image + (optional) back cover text block + (optional) EAN13 ISBN block always in a white box (standards say so)

This made sense, as in most "real-world" case, the covers will consists of specifically designed images. Even the text on the front cover is usually typeset separately (possibly with a never-used font afterwards, some effects, etc.) by a careful designer, for the best impression...

However for simpler books, it wouldn't be that hard to support a simpler/naive path:

  1. front cover = (image or background color) + (optional) template-generated metadata-based content
  2. back cover = (image or background color) + (the rest unchanged)

On (1), it requires

  • Extending the supported syntax in master documents (.silm)
  • Adding a dedicated template (similar to the title page, but possibly different in details, and using its own styles)
  • Extending the book matters' front cover logic, and use white/black text color depending on the background color (same W3C weight logic as for the existing back cover content)

On (2), it requires

  • Also extending the supported syntax in master documents
  • A very simple extension of the book matters' back cover logic. (Note that the color of the back cover might be different from the color of the back content text block).

For the reminder, the "cover" section of a master file looks as follows:

book:
  enabled: true|false # default = false
  cover:
    front:
      image: frontcover.jpg # currently required
    back:
      image: backcover.jpg # currently require
      content: backcover.dj # back cover text content file (possibly absent)
      background: "#xxxxxx" # that the background color of the text block, default = "white"
  halftitle:
    recto: ...
    verso: ...
  title:
   ....

From a end-user viewpoint, the proposal could be:

  cover:
    # We could have image or background at this level (global defaults):
    background: "#xxxxxx"
    front:
      # image is optional and we can also have (also optional)
      background: "#xxxxx"
      # Optional template name (default = cover), not used by default if image is set on the front object
      template: cover # or a user-defined template name
    back:
      # image is optional and we also have (also optional)
      background: "#xxxxxx" # but this is now the color of the whole page
                            # if image is not set (i.e. text block included),
                            # and only of the text block if image is set.
      # this is the color of the content block
      content: backcover.dj
      # If set, this is the color of the content block
      # (overriding the background color)
      content-background: "#xxxxxx"
  ....

It seems to me it would stay compatible with current definitions (and thus not be a breaking change).

Of course, then, the simplest declaration for a draft book (still with back-cover content) would be:

  cover:
    background: "blue"
    back:
      content: backcover.dj
  ....

To possibly discuss, but does not sound very hard to do... All the low-level bits are available.

@Omikhleia Omikhleia added this to the 2.5.0 milestone Sep 28, 2024
@Omikhleia Omikhleia added enhancement New feature or request good first issue Good for newcomers labels Sep 28, 2024
@Omikhleia
Copy link
Owner Author

With all these extra features and options, the code is easy but there would be bonus points for a clear documentation that doesn't lose the reader entirely...

@Omikhleia
Copy link
Owner Author

Omikhleia commented Oct 8, 2024

Optional template name (default = cover), not used by default if image is set on the front object

Not general enough (We could have an image and still want a text overlay) = Just an optional template, no default, and when defined, it's used. Much simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant