Giter VIP home page Giter VIP logo

toc-org's People

Contributors

alexander-miller avatar alphapapa avatar ardumont avatar azizyemloul avatar htsr avatar iqbalansari avatar jaremko avatar skangas avatar snosov1 avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toc-org's Issues

Feature request: "Back to top" href link

Hi,

Would it be possible to have an options to add a "back to top" href link?
Because when reading a long readme, it takes a long time to scroll to the TOC, and it's not easy to find where you just clicked.

Thanks.

Duplicated section names lead to wrong hyperlinks

first, thank you for building this tool. it is very helpful.
I have a document with the following structure:

  • Section 1
    ** subsection
    **** labelA

  • Section 2
    ** labelA

The TOC is created by default for up to level 2. The TOC looks good. The problem is that the TOC entry for labelA (part of Section 2) jumps to the first occurrence of labelA rather than the second.

[Github] Handle duplicate headings correctly

As explained in #1 (comment)

If a heading is appearing more than once on github pages, github is appending a number to the anchor (`messagelist-1).

Here's a generated example with the current functionality:

   - [[#general][General]]
     - [[#authentication][Authentication]]
   - [[#requests][Requests]]
     - [[#messagelist][message:list]]
   - [[#events][Events]]
     - [[#messagelist][message:list]]

Here's how it should look like:

   - [[#general][General]]
     - [[#authentication][Authentication]]
   - [[#requests][Requests]]
     - [[#messagelist][message:list]]
   - [[#events][Events]]
     - [[#messagelist-1][message:list]]

TOC list item indentation is twice as wide as usual

The default indentation for a list item level is two spaces. Customizing org-list-indent-offset adds the specified number of spaces to that. This package is however using four spaces unconditionally as can be seen in toc-org-hrefify-toc by (insert " ").

Links don't work if headline has any TODO or statistics-cookie

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

  • for Validation [1/16], github generates #validation116 but my patch #24 links to #validation- (forgot a trailing space that is converted to -).
  • for TODO Underscores to Spaces, github generates #todo-underscores-to-spaces but you link to #underscores-to-spaces

This means that:

  • you should strip TODO and statistics-cookies from link label, but leave them in link href (stripping punctuation and converting to lowercase)
  • the links won't work in org-mode (but I think that's ok since there's enough navigation facilities there)
  • the links won't be stable (fixing a task to DONE will change its anchor, and the cookies of all its ancestors). We should give up the idea of stable links in github, unless they fix their code

Ignore some headings

Hi,

I use toc-org for the readme in https://github.com/alphapapa/org-protocol-capture-html, and it works great, but I would like to be able to leave out some headings from the TOC, like the ones above it.

It would be nice if toc-org supported a tag or property to ignore certain headings, similar to how org-mode export ignores the :ignore: tag.

Thanks for your work on toc-org!

Doesn't work?

I was excited to use this package, but it doesn't seem to be working. I installed from MELPA and used the code in the instructions to add the hook. Then I made a headline and gave it the :TOC: tag, but when I save the file, no table of contents is created.

Currently using Emacs 24.4 and Org 8.2.4.

When I eval the code to add the hook, this shows up in *Messages*:

(toc-org-enable org-mark-readonly (lambda nil (org-bullets-mode 1)) adp/org-mode-hook #[nil "Å�Æ  >��

As you can see, there seems to be some garbage characters in there. Either Emacs wouldn't copy it all to the clipboard, or Firefox wouldn't paste it all here. :/

is there anyway to specify link href for headline?

I noticed that toc-org will always create a href from the headline name even after providing a CUSTOM_ID property:

* toc :TOC:
- [[#headline][headline]]

* headline
:PROPERTIES:
:CUSTOM_ID: id
:END:

I'm wondering is there anyway to specify it?

"upcase-fix" question

toc-org has an interesting line

(upcase-fix (replace-regexp-in-string "[A-Z]" 'downcase spc-fix t))

It makes me like this: 🤔

Why doing (downcase "s[s]-_SS") that will output s[s]-_ss isn't sufficient?

toc-org-enable to add TOC headline if missing

Something for toc-org-enable:

    (setq  ; toc-org puts TOC in the org file, so these conflict
       org-export-with-section-numbers nil
       org-export-with-toc nil)
    ;; add TOC headline if missing
    (unless (org-find-exact-headline-in-buffer "Table of Contents")
      (org-first-headline-recenter)
      (beginning-of-line)
      (insert "* Table of Contents                                 :TOC_5:\n\n"))

Why :TOC_5: not :TOC_2: ? See #27

Extend to derived modes

Would it be interesting using this package for modes beyond org ? I mean using

(derived-mode-p major-mode 'org-mode)

instead of

(eq major-mode 'org-mode)

This would be interesting for myself, sure, but I guess that for others too. I don't see a problem by proceeding this way as this only generalizes its use. What do you think ?

Subtree-specific TOC

Hi -

Thank you very much for the great package.

Since I often to export subtrees instead of an entire file, it would be great if it becomes possible to create the automatic toc at the subtree level. For example, with the following:

* Heading
** Table of Contents    :TOC:
** Subheading1
** Subheading2

desired output is:

* Heading
** Table of Contents    :TOC:
- Subheading1
- Subheading2
** Subheading1
** Subheading2

add better toc-org-special-chars-regexp

Current toc-org-special-chars-regexp misses some characters. Can we use the same one that GitHub uses ? Here is a test string "Set AA053 Лыв № mon_osced font size(设置等宽字体)"
) - isn't what you think 😄
replace-regexp-in-string with "\\W" outputs "#setaa053Лывавдыmonospacedfontsize设置等宽字体" It should be "set-aa053-Лыв--mon_osced-font-size设置等宽字体"so we probably need something like this "[^\\w\\-_ ]" but for some reason it removes everything.

use custom variables for options

Expressing one's preferences in the TOC tag (eg as the default :TOC_2_gh:) is not quite proper style.
Eg in #26 I prefer :TOC_5: while the default is :TOC_2:.

It's better to use purely :TOC: to mark the headline, but have custom variables for these options.

  • for the depth, use eg org-toc-level. You could use the value of org-export-with-toc, if number, to set this (that's the variable used by HTML export)
  • for the style, use eg org-toc-style

If the org file has no headers, everything is deleted

I wrote a document with no headers (I forgot to add them), then added

  • Table of contents :toc:

at the top.

The moment I saved the file, everything was deleted.

It might be useful to have some type of marker to delimite where the old header ends, so it does not delete text beyond that.

Custom toc-org-hrefify-STYLE based on ID

Hi,

I try to develop a custom toc-org-hrefify-STYLE function, where I need to get the ID property of the heading. Is there a way to achieve that ? I mean, I only have access to the heading itself, not no any of its properties. Maybe extending str in

(str &optional hash)

to include the whole heading might be great. Otherwise, a third argument

(str &optional hash props)

with props obtained from org-entry-properties is also an option.

Alternatively, any way to access to the current org file name ? When using

(defun toc-org-hrefify-custom (str &optional hash)
"Given a heading, transform it into a href using the org-mode rules."
(format "%s" (buffer-file-name)))

I get nil. If I had access to it, I would parse its contents to get the heading ID.

Thanks for your help,

C.

toc-org makes Gnus prompt to save, for article in org-mode mailing list

This snippet:

(eval-after-load "org" 
  (lambda () 
    (if (require 'toc-org nil t) 
        (add-hook 'org-mode-hook 'toc-org-enable) 
      (warn "toc-org not found"))))

Has the following effect:

When i access org-mode mailing list with gnus, on certain articles (I guess with org-mode babel blocks) it prompts to save.

depth control tag doesn't work

I tried tagging a header like :TOC_8: and still got a TOC of depth 2; I had to change the setting toc-org-max-depth in custom to change the depth. I'm also not seeing where in the code this tag is meant to be processed

#+BEGIN_QUOTE disappear after saving

I just copy the code in https://raw.githubusercontent.com/snosov1/toc-org/master/README.org

* Table of Contents                                                     :TOC:QUOTE:
#+BEGIN_QUOTE
- [[#about][About]]
- [[#installation][Installation]]
  - [[#via-packageel][via package.el]]
  - [[#manual][Manual]]
- [[#use][Use]]
  - [[#follow-links][Follow links]]
  - [[#exclude-headings][Exclude headings]]
  - [[#quote-table-of-contents][Quote table of contents]]
  - [[#shortcut-for-toc-tag][Shortcut for TOC tag]]
- [[#different-href-styles][Different href styles]]
- [[#example][Example]]
#+END_QUOTE

But after saving the file, the #+BEGIN_QUOTE and #+END_QUOTE two lines disappear.

And I try to add these two lines manually, but failed.

Unwanted 1-space indent

  1. There's a 1-space indent
  2. I'd like an extra new line below "Table of Content"

Although 2. should be optional I suppose.

* Table of Content                                                      :TOC:
 - [[#bootstrap][Bootstrap]]
   - [[#use-better-defaults][Use better defaults]]
   - [[#load-customel][Load =.custom.el=]]
   - [[#load-secretel][Load =.secret.el=]]
 - [[#theme][Theme]]
 - [[#languages][Languages]]
   - [[#css][CSS]]
   - [[#docker][Docker]]
   - [[#html][HTML]]
   - [[#javascript][JavaScript]]
   - [[#lisp][Lisp]]
   - [[#markdown][Markdown]]
   - [[#org][Org]]
   - [[#python][Python]]
   - [[#yaml][YAML]]

* Bootstrap

Should be:

* Table of Content                                                      :TOC:

- [[#bootstrap][Bootstrap]]
  - [[#use-better-defaults][Use better defaults]]
  - [[#load-customel][Load =.custom.el=]]
  - [[#load-secretel][Load =.secret.el=]]
- [[#theme][Theme]]
- [[#languages][Languages]]
  - [[#css][CSS]]
  - [[#docker][Docker]]
  - [[#html][HTML]]
  - [[#javascript][JavaScript]]
  - [[#lisp][Lisp]]
  - [[#markdown][Markdown]]
  - [[#org][Org]]
  - [[#python][Python]]
  - [[#yaml][YAML]]

* Bootstrap

Don't export toc in LaTeX format

Sorry if I'm missing something obvious, but I can't find a way to prevent the toc from being exported to LaTeX. Is there a way?

Thanks!

Follow Links not working

I installed this package and toc is getting generated but follow links is not working. For me, if i click on it it opens file explorer.
If I use C-c C-o shortcut. It opens visit tags table.

I have checked the variable org-link-translation-function was nil. And after toc enabling it is set to toc-org-unhrefify.

Solved: seems like issue was with included org-ctags package

Cookies tracking progress in a headline breakes links in the TOC

If I have a headline like this;

** Task headline [2/2]
*** DONE Subtask headline
*** DONE Another subtask headline

the resulting link in the TOC will look like this;
- [[#task-headline-22][Task headline]]

The link will be unusable. Removing the [2/2] and saving makes the link usable.

generated hrefs are not indented as expected

reproducing with the readme.org of this repository, the result is shown in the following image:

image

However, the contents under a headline should be indented like this by convention:

image

As toc-org-mode automatically refresh the TOC part, I am not even able to adjust the indentation manually, is there a solution?

[Emacs 26] defcustom should specify type

In toplevel form:
toc-org.el:82:1:Warning: defcustom for `toc-org-max-depth' fails to specify
    type
toc-org.el:82:1:Warning: defcustom for `toc-org-max-depth' fails to specify
    type
toc-org.el:88:1:Warning: defcustom for `toc-org-hrefify-default' fails to
    specify type
toc-org.el:88:1:Warning: defcustom for `toc-org-hrefify-default' fails to
    specify type
toc-org.el:92:1:Warning: defcustom for `toc-org-enable-links-opening' fails to
    specify type
toc-org.el:92:1:Warning: defcustom for `toc-org-enable-links-opening' fails to
    specify type

Ignore additonal TODO types

Hi,
I added additional TODO types such as WAITING.
So I may have a heading:

  • WAITING Expect mail

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

  • WAITING Expect mail

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.

Custom additional keywords for TODO are not stripped with todo:nil on OPTIONS

Description

Custom wide additional keywords for TODO are persisting even when todo:nill is setted to OPTIONS on local buffer.

Behavior

When todo:nil is defined on #+OPTIONS I still got the custom keywords on my TOC: IN-PROGRESS and WAITING. But the keywords TODO and DONE are stripped as expected.

#+STARTUP: showall align
#+OPTIONS: todo:nil tasks:all tags:nil
#+EXCLUDE_TAGS: TOC_3

* Sumário                                                             :TOC_3:
:PROPERTIES:
:CUSTOM_ID: toc-org
:END:
- [[#task1][Task1]]
- [[#task3][Task3]]
- [[#in-progress-task2][IN-PROGRESS Task2]]
- [[#waiting-task3][WAITING Task3]]

* DONE Task1
  CLOSED: [2017-09-08 Fri 01:46]
* TODO Task3
* IN-PROGRESS Task2
* WAITING Task3

Expected

All the keywords are stripped from the headings.

#+STARTUP: showall align
#+OPTIONS: todo:nil tasks:all tags:nil
#+EXCLUDE_TAGS: TOC_3

* Sumário                                                             :TOC_3:
:PROPERTIES:
:CUSTOM_ID: toc-org
:END:
- [[#task1][Task1]]
- [[#task3][Task3]]
- [[#in-progress-task2][Task2]]
- [[#waiting-task3][Task3]]

* DONE Task1
  CLOSED: [2017-09-08 Fri 01:46]
* TODO Task3
* IN-PROGRESS Task2
* WAITING Task3

I'm missing something? Sorry for that. Great package, by the way.

Suggestion: Stripped TODO keywords defined on org-todo-keywords should be read to strip when todo:nil is set. On my case, I have on my init setup this:

;; add more tags for TODO list on org-mode
(setq org-todo-keywords
      '((sequence "TODO" "IN-PROGRESS" "WAITING" "DONE")))

Doesn't strip TODO keywords.

I set up single-letter keys for TODO keywords. These look like

#+TODO: TODO(t) | DONE(d!)

Then I found these keywords are not stripped.

Handling of properties

Thanks for this great package.

I try to set visibility of my org file to folded at startup, except for the first heading, which includes the table of contents. I realize than when you introduce the visibility property under the TOC heading, it gets corrupted upon updating of the table. Il would be great to fix this.

Thanks again,

Meaningful & stable anchors in HTML export

Consider http://vladimiralexiev.github.io/Multisensor/validation.html. The TOC section is made by toc-org. But the links don't work (and are shown in italic: that's how the HTML export marks broken links)

The reason is that the HTML exporter (org-plus-contrib-20150803 ox-html.el) uses numbered anchors, eg http://vladimiralexiev.github.io/Multisensor/validation.html#sec-3-1. The following are tried in succession to obtain a preferred-id:

              (list (org-element-property :CUSTOM_ID headline)
                (concat "sec-" section-number)
                (org-element-property :ID headline))))

The first is manually set CUSTOM_ID property, the second a numbered reference (eg "sec-3-1") and the third an ID that's automatically inserted by org-store-link.

Numbered anchors are bad because they are not stable: if I move the section, the anchor will change. Github makes anchors from the heading text, which in my experience is a lot more stable. toc-org generates such links when toc-org-hrefify-default is "gh".

The newest ox-html.el uses this

                      (list (org-element-property :CUSTOM_ID headline)
                            (org-export-get-reference headline info)
                            (org-element-property :ID headline))))

You see the second line is changed. It uses org-export-get-reference from ox.el, which uses org-export-new-reference, which "Generates random 7 digits hexadecimal numbers". I don't know if that is stored (which would make it stable), but it's certainly not meaningful to any reader of the HTML file.

I'll try to raise an issue to the ox-export developers. They have a mailing list, no tracker, that's why I'm posting this here.

Tests are breaking?

I'm on Spacemacs Emacs 25.1 OSX GUI. Whenever I try to run tests with ert, it also adding toc-org related tests to the runner (have no idea why), and test-toc-org-insert-toc seems to be failing. I'm not sure how those tests get added to the "UNIVERSE" (whatever that means). And not sure why one of them failing

Headers with non-unique names are not handled properly

Reported by @dvcrn in #1

We have 2 issues related to header uniqueness:

  1. GitHub seems to be appending numbers (i.e. messagelist-1 to distinct between headers with the same name). toc-org doesn't do this. See #16
  2. Internal org linking also jumps only to the first appearance of the heading because toc-org simply uses text search for that.

Example:

  • [[#general][General]]
    • [[#authentication][Authentication]]
  • [[#requests][Requests]]
    • [[#messagelist][message:list]]
  • [[#events][Events]]
    • [[#messagelist][message:list]]

The table of contents section is numbered.

I use #+OPTIONS: num:t to have my sections numbered in GitHub. How do I prevent the Table of contents section (i.e. the one tagged :TOC:) from being numbered? In particular, I tried to use #+PROPERTY: UNNUMBERED:t, but this line gets removed when I save the file.

"No match for custom ID"

Hi,
I have been using toc-org daily to create TOC for blog posts.

When trying to follow a link in the sample org buffer below I get error:

org-link-search: No match for custom ID: h1-header

Sample text:

* toc :toc:

* h=Heading 1

** h1. Header
Text

** h2. Header
More text

* z=Heading 2

** z1. Header
Other text

After calling toc-org-insert-toc this is the resulting buffer:

* toc :toc:
- [[#hheading-1][h=Heading 1]]
  - [[#h1-header][h1. Header]]
  - [[#h2-header][h2. Header]]
- [[#zheading-2][z=Heading 2]]
  - [[#z1-header][z1. Header]]

* h=Heading 1

** h1. Header

Text

** h2. Header

More text

* z=Heading 2

** z1. Header

Other text

Could it be because headers contain =? Is there a workaround for this?

Thanks for toc-org.

Compatibility with Gitlab markdown

Hi,

It would be great if, in addition to github, this package might generate tables
of contents useful when hosting projects in gitlab.

Thanks,

update release for MELPA stable

I think it's time to create a fresh release of toc-org covering the current state of the package. The available one is from 2016 and does not contain toc-org-mode.

Releases for MELPA stable

Since the package looks very mature, it would be great to also have it available on MELPA stable (http://stable.melpa.org). The only step that would be needed for this is to create releases on github that follow the MELPA convention (https://github.com/melpa/melpa/blob/master/CONTRIBUTING.md):

To have a stable version generated for your package simply tag the repository using a naming compatible with version-to-list. The repo state of this tag will be used to generate the stable package.

This would also allow users who want to rely on stable version of emacs packages to also use your great package.

batch mode doesn't work with repeated headlines

If I run toc-org-insert-toc normally (from Emacs) I'll get

* Table of Contents                                         :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#layer-installation][Layer Installation]]
  - [[#layer][Layer]]
  - [[#choosing-a-backend][Choosing a backend]]
- [[#backends][Backends]]
  - [[#meghanada][Meghanada]]
    - [[#installation][Installation]]
    - [[#about-maven][About Maven]]
  - [[#eclim][Eclim]]
    - [[#installation-1][Installation]]
      - [[#eclipse][Eclipse]]
      - [[#eclim-1][Eclim]]
    - [[#configuration][Configuration]]
    - [[#usage][Usage]]
  - [[#ensime][ENSIME]]
    - [[#installation-2][Installation]]
    - [[#configuration-1][Configuration]]
    - [[#usage-1][Usage]]
    - [[#issues][Issues]]
- [[#key-bindings][Key bindings]]
  - [[#meghanada-1][Meghanada]]
    - [[#server][Server]]
    - [[#navigation][Navigation]]
    - [[#compilation][Compilation]]
    - [[#tests-junit][Tests (junit)]]
    - [[#refactoring][Refactoring]]
    - [[#tasks][Tasks]]
  - [[#eclim-2][Eclim]]
    - [[#java-mode][Java-mode]]
      - [[#project-management][Project management]]
      - [[#eclim-daemon][Eclim daemon]]
      - [[#maven][Maven]]
      - [[#goto][Goto]]
      - [[#refactoring-1][Refactoring]]
      - [[#documentation-find][Documentation, Find]]
      - [[#errors-problems][Errors (problems)]]
      - [[#tests][Tests]]
    - [[#errors-problems-buffer][Errors (problems) buffer]]
    - [[#projects-buffer][Projects buffer]]
  - [[#ensime-key-bindings][Ensime key bindings]]
    - [[#search][Search]]
    - [[#sbt][sbt]]
    - [[#typecheck][Typecheck]]
    - [[#debug][Debug]]
    - [[#errors][Errors]]
    - [[#goto-1][Goto]]
    - [[#print-and-yank-types][Print and yank types]]
    - [[#documentation-inspect][Documentation, Inspect]]
    - [[#server-1][Server]]
    - [[#refactoring-2][Refactoring]]
    - [[#tests-1][Tests]]
    - [[#repl][REPL]]

https://gist.github.com/JAremko/acc95c9efbe2cd3d68773bbb9aa624df

But if I do something like this:

emacs --batch -l toc-org.el --file README.org --eval "(progn (toc-org-insert-toc) (save-buffer))"

I'll get that:

* Table of Contents                                         :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#layer-installation][Layer Installation]]
  - [[#layer][Layer]]
  - [[#choosing-a-backend][Choosing a backend]]
- [[#backends][Backends]]
  - [[#meghanada][Meghanada]]
    - [[#installation][Installation]]
    - [[#about-maven][About Maven]]
  - [[#eclim][Eclim]]
    - [[#installation][Installation]]
      - [[#eclipse][Eclipse]]
      - [[#eclim][Eclim]]
    - [[#configuration][Configuration]]
    - [[#usage][Usage]]
  - [[#ensime][ENSIME]]
    - [[#installation][Installation]]
    - [[#configuration][Configuration]]
    - [[#usage][Usage]]
    - [[#issues][Issues]]
- [[#key-bindings][Key bindings]]
  - [[#meghanada][Meghanada]]
    - [[#server][Server]]
    - [[#navigation][Navigation]]
    - [[#compilation][Compilation]]
    - [[#tests-junit][Tests (junit)]]
    - [[#refactoring][Refactoring]]
    - [[#tasks][Tasks]]
  - [[#eclim][Eclim]]
    - [[#java-mode][Java-mode]]
      - [[#project-management][Project management]]
      - [[#eclim-daemon][Eclim daemon]]
      - [[#maven][Maven]]
      - [[#goto][Goto]]
      - [[#refactoring][Refactoring]]
      - [[#documentation-find][Documentation, Find]]
      - [[#errors-problems][Errors (problems)]]
      - [[#tests][Tests]]
    - [[#errors-problems-buffer][Errors (problems) buffer]]
    - [[#projects-buffer][Projects buffer]]
  - [[#ensime-key-bindings][Ensime key bindings]]
    - [[#search][Search]]
    - [[#sbt][sbt]]
    - [[#typecheck][Typecheck]]
    - [[#debug][Debug]]
    - [[#errors][Errors]]
    - [[#goto][Goto]]
    - [[#print-and-yank-types][Print and yank types]]
    - [[#documentation-inspect][Documentation, Inspect]]
    - [[#server][Server]]
    - [[#refactoring][Refactoring]]
    - [[#tests][Tests]]
    - [[#repl][REPL]]

https://gist.github.com/JAremko/3a098fa1ee439cd1e9df31ea4dd7c24d


diff https://www.diffchecker.com/BYfFinYe

doesn't strip TODO progress cookies

Related to #3: it still doesn't strip TODO progress cookies. See (info "(org)Breaking Down Tasks"). These look like

     * Organize Party [33%]
     ** TODO Call people [1/2]
     *** TODO Peter
     *** DONE Sarah
     ** TODO Buy food
     ** DONE Talk to neighbor

Eg in my case, 3 of the headlines below have such cookies, and the generated links are invalid:

 - [[#intro][Intro]]
   - [[#queries][Queries]]
 - [[#validation-116][Validation [1/16]]]
   - [[#entity-linking-service-01][Entity Linking Service [0/1]]]
     - [[#underscores-to-spaces][Underscores to Spaces]]
   - [[#advanced-context-extraction-service-13][Advanced Context Extraction Service [1/3]]]
     - [[#wrong-prefix-for-text-characteristics][Wrong prefix for Text Characteristics]]
     - [[#crawler-to-decode-html-entities][Crawler to decode HTML entities]]
     - [[#keywords-vs-category][Keywords vs Category]]

Missing new line before TOC

This is how it looks like when I save the file. When I cycle the visibility of the table of contents subtree, the issue is gone and the first item - Foo is on the next line. This happens every time, when it is generated. A quick fix would just be to insert a new line before the very first element, this wouldn't be that harmful.

* Table of Contents                        :TOC_3:noexport:...- Foo
- Bar
- Baz

* Foo
* Bar
* Baz

Bug: can't resolve link in TOC when exporting to html

I've been experiencing a bug lately when having a table of contents declared as :TOC: and then trying to export to html. The error is Unable to resolve link: <name-of-your-first-heading>.

Here is a minimal example:

* toc :TOC:
 - [[#foo][foo]]
 - [[#bar][bar]]
 - [[#baz][baz]]

* foo
Aliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non orci
commodo lobortis. Proin neque massa, cursus ut, gravida ut, lobortis eget,
lacus. Sed diam. Praesent fermentum tempor tellus.

* bar
Nullam eu ante vel est convallis dignissim. Fusce suscipit, wisi nec facilisis
facilisis, est dui fermentum leo, quis tempor ligula erat quis odio. Nunc porta
vulputate tellus. Nunc rutrum turpis sed pede. Sed bibendum.

* baz
Nullam eu ante vel est convallis dignissim. Fusce suscipit, wisi nec facilisis
facilisis, est dui fermentum leo, quis tempor ligula erat quis odio. Nunc porta
vulputate tellus. Nunc rutrum turpis sed pede. Sed bibendum.

then when trying export to html (M-x org-export-dispatch RET h o for instance), you get the error user-error: Unable to resolve link: "foo" in *Messages* and just Unable to resolve link: "foo" in the echo area.

A simple workaround is to declare the toc as :TOC:noexport:. This way you don't get the error and the toc is still exported, it just doesn't make sense given what :noexport: is supposed to do 😕

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.