Git Product home page Git Product logo

Comments (7)

hitzhangjie avatar hitzhangjie commented on May 18, 2024

I have another question, 'toc' generated by your plugin, I cannot used it for navigate in documents, I used 'instant-markdown' for realtime preview. Do they the two plugins conflict with each other?

from vim-markdown-toc.

mzlogin avatar mzlogin commented on May 18, 2024

@hitzhangjie For your second question, it seems 'instant-markdown' use CommonMark as its Markdown parser, CommonMark does not add anchor to headings automatic default, and TOC link relyon this feature. Maybe you can find some options in these plugins to turn on it.

Unfortunately, different Markdown parser generate different anchor link for headlings, my current work is for GFM and Redcarpet, under CommonMark is untested.

At company I'm using Windows, and 'instant-markdown' doesn't support Windows official, so I cannot test the situation you said now. If you find the realtime preview page's headings have anchor with them, could you provider a demo generated html file to me for analyze? Thanks.

from vim-markdown-toc.

mzlogin avatar mzlogin commented on May 18, 2024

@hitzhangjie Updating existing toc is a good idea, I'll work on it when I got some free time.

from vim-markdown-toc.

sunaku avatar sunaku commented on May 18, 2024

:neckbeard: Here is how I do this from Vim's command mode:

:/<!-- vim-markdown-toc \w\+ -->/,/<!-- vim-markdown-toc -->/d|execute 'normal! k'|GenTocGFM

You can replace GenTocGFM with GenTocRedcarpet as the last word of the command line too.

from vim-markdown-toc.

sunaku avatar sunaku commented on May 18, 2024

Oops, this plugin already provides a :UpdateToc command. 🎅 Shouldn't this issue be closed then? 📕

from vim-markdown-toc.

mzlogin avatar mzlogin commented on May 18, 2024

@sunaku Yeah, I updated the code yesterday to add :UpdateToc command and a feature of auto update toc on save, but have not update the README doc yet. Sorry about that, I'll do it soon. Your command mode command above is very concisely, thanks.

@hitzhangjie You can use :UpdateToc command to update existing toc generated by this plugin now, and by default, the toc will auto update when save, you also can add let g:vmt_auto_update_on_save = 0 to your vimrc file to close this feature.

from vim-markdown-toc.

sunaku avatar sunaku commented on May 18, 2024

Awesome! ✨ Auto-update on save sounds great! 👍 Thanks @mzlogin. 🎅

from vim-markdown-toc.

Related Issues (20)

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.