Outline widget should be able to parse Markdown and reStructuredText for headings
See original GitHub issueSummary:
The Outline widget should be able to parse Markdown and reStructuredText for headings.
Details:
I tend to use Spyder for pretty much everything related to a Python project: .py files of course, but also YAML files for continuous integration services and markdown or reStructuredText for README files. Right now, when editing a .md or .rst file, the Outline Explorer is greyed out and contains the most recent .py file’s outline.
These readme files can get quite long and being able to see the full outline would be quite a nifty feature, especially if combined with #2192. Imagine clicking on a section in the Outline widget not only brought you to that section of the code (as it does now), but also scrolls the rendered text from #2192 to the correct section.
I think that just headings/sections would be a good place to start. I’m not sure what other items would be easily mappable to the Outline.
Icons could be a circle surrounding a number, denoting what Atx-style header is being used (1 for H1, 3 for H3, etc.). Figuring out the header level for Setext-style Markdown headers and reStructuredText headers will be a little harder.
Example:
Given the following Markdown,
# Main Title
## SubSection
+ Bullet 1
+ Bullet 2
+ Bullet 3
## Another SubSection
Here be dragons
#### SubSubSection1
Text
#### SubSubSection2
More Text
## 3rd SubSection
End of document
the Outline would look like:
- Main Title
+ SubSection
- Another SubSection
+ SubSubSection1
+ SubSubSection2
+ 3rd SubSection
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (7 by maintainers)
Could we use something like this:
https://github.com/onivim/markdown-language-server
@ccordoba12 @andfoy ?
Sure, once we migrate to the outline explorer to use the LSP, then this feature will depend on the server itself.