New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore additonal TODO types #74
Comments
Sorry, I'm not sure I understand your message 100%. Can you, please, provide
|
Hi, |
Also I have one other issue...... If I have a heading tagged with :TOC: then sometimes the first entry in the table of contents is on the same line as the TOC headline. Eg if i have:
Then toc-org displays the table of contents like this:
|
Unfortunately, I didn't get any e-mail - and I'd advise to use this thread, anyhow.
This is a known presentation issue. Functionally, it works alright (i.e. the contents of the file are correct) - it's only the presentation that's affected (and only when the contents of the TOC change). The workaround is to open/close it. Implementing it properly seems to be too difficult compared to its value (see #9) |
Thanks for letting me know about the presentation issue and the work around. Getting back to the first issue, you asked me how to reproduce it. If you put the following in a .org file you should be able to reproduce this - please let me know if you can't:
On the first line i have defined some additional TODO types On the second line I have made the heading * Test to be of a WAITING type (I use C-c C-t to bring up a selection of TODO types and then choose 1) On the third line I have a heading called * TOC and I have tagged it "TOC: The problem is this: Clicking on:
I believe this is due to toc-org thinking that WAITING is part of the name of the heading, while org mode ignores WAITING as part of the heading name, because WAITING is a TODO type. Similarly:
Also gives the same error for Test2 IMHO toc-org needs to strip out the TODO keyword out of the link in order for the link to work. I hope this explains things well enough, please let me know if not. |
I'm having the same issue. Basically, what I have is:
As you can see, if there is a keyword "DONE" on the heading (e.g.head2 above) which is the default for emacs org-mode, the inserting function of toc automatically recognize it, and gives me a great link in the toc section with the correct name. However, if the todo keywords is self-defined, i.e. "CANCELED" in head1 above, it cannot recognize it, and simply regards it as part of the section title. What I want is this:
Looking forward to your reply. |
Did anything ever happen with this? As far as I can tell this is still an issue. If the user has any |
I have presumed since the developer did not respond to either of us, for over 2 years now, that he has chosen to ignore us and the issue. |
Guys, you're always on my mind! As for the issue, Github has no access to individual So, all the metadata should be part of the file itself (not in emacs config). And not only that - it should be parsed by the github org renderer . One way to do this is via per-file keywords |
For anyone who is mostly using org-mode, I hacked together a custom hrefifier to strip out any TODO keywords in (defun toc-org-hrefify-todo (str &optional hash)
"Strip TODO keywords from the input heading and then format as an org link."
(toc-org-format-visible-link (strip-todo-keywords str)))
(defun strip-todo-keywords (heading)
"Strip leading TODO keywords from an input heading."
;; Strip off TODO shortcut characters from the keywords list,
;; and remove the "|" state separator if present.
(setq org-todo-keywords-stripped
(mapcar
(lambda (str)
(replace-regexp-in-string "([^()]+)" "" str))
(cl-remove "|" (cdr (car org-todo-keywords)) :test #'equal)))
;; Strip any keywords from the beginning of the heading.
(let ((regexp (format "^\\(%s\\)[[:space:]]+" (regexp-opt org-todo-keywords-stripped 'words))))
(if (string-match regexp heading)
(replace-regexp-in-string regexp "" heading)
heading))) Now in your org file you can tag your table of contents heading as Side note: It might be useful if the TOC tag could also be specified in the format |
Yup, that's why we love customization.
Being |
For the record, my original position was that this is a package to auto-generate TOCs in emacs org files, so it should probably produce TOCs that work correctly in org-mode, especially when there is an "org" hrefifier option built in. I get that we can't please everyone, nor can we anticipate all the ways people will use a system like emacs/org-mode. Nevertheless, it seems relatively safe to assume that many org users are using emacs, org-mode, and TODOs. This point is somewhat conceded by the fact that toc-org already handles the two default "TODO" and "DONE" keywords. Furthermore, most people who use emacs make at least light use of "outside of file" configs (yourself included, it seems). It's not really clear to me how this is a controversial position, but maybe I'm wrong and people are mostly using some VSCode extension and authoring their Github readmes. However upon further reflection on the readme and your comments here, I decided that it wasn't my place to fight the "no config outside the file" or "Github first" philosophy. In any case, I appreciate the easy escape hatch you built in. I do have a couple of questions, though:
|
May it be enough to parse |
Hi,
I added additional TODO types such as WAITING.
So I may have a heading:
toc-org includes the WAITING todo type in the table of contents.
I notice that toc-org does not include eg TODO.
When I click on
in the table of contents, I get an error:
No match - create as a heading?
I assume because toc-org includes WAITING in the heading name, while org mode ignores WAITING in the heading name, and so there is a mismatch.
Is there a way to ignore additional TODO types?
Thanks ahead of time.
The text was updated successfully, but these errors were encountered: