t9md / atom-markdown-toc-auto Goto Github PK
View Code? Open in Web Editor NEWauto insert and update table of contents on save
Home Page: https://atom.io/packages/markdown-toc-auto
License: MIT License
auto insert and update table of contents on save
Home Page: https://atom.io/packages/markdown-toc-auto
License: MIT License
Provide compatibility for markdown-toc package.
Change my mind. Just ok to let user manually remove old toc and re-generate.
when it is a long markdown file, and it generates a TOC menu, can i jump to the title in the same page by click TOC menu ?
i'm afraid i didn't use it correctly, as the TOC generate a id like (#-2),just like this
maybe it meets some trouble when it meets Chinese character?
Or is there anything should i do?
Thank you very very much!
using new onWIlSave and returning promise on callback solve this?
Will check when I have time.
I have Markdown-toc-auto package installed in my Atom editor. It seems to create the Table of Contents OK but I am not sure how to make these TOC clickable entries to actually go to the proper location the document. The resultant Preview display of the TOC appears to be clickable but goes nowhere.
example is this.
Those entries are apparently derived from the Headers in the documents. But when I click on the link in the Atom Preview Mode, the editor does NOT go to the appropriate Header in the text document.. What am I missing?
Not sure how to reproduce but I encounter once.
When min
is greater than 1, the indentation of each TOC line isn't adjusted, leading to linting errors. Or worse, when min
is greater than 2: the entire TOC gets interpreted as an indented code-block.
Quick PR coming!
Firstly, this is the best markdown TOC package, fast reliable and simple. Thank you for your work.
I was wondering if the second line-break before the end was intended.
<!-- TOC START -->
- headings
<!-- TOC END -->
It annoys me when writing, so I deleted it. In lib\utils.js
line 136 delete the last \n
136
toc += buildTocText(editor, scanHeaders(editor), options) + '\n\n'
Also, I like titles and currently use > # TOC
as a title. How would you implement that as an automated thing?
<!-- TOC START title:true -->
> # Table of Contents
- headings
<!-- TOC END -->
As the current version, TOC generator uses hyphen(-) for unordered list.
But I want to use the asterisk(*) for keeping my markdown style.
Where can I change the setting?
And thanks so much for what you've done.
Brilliant job 👍
The undo
option is deprecated. Call groupLastChanges() on the TextBuffer afterward instead.
TextBuffer.setTextInRange (<embedded>:33539:22)
TextEditor.setTextInBufferRange (<embedded>:3552:35)
insertToc (/Users/Viktor/.atom/packages/markdown-toc-auto/lib/utils.js:143:10)
Object.insertTocAtPoint (/Users/Viktor/.atom/packages/markdown-toc-auto/lib/utils.js:155:3)
HTMLElement.markdown-toc-auto:insert-toc (/Users/Viktor/.atom/packages/markdown-toc-auto/lib/main.js:22:20)
CommandRegistry.handleCommandEvent (<embedded>:23883:49)
I currently updated Atom to 1.18.0 alongside with the plugins I have installed. Now, the Markdown TOC Auto entries are not showing up in the Command Palette. Is this a known issue?
Thanks for the plugin BTW. It makes my life so much easier while writing GitHub wikis :)
[Enter steps to reproduce:]
Atom: 1.27.1 x64
Electron: 1.7.15
OS: Mac OS X 10.13.4
Thrown From: markdown-toc-auto package 0.9.0
Uncaught TypeError: Cannot read property 'startsWith' of undefined
At /Users/vikassri/.atom/packages/markdown-toc-auto/lib/utils.js:68
TypeError: Cannot read property 'startsWith' of undefined
at isMarkdownHeader (/packages/markdown-toc-auto/lib/utils.js:68:72)
at editor.scan (/packages/markdown-toc-auto/lib/utils.js:75:10)
at TextBuffer.module.exports.TextBuffer.scanInRange (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1118:15)
at TextBuffer.module.exports.TextBuffer.scan (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1073:25)
at TextEditor.scan (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:3530:30)
at scanHeaders (/packages/markdown-toc-auto/lib/utils.js:74:10)
at insertToc (/packages/markdown-toc-auto/lib/utils.js:131:23)
at Object.insertTocAtPoint (/packages/markdown-toc-auto/lib/utils.js:155:3)
at /packages/markdown-toc-auto/lib/main.js:22:20)
at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:384:49)
at Object.didConfirmSelection (/Applications/Atom.app/Contents/Resources/app/node_modules/command-palette/lib/command-palette-view.js:152:35)
at SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-select-list/src/select-list-view.js:401:26)
at HTMLDivElement.core:confirm (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-select-list/src/select-list-view.js:106:20)
at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:384:49)
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:110:40)
-0:10.7.0 core:save (input.hidden-input)
-0:08.1.0 core:backspace (input.hidden-input)
-0:06.3.0 command-palette:toggle (input.hidden-input)
-0:04.2.0 core:confirm (input.hidden-input)
-0:04.2.0 markdown-toc-auto:insert-toc (input.hidden-input)
atom-beautify 0.32.4
atom-ide-ui 0.12.0
auto-detect-indentation 1.3.0
auto-indent 0.5.0
autocomplete-python 1.10.5
busy-signal 1.4.3
city-lights-ui 1.3.3
docker 0.8.0
file-icons 2.1.21
fold-functions 0.5.0
fold-lines 0.2.2
foldingtext-for-atom 0.9.2
ftp-remote-edit 0.12.12
git-time-machine 2.0.1
ide-python 0.9.2
ide-yang 0.1.0
intentions 1.1.5
language-cisco 1.4.0
language-docker 1.1.8
language-markdown 0.25.1
language-yang 0.2.0
linter 2.2.0
linter-markdown 5.2.2
linter-python-pep8 0.2.0
linter-ui-default 1.7.1
linter-xmllint 1.4.4
markdown-image-paste 2.5.2
markdown-img-paste 0.3.9
markdown-preview-enhanced 0.15.6
markdown-scroll-sync 2.1.2
markdown-table-editor 1.1.1
markdown-toc 0.4.2
markdown-toc-auto 0.9.0
markdown-writer 2.7.3
platformio-ide-terminal 2.8.1
python-autopep8 0.1.3
python-indent 1.1.5
recursive-folding 0.2.2
remember-folds 0.3.0
remote-ftp 2.2.0
set-syntax 0.4.0
split-diff 1.5.2
Sublime-Style-Column-Selection 1.7.4
tidy-markdown 3.0.1
windows-carriage-return-remover 0.1.3
xml-formatter 0.11.0
Consider:
# Problems
## Base64
### Haskell
### Rust
## XOR key
### Rust
### Octave
### Haskell
GitHub.com will give the first pair of “Rust” and “Haskell” headings #rust
and #haskell
IDs, and the second set will get IDs #rust-1
and #haskell-1
. Neither this package nor the markdown-toc
package match GitHub.com’s style.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.