larstvei / ox-gfm

Github Flavored Markdown Back-End for Org Export Engine
230 stars 44 forks source link

Table of contents with wrong URI #1

Closed raully7 closed 9 years ago

raully7 commented 9 years ago

Hello Lars,

I think you are the anthor of ox-gfm.el, and thanks a lot for your work.

when I export a org file to a markdown file, everything is great but the Table of contents. The urls are not work because of the anchor:

- [feature](#feature)

As we generate the A tag in the content like this:

# feature<a id="sec-3" name="sec-3"></a>

I'm afraid there is a bug, and I tried to fix it like this:

104,110d103
<    (anchor
<     (when (plist-get info :with-toc)
<       (or (org-element-property :CUSTOM_ID headline)
<       (concat "sec-"
<           (mapconcat 'number-to-string
<                  (org-export-get-headline-number
<                   headline info) "-")))))
112c105
<     (concat indent "- [" title "]" "(#" anchor ")")))

---
>     (concat indent "- [" title "]" "(#" ref-str ")")))

Hope these help!

larstvei commented 9 years ago

Added the change. The links worked fine for me before, but they were only tested on GitHub. Perhaps this is a better solution?

Let me know if you have any problems with it!

raully7 commented 9 years ago

Cool && thanks.

L42y commented 9 years ago

i think this fix breaks table export, it now export table neither in html nor gfm syntax:

|  parameter | default | is required | type | description |

|-

|  quantity |  | required | number | blah blah |

|  cellphone |  | required | string | blah blah |
raully7 commented 9 years ago

I think you add something about table in the last commit:

                 (org-open-file (org-gfm-export-to-markdown nil s v)))))))
   :translate-alist '((inner-template . org-gfm-inner-template)
                      (strike-through . org-gfm-strike-through)
-                     (src-block . org-gfm-src-block)))
+                     (src-block . org-gfm-src-block)
+                     (table . org-gfm-table)
+                     (table-cell . org-gfm-table-cell)
+                     (table-row . org-gfm-table-row)))

Changes in org-gfm-format-toc would not effect the table export.

larstvei commented 9 years ago

I did, it was a mistake!

It should convert the tables to gfm style tables, but I haven't had the time to implement it. I'll revert the table changes until I get it working.

L42y commented 9 years ago

thanks for your work, i'm just going to shamelessly wait for you to implement table exporting...