Giter Club home page Giter Club logo

markdown2ctags's People

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

markdown2ctags's Issues

any chance of porting this script to python 3 ?

EDIT: Ignore this request. I just noticed that this script supports python 3 a long time ago. The problem was the package, https://aur.archlinux.org/packages/markdown2ctags/ was still asking for python2.

---- IGNORE ---
First of all thank you for your work and support on this script.
It's a superb and extremely usefull addition for tagbar.
It has served me well over the years, almost daily editing markdown files.

I am not a developer, just an advanced end user. Apologies if I'm requesting this port to python 3 without being able to contribute any python code myself.

I was just cleaning up my system (Archlinux) from old uneeded stuff and dependencies
and noticed that the my only reason to keep python 2 right now, is markdown2ctags. This is from a user with a very broad pallet of software depending on python (scientific, geo, dev, multimedia etc) , and constantly testing installing/uninstalling python related scripts and programs. That is, I very rarely feel the need to have python2 dependencies installed on my system. And if I do feel that , I prefer to install them on a separate testing/virtual environment.

I was then curious about other more popular Linux distros, like Ubuntu and Debian and went to check their status regarding their "official/default" python versions.

  1. Debian, https://wiki.debian.org/Python:

Debian Buster (July 2019) contains Python 3.7 (default), 2.7
Debian Stretch contains Python 2.7 (default), 3.5
Debian Jessie contains Python 2.7 (default), 3.4
Debian Wheezy contains Python 2.7 (default), 3.2
Debian Squeeze contains Python 2.5, 2.6 (the default), 3.1.

  1. Ubuntu, https://wiki.ubuntu.com/Python:

transitioned to Python 3.6 as the default (and probably only) Python 3 version since 18.04 LTS

All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only. If you can't do this because of your dependency stack, let's talk.

PS1: I could still use tagbar with markdown files and get rid of python2.

Without the markdown2ctags script, I could, https://github.com/majutsushi/tagbar/wiki#markdown:

Add the following to your ~/.ctags:

--langdef=markdown
--langmap=markdown:.mkd
--regex-markdown=/^#[ \t]+(.*)/\1/h,Heading_L1/
--regex-markdown=/^##[ \t]+(.*)/\1/i,Heading_L2/
--regex-markdown=/^###[ \t]+(.*)/\1/k,Heading_L3/
... and the following in vimrc:

let g:tagbar_type_markdown = {
    \ 'ctagstype' : 'markdown',
    \ 'kinds' : [
        \ 'h:Heading_L1',
        \ 'i:Heading_L2',
        \ 'k:Heading_L3'
    \ ]
\ }

But, I very much prefer markdown2ctags script since it support both the ATX-style headings and the underline (Settext) style headings. And I dont have to maintain a dot.ctags file. And it's so usefull to other users, that there's even a package for it https://aur.archlinux.org/packages/markdown2ctags/. So I dont have to worry about updates myself.

PS2: Related (old) Issue: It is better change the "python" to "python2" #8

Should markdown2ctags detect YAML frontmatter?

YAML frontmatter included in a markdown document is marked by triple dashes above and below the YAML.

---
title: Document title
---

markdown2ctags interprets the last yaml item as a section title simply because that line is just above the triple dashes.

Solution suggestions:

  • Check for any pairs of triple dashes and ignore them
  • Set lower limit of number of characters needed to form a setext title to four.

E713: Cannot use empty key for Dictionary

I find the following error message when I use this plugin:

Error detected while processing function tagbar#ToggleWindow..<SNR>148_ToggleWindow..<SNR>148_OpenWindow..<SNR>148_AutoUpdate..<SNR>148_ProcessFile..<SNR>148_ParseTag
line..<SNR>148_ProcessTag..<SNR>148_add_tag_recursive..<SNR>148_add_tag_recursive..<SNR>155_addChild:
line    6:
E713: Cannot use empty key for Dictionary

After working on my markdown file for a while, I find the error is caused by || in the section title.

# Logical operators ( || ) 

This might be a bug.

not work for markdown

hello, i am using vim8 with Ubuntu 18.04.
following the wiki page to install Tagbar and markdown2ctags, i found that, it is NOT working.
can you provide some guides on this issue?

~/.vimrc setup:

 Plug 'majutsushi/tagbar'   

let g:tagbar_type_markdown = {
     \ 'ctagstype': 'markdown',
     \ 'ctagsbin' : '~/.vim/markdown2ctags.py',
     \ 'ctagsargs' : '-f - --sort=yes',
     \ 'kinds' : [
       \ 's:sections',
       \ 'i:images'
     \ ],
     \ 'sro' : '|',
     \ 'kind2scope' : {
         \ 's' : 'section',
     \ },
     \ 'sort': 0,
 \ }

Nothing is shown in the tagbar window in md file

Hi, I'm trying to find out why it suddenly not working for any .md file
when I first installed it, it can work normally, however it can not show anything now. I do configure .vimrc like README page.

I use macvim and i installed these related plugs.

Plug 'majutsushi/tagbar'
Plug 'jszakmeister/markdown2ctags'
Plug 'xolox/vim-misc'
Plug 'xolox/vim-easytags'

I tried markdown2ctags -f - test.md. and got the following information.

!_TAG_FILE_ENCODING	utf-8	//
!_TAG_FILE_FORMAT	2	//
!_TAG_FILE_SORTED	1	//
Dec 7, 2020, 1:55 PM	/Users/ryan/Desktop/test.md	/^#### Dec 7, 2020, 1:55 PM$/;"	s	line:10	section:test
Dec 7, 2020, kkk12:35 AM	/Users/ryan/Desktop/test.md	/^#### Dec 7, 2020, kkk12:35 AM$/;"	s	line:2	section:test
test	/Users/ryan/Desktop/test.md	/^### test$/;"	s	line:1

I really can't realize what is going wrong

六 替换成 e5

我在使用插件的时候 数字 六 被替换成 e5, 这是什么原因?
如果把-sro=» 替换成 '|',那么 会出现没有权限执行的错误

neovim

Except markdonw, it works

深度截图_dde-desktop_20200123122647

深度截图_dde-desktop_20200123122728

深度截图_dde-desktop_20200123123507

wrong tags when section level starts at 2

Hi, thank you for markdown2ctags. I noticed wrong output when a markdown document doesn't include a level 1 section.

File test1.md

## Translations
### Adding New Translations
### Updating Existing Translations
### Full example for German
### Desktop file
### Plugins
### Help files
### Thank you

python markdown2ctags.py test1.md; cat tags

!_TAG_FILE_FORMAT   2
!_TAG_FILE_SORTED   1
Adding New Translations test1.md    /^### Adding New Translations$/;"   s   line:2  section:Translations
Desktop file    test1.md    /^### Desktop file$/;"  s   line:5  section:Translations|Adding New Translations
Full example for German test1.md    /^### Full example for German$/;"   s   line:4  section:Translations|Adding New Translations
Help files  test1.md    /^### Help files$/;"    s   line:7  section:Translations|Adding New Translations
Plugins test1.md    /^### Plugins$/;"   s   line:6  section:Translations|Adding New Translations
Thank you   test1.md    /^### Thank you$/;" s   line:8  section:Translations|Adding New Translations
Translations    test1.md    /^## Translations$/;"   s   line:1
Updating Existing Translations  test1.md    /^### Updating Existing Translations$/;"    s   line:3  section:Translations|Adding New Translations

You can see that most level 3 sections are nested under another level 3 section - the first one encountered in the file. I suspect that the script assumes the existence of a level 1 section, which as a matter of fact isn't a markdown requirement. Note that if I take test1.md, delete one section level from all sections, and try again, the output tags are correct this time. Specifically

File test2.md

# Translations
## Adding New Translations
## Updating Existing Translations
## Full example for German
## Desktop file
## Plugins
## Help files
## Thank you

python markdown2ctags.py test2.md; cat tags

!_TAG_FILE_FORMAT   2
!_TAG_FILE_SORTED   1
Adding New Translations test2.md    /^## Adding New Translations$/;"    s   line:2  section:Translations
Desktop file    test2.md    /^## Desktop file$/;"   s   line:5  section:Translations
Full example for German test2.md    /^## Full example for German$/;"    s   line:4  section:Translations
Help files  test2.md    /^## Help files$/;" s   line:7  section:Translations
Plugins test2.md    /^## Plugins$/;"    s   line:6  section:Translations
Thank you   test2.md    /^## Thank you$/;"  s   line:8  section:Translations
Translations    test2.md    /^# Translations$/;"    s   line:1
Updating Existing Translations  test2.md    /^## Updating Existing Translations$/;" s   line:3  section:Translations

Akward `<bb>` Parts

Hey there!
Thanks for implementing this! I choose this over the default tags, cause the supported nesting (as I heard).
My problem is, that I get some weird output in my TagBar. It seems like the subsections get splitted but, then the "main nodes" in TagBar look something like this, for a depth of H4:

Header<bb>Sub-Header<bb>Sub-Sub-Header:
  - Sub-Sub-Sub-Header
  - Sub-Sub-Sub-Header

Header<bb>Sub-Header<bb>Sub-Sub-Header:
  - Sub-Sub-Sub-Header

That does not help much. I guess the <bb> should open a new line? Unfortunately they don't break in Vim and I can't see much, since my TagBar isn't thaaat wide.

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.