Can't make gfm_auto_identifiers work

29 views
Skip to first unread message

Sean Evans

unread,
Sep 25, 2020, 5:44:37 AM9/25/20
to pandoc-discuss

Howdy,

I am attempting to convert from docx to GFM, but seem to be missing something about how to enable gfm_auto_identifiers correctly. I have headers with periods in them (eg - "Step 1. Do This"), and the identifiers that get constructed for the TOC still contain these periods. This is the command I'm using:

$ pandoc -f docx -t gfm+gfm_auto_identifiers --toc -s SomeFile.docx -o SomeOtherFile.md

This results in TOC entries like: "[Step 1. Do This](#step-1.-do-this)"

Any ideas what I'm doing wrong?

Thanks,
Sean


John MacFarlane

unread,
Sep 25, 2020, 6:39:44 PM9/25/20
to Sean Evans, pandoc-discuss

The gfm_auto_identifiers extension affects readers, not writers
(that's why it's not doing anything when you try to attach it
to the writer).

The identifiers are generated in the parsing phase.

Unfortunately, the docx reader doesn't support it (currently ...
perhaps it wouldn't be hard to add this).

A workaround might be going docx -> markdown, then
markdown+gfm_auto_identiifers -> gfm.
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d7cdce51-3057-406d-a2d5-265ca08f3877n%40googlegroups.com.

John MacFarlane

unread,
Sep 25, 2020, 6:55:02 PM9/25/20
to Sean Evans, pandoc-discuss
John MacFarlane <j...@berkeley.edu> writes:

> The gfm_auto_identifiers extension affects readers, not writers
> (that's why it's not doing anything when you try to attach it
> to the writer).
>
> The identifiers are generated in the parsing phase.
>
> Unfortunately, the docx reader doesn't support it (currently ...
> perhaps it wouldn't be hard to add this).

I've fixed this for next release.
Reply all
Reply to author
Forward
0 new messages