Closed VladimirAlexiev closed 8 years ago
for TODO Underscores to Spaces, github generates #todo-underscores-to-spaces but you link to #underscores-to-spaces
Not exactly. By default, GitHub strips TODO keywords. But it seems to leave it if you have #+OPTIONS: todo:t
in your file. I think that's fixable.
I've pushed statistics cookies handling to https://github.com/snosov1/toc-org/tree/handle-statistics-cookies
Please, check this if you have a chance.
Next, I'll try to figure something out about TODO handling.
Here's a quick patch re TODO:
;; strip states
(unless org-export-with-todo-keywords
(goto-char (point-min))
(while (re-search-forward toc-org-states-regexp nil t)
(replace-match "" nil nil nil 1)))
toc-org-states-regexp hard-codes a few, but as you know I can customize them in the file. Eg my file validation.org has
#+TODO: TODO QUE | DONE CANCEL
And so if I evaluate the following variables I get
org-todo-keywords ;; ("TODO" "QUE")
org-done-keywords ;; ("DONE" "CANCEL")
All these are put in org-todo-line-regexp
, which is used in (org-get-todo-state)
. The keyword is in match group 2.
NOW, whether you use the hard-coded toc-org-states-regexp or org functions to process this, depends on whether GitHub processes the #+TODO
heading.
Cheers!
I've re-implemented the fixes in https://github.com/snosov1/toc-org/tree/fix-28, since I didn't like the original implementation. Both issues seem to be fixed there, so, please, give it a try.
A couple of comments:
Here's a quick patch re TODO:
Thx! However, you can't use org-export-with-todo-keywords
variable in this package, since GitHub doesn't know about it. I've implemented something similar.\
toc-org-states-regexp hard-codes a few, but as you know I can customize them in the file.
GitHub was handling only TODO and DONE states the last time I checked. So, no plans to support anything else either.
I've also added a couple of tests. Personally, I'm ready to merge it - please, have a look, and if you're ok with it, let's merge & close this:
looks ok
Look at https://github.com/VladimirAlexiev/VladimirAlexiev.github.io/blob/master/Multisensor/validation.org. Only the first two links work, because the other headlines have a TODO or statistics-cookie, but Github doesn't strip these when generating the preview. Eg
Validation [1/16]
, github generates#validation116
but my patch #24 links to#validation-
(forgot a trailing space that is converted to-
).TODO Underscores to Spaces
, github generates#todo-underscores-to-spaces
but you link to#underscores-to-spaces
This means that: