On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Custom Heading IDs

A topic by writebox created 9 days ago Views: 51 Replies: 4
Viewing posts 1 to 4
(1 edit)

Hello, I'm a new Deepdwn customer this week. Overall an excellent tool; the table editor in particular is outstanding.

One sorely missing feature is custom heading ID support (per the Markdown Guide here: https://www.markdownguide.org/extended-syntax/#heading-ids).

This feature is more or less must have for me, and presumably anyone working with documents containing  non-unique headings. This is  common in longer documents, and particularly in documents composed from multiple source files.  

Custom Heading IDs would enable links to point to each specific heading instance, regardless of the uniqueness (or otherwise) of the heading text. E.g.,  

## Brown Bears {#my-1st-custom-id}

#### Brown Bears {#my-2nd-custom-id}


In terms of editor-user experience, it would be nice if the custom ID markdown was rendered darker than the heading text itself, as are the ATX Heading hashes (###).

Please consider adding custom heading ID support soon !

(2 edits) (+1)

Hello, and thanks for the feedback!

While custom heading IDs aren’t currently supported, the automatically generated ones are unique. Generally, you’d use

[my first brown bears heading](#brown-bears)

and

[my second brown bears heading](#brown-bears-1)

and so on.

I believe there may be an issue with autocomplete which may by obscuring that feature as well, so I’m hoping to get the fix out for that soon.

(2 edits)

Thanks for you quick reply Billiam :)

By saving and viewing the generated html I can confirm that even non-unique headings get unique generated IDs.  However I did notice that the 2nd heading is assigned 1, the 3rd heading is assigned 2, and so on. So we're always off by one which is a bit awkward. It would be more natural to use (for me, at least) if the 2nd heading was assigned 2, the 3rd heading assigned 3, and so on.

Meanwhile, this works within a file, but I'm less confident that generated IDs would work for duplicated headings across files?  Besides, having to update the target of existing links if ever a non-unique heading is added or removed from the project (or if ever a heading is edited?) seems less than ideal. Happy to learn otherwise, but perhaps this is where custom IDs would be a useful addition?

FWIW, I also noticed that the syntax checker complains about non-unique heading text. Is there an easy way to turn this rule off?

(+1)

I’m less confident that generated IDs would work for duplicated headings across files?

That’s certainly supported within Deepdwn, yes

FWIW, I also noticed that the syntax checker complains about non-unique heading text. Is there an easy way to turn this rule off?

You can disable that syntax check in the config in Preferences > Advanced > Makdown Formatting Rules. You’d want to add

“no-duplicate-header”: false

(+1)

Awesomeness!  Thanks Billiam :)