michaelmyc / vue-markdown-plus

A powerful and highspeed Markdown component for Vue.

Home Page:https://michaelmao.me/vue-markdown-plus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow TOC to render with nav/nav-item to support scrollspy

pcmacdon opened this issue · comments

First thanks for updating this package: I find it very useful.

A cool feature to have though would be ability to support scrollspy by using b-nav/b-nav-item instead of ul/li.

Not sure how to go about it myself.

This is likely not possible. The b-nav component is a bootstrap-vue component, which is not supported by regular HTML. The package compiles markdown into HTML and injects it into a div so the user would see the content in the browser. This does not transpile markdown into Vue, so what you are looking for is not feasible.

What you are looking for is a markdown to Vue transpiler that compiles markdown into Vue snippets that you can then insert into your Vue source code.

Yes, after adding nav/nav-item classes dynamically to try and get scrollspy working,
I realize that instead I'll have to write a Vue component to build the TOC dynamically.