Use of metadata

clements.jb's Avatar

clements.jb

15 Jun, 2023 09:56 AM

I make considerable use of metadata, composing in Multimarkdown, setting out data — such as 'tags' · 'title' · 'author' (as below)— at the start of documents. I would like to be able to use the following pattern / system to identify metadata for the headers and footers.

In Composer, metadata defined as:

  • footer_left: page %page of %total

  • header_left: %md_tags · %md_title · %md_author

In Headers and Footers fields, within Marked 2 preference, Export tab:

  • %md_footer_left

  • %md_header_left etc.

You will know better than I why it isn't currently possible to include a second level of variable in this way.

But could it be done? So that in each new document, I could define my headers and footers within Composer / any germane editor, so that I would not need to update the fields within the Marked Export tab for each new series of documents I compose.

I hope this explanation is sufficiently clear. Please let me know if I need to clarify any further.

  1. Support Staff 1 Posted by Brett on 15 Jun, 2023 11:47 AM

    Brett's Avatar

    Marked doesn't have access to the MMD metadata at the time of printing,
    so it can't populate the headers in that way. It's something I'm willing
    to look into, though.

    -Brett

    On 15 Jun 2023, at 4:58, clements.jb wrote:

  2. Support Staff 2 Posted by Brett on 15 Jun, 2023 12:07 PM

    Brett's Avatar

    I misspoke. I do store the metadata in memory and accessible to the
    print system, I just don't have it set up to nest it, such that it
    replaces a variable with a string and THEN replaces the variables in the
    string. That shouldn't be difficult to implement though, thanks for the
    suggestion.

    On 15 Jun 2023, at 4:58, clements.jb wrote:

  3. 3 Posted by clements.jb on 15 Jun, 2023 12:27 PM

    clements.jb's Avatar

    Understood.

    I believe it would be an excellent addition to the product — which I much enjoy using, Brett.

    Be happy to do some road testing if implemented.

    John

  4. Support Staff 4 Posted by Brett on 15 Jun, 2023 01:39 PM

    Brett's Avatar

    D'oh, this is already possible, in a slightly different way.

    Marked recognizes the following metadata:

    print header left: ...
    print header right: ...
    print footer left: ...
    print footer right: ...
    

    Any of those that are defined (variables included) will override settings in Preferences.

  5. 5 Posted by clements.jb on 15 Jun, 2023 02:28 PM

    clements.jb's Avatar

    Excellent! I'll give it a road test!

  6. Support Staff 6 Posted by Brett on 15 Jun, 2023 02:30 PM

    Brett's Avatar

    I've updated the docs to include this.

  7. 7 Posted by clements.jb on 16 Jun, 2023 08:57 AM

    clements.jb's Avatar

    Not working at all for me… anything I could be overlooking? I refreshed and restarted the Marked App… but header / footer fields entirely BLANK on output to pdf. This is my markdown metadata (the included fields are also defined)

    print header left: %md_subtitle · %md_title · %md_author
    print header right: page %page of %total
    print footer left: More works by this author : %domain
    print footer right: %date

  8. Support Staff 8 Posted by Brett on 16 Jun, 2023 12:09 PM

    Brett's Avatar

    Hm, looks like you're correct. I'll have to dig into the code and see
    why what's there isn't working. I definitely intended this functionality
    to work, but I haven't touched it in a while and it may have broken at
    some point. Should have time to look into it today.

    -Brett

    On 16 Jun 2023, at 3:57, clements.jb wrote:

  9. 9 Posted by clements.jb on 16 Jun, 2023 12:24 PM

    clements.jb's Avatar

    Terrific. Thanks, Brett.

    No urgency, but a feature I'll use constantly once functioning. Takes functionality to another level. Regards.

  10. Support Staff 10 Posted by Brett on 16 Jun, 2023 12:33 PM

    Brett's Avatar

    Ok, I'm getting some weirdness. When I test on my Intel MacBook Pro, it appears to work fine. If I test on my M1 Mac Studio, it doesn't work. What kind of system are you running on (Intel/Apple Silicon)? I do not know why that would affect it yet, but it definitely seems to (unless there's some other difference in settings I'm missing).

    One other thing I would ask you to check: In Export preferences, do you have both headers and footers enabled on the first page, or are you testing with more than one page? By default headers and footers are excluded from the first page, but you probably knew that.

    -Brett

    On 16 Jun 2023, at 7:23, clements.jb wrote:

  11. 11 Posted by clements.jb on 16 Jun, 2023 01:15 PM

    clements.jb's Avatar

    Using 2013 iMac desktop .

    I think MacOS 13 or 14? (on :cricket_bat_ball: lunch break, will confirm when back at desktop!)

    Deploying and treating multiple page output.

    John

  12. Support Staff 12 Posted by Brett on 16 Jun, 2023 01:22 PM

    Brett's Avatar

    Ooh, try modifying your metadata to only have one space after the colon.
    That's a bug on my end, but when I remove the multiple spaces, then it
    works for me on all systems. I hadn't copy/pasted your original example
    on my laptop, I had written my own, and thus had instinctively only
    added on space.

    -Brett

    On 16 Jun 2023, at 8:15, clements.jb wrote:

  13. 13 Posted by clements.jb on 16 Jun, 2023 02:33 PM

    clements.jb's Avatar

    aha. I had to use a single space on ALL of my metadata, but that did indeed fix it on my 3.2 GHz Quad-Core Intel Core i5 2013 iMac!

    Would be useful if can also work with my legacy files, and my intuitive use of tabs in metadata, because on Composer, makes much easer to check. Perhaps you'll let us know here, if you're able to fix that too.

    Cheers. Nice result!

  14. Support Staff 14 Posted by Brett on 16 Jun, 2023 02:46 PM

    Brett's Avatar

    Yep, I'll dig in and try to figure out why alternative whitespace is
    causing it to choke.

    -Brett

    On 16 Jun 2023, at 9:33, clements.jb wrote:

  15. Support Staff 15 Posted by Brett on 16 Jun, 2023 03:10 PM

    Brett's Avatar

    Yep, I found the bug. Will be fixed in the next update.

    -Brett

    On 16 Jun 2023, at 9:33, clements.jb wrote:

  16. 16 Posted by clements.jb on 16 Jun, 2023 03:28 PM

    clements.jb's Avatar

    Much appreciated.

    Best.

  17. Support Staff 17 Posted by Brett on 16 Jun, 2023 03:57 PM

    Brett's Avatar

    I just released the update for direct (Paddle) customers. Those on the
    Mac App Store or Setapp versions will have to wait for the release to be
    approved.

    -Brett

    On 16 Jun 2023, at 10:28, clements.jb wrote:

  18. 18 Posted by clements.jb on 23 Jun, 2023 01:06 PM

    clements.jb's Avatar

    Just road tested the Paddle download version and works a dream … except for one thing: "Author" metadata wouldn't insert accordingly. I renamed field to 'Name' and

    print header left: %md_name

    … worked. Any reason why 'author' and %md_author isn't working that you could see?

  19. Support Staff 19 Posted by Brett on 23 Jun, 2023 01:28 PM

    Brett's Avatar

    Interesting. No, there’s no reason I can’t think of why that would be. Will test on my end.

    Thanks,
    Brett
    On Jun 23, 2023 at 8:06 AM -0500, clements.jb <[email blocked]>, wrote:

  20. 20 Posted by clements.jb on 03 Jul, 2023 11:36 AM

    clements.jb's Avatar

    Brett: thanks again for your attention to this.

    I'm now wondering: Can I also enter margins as metadata?

    Doing documents the "metadata way" allows me to keep variables 'in-document' — and to produce imprint templates — rather than having to switch them out, via Marked2 preferences pane.

  21. Support Staff 21 Posted by Brett on 03 Jul, 2023 01:12 PM

    Brett's Avatar

    By the way, I’m able to use Author as a key without issue, not sure what’s going on there yet.

    There’s no metadata way to adjust margins, but it would be possible to add using basically the same code as the headers and footers. Will consider it for the future.

    Thanks,
    Brett
    On Jul 3, 2023 at 6:36 AM -0500, clements.jb <[email blocked]>, wrote:

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac