Marked 2 uses Bear note identifier as %title for PDF export

robinlandy's Avatar

robinlandy

09 Apr, 2019 06:52 PM

I need to use the note title (the first H1 in the Bear note) in the header. Unfortunately, Marked 2 (Setapp edition) is using the Bear note identifier (a random string of characters & numbers) instead of the title.

The only work-around I can see is to manually enter the title into the Marked header preferences for each doc I want to export.

Is there a setting I'm missing, or can this be fixed in the next version of Marked?

  1. Support Staff 1 Posted by Brett on 09 Apr, 2019 07:11 PM

    Brett's Avatar

    Is Bear exporting metadata with the note? If no title meta is provided,
    it should technically be using the first H1 anyway.

    -Brett

  2. 2 Posted by robinlandy on 09 Apr, 2019 07:45 PM

    robinlandy's Avatar

    The 'Keep tags during export' is [on] in the Bear preferences. There's no Bear preference (afaik) for toggling export metadata.

    I'm using Bear's native integration with Marked via the Bear Menubar: Note > Preview in Marked

  3. Support Staff 3 Posted by Brett on 09 Apr, 2019 07:53 PM

    Brett's Avatar

    I'll have to look into this further. You do have the option of adding a
    line at the top of the file to force the title for a note:

    title: Title of Note

    -Brett

  4. 4 Posted by robinlandy on 09 Apr, 2019 08:04 PM

    robinlandy's Avatar

    I tried using that - but it doesn't appear to make a difference (see attached screenshot)

    Also, note that Bear forces the use of category tags in each note (in this example #blog) as a filing method. (See: https://bear.app/faq/Tags%20&%20Linking/Nested%20Tags/)

    Is it possible to add Bear-specific setting to Marked to ignore category tags so that that they don't appear in Marked?

  5. Support Staff 5 Posted by Brett on 09 Apr, 2019 08:42 PM

    Brett's Avatar

    How would I ever determine what was a category tag and what was a
    headline?

    -Brett

  6. Support Staff 6 Posted by Brett on 09 Apr, 2019 08:43 PM

    Brett's Avatar

    In your screenshot you show "title: Title" inside the h1. To work as
    Meta it has to come before the h1, at the very top of the note. Maybe
    that's not even possible with Bear…

    -Brett

  7. 7 Posted by robinlandy on 10 Apr, 2019 10:36 AM

    robinlandy's Avatar

    Although it's not Bear's default behaviour, it is possible to insert a line before the first H1. However, this seems to result in a completely blank preview in Marked (i.e. the entire content of the Bear note is missing) and the Marked title is still the note ID, rather than the title.

    Screenshot attached: blank Marked window next to the Bear note with a title line inserted before first H1

  8. Support Staff 8 Posted by Brett on 10 Apr, 2019 11:09 AM

    Brett's Avatar

    I'll have to dig in and see exactly what Markdown Bear is producing.

    - Brett

  9. Support Staff 9 Posted by Brett on 10 Apr, 2019 04:17 PM

    Brett's Avatar

    So I tested with the metadata and it actually seems to work fine. You need to make sure there's no formatting, that it's the very first line, and that it's followed by a blank line. Also note that this will only work if using the MultiMarkdown processor.

    As far as using the first H1 as the title, it's something I'd considered in the past but haven't implemented. I think it's a good idea, though, so hopefully I'll be able to incorporate it into a future update.

  10. Support Staff 10 Posted by Brett on 10 Apr, 2019 04:21 PM

    Brett's Avatar

    Actually, I take it back about MultiMarkdown. I'd forgotten that I actually incorporated handling for that with Discount (GFM) as well. The difference is that the metadata will also show up in your document, but you can use HTML comments to hide it, e.g.

    <!--
    title: My Document Title
    -->
    
    # My Document Title
    
    content
    

    -Brett

  11. 11 Posted by robinlandy on 10 Apr, 2019 04:36 PM

    robinlandy's Avatar

    Thanks for your help with this. Yes - I've got it working now too with your instructions. I think the blank line was the missing ingredient (Note: if I omit the blank line, then Marked still shows a completely empty preview)

    Using first H1 as %title would be a great feature.

  12. Support Staff 12 Posted by Brett on 10 Apr, 2019 04:42 PM

    Brett's Avatar

    Yeah, without the blank line it basically considers everything following
    it to be part of the metadata. Which would lead to a really messed up
    title :).

    -Brett

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