habamax / vim-asciidoctor

Asciidoctor plugin for Vim
MIT License
182 stars 16 forks source link

E666: compiler not supported: asciidoctor-pdf #108

Closed KingJulianS closed 2 years ago

KingJulianS commented 2 years ago

Hi again, apologies for these newb issues.

I am getting the above error msg when sourcing my vimrc.
Any ideas ?

    Plug 'habamax/vim-asciidoctor'

    let g:asciidoctor_executable = 'asciidoctor'
    "let g:asciidoctor_extensions = ['asciidoctor-diagram', 'asciidoctor-rouge']
    let g:asciidoctor_pdf_executable = 'asciidoctor-pdf'
    "let g:asciidoctor_pdf_extensions = ['asciidoctor-diagram']
    let g:asciidoctor_pandoc_executable = 'pandoc'
    let g:asciidoctor_pandoc_data_dir = '~/Documents/.pandoc'
    "let g:asciidoctor_pandoc_other_params = '--toc'
    let g:asciidoctor_syntax_conceal = 1
    let g:asciidoctor_syntax_indented = 1
    let g:assciidoctor_fenced_languages = ['python', 'c' ]
    function! AsciidoctorMappings() 
        nnoremap <buffer> <leader>oo :AsciidoctorOpenRaw<CR>
        nnoremap <buffer> <leader>op :AsciidoctorOpenPDF<CR>
        nnoremap <buffer> <leader>oh :AsciidoctorOpenHTML<CR>
        nnoremap <buffer> <leader>ox :AsciidoctorOpenDOCX<CR>
        nnoremap <buffer> <leader>ch :Asciidoctor2HTML<CR>
        nnoremap <buffer> <leader>cp :Asciidoctor2PDF<CR>
        nnoremap <buffer> <leader>cx :Asciidoctor2DOCX<CR>
        nnoremap <buffer> <leader>p :AsciidoctorPasteImage<CR>
        ":make will build PDF's
        compiler asciidoctor2pdf
    endfunction
    "Call AsciidoctorMappings for all adoc type files. 
    augroup asciidoctor
        autocmd! 
        autocmd BufEnter *.adoc, *.asciidoc call AsciidoctorMappings()
    augroup END
habamax commented 2 years ago

Why do you have space again?

I am not 100% sure, but move asciidoctor settings out of plug#begin/plug#end

KingJulianS commented 2 years ago

Sorry I just recopied from the previous issue I logged in github. Hence the space.
I have moved it outside, but still the same. I have since also double checked that :version is showing it's compiled with +eval if that is anything to consider.

     call plug#end()

"below is for Haba asciidoctor
    let g:asciidoctor_executable = 'asciidoctor'
    "let g:asciidoctor_extensions = ['asciidoctor-diagram', 'asciidoctor-rouge']
    let g:asciidoctor_pdf_executable = 'asciidoctor-pdf'
    "let g:asciidoctor_pdf_extensions = ['asciidoctor-diagram']
    let g:asciidoctor_pandoc_executable = 'pandoc'
    let g:asciidoctor_pandoc_data_dir = '~/Documents/.pandoc'
    "let g:asciidoctor_pandoc_other_params = '--toc'
    let g:asciidoctor_syntax_conceal = 1
    let g:asciidoctor_syntax_indented = 1
    let g:assciidoctor_fenced_languages = ['python', 'c' ]

    function! AsciidoctorMappings() 
        nnoremap <buffer> <leader>oo :AsciidoctorOpenRaw<CR>
        nnoremap <buffer> <leader>op :AsciidoctorOpenPDF<CR>
        nnoremap <buffer> <leader>oh :AsciidoctorOpenHTML<CR>
        nnoremap <buffer> <leader>ox :AsciidoctorOpenDOCX<CR>
        nnoremap <buffer> <leader>ch :Asciidoctor2HTML<CR>
        nnoremap <buffer> <leader>cp :Asciidoctor2PDF<CR>
        nnoremap <buffer> <leader>cx :Asciidoctor2DOCX<CR>
        nnoremap <buffer> <leader>p :AsciidoctorPasteImage<CR>
        ":make will build PDF's
        compiler asciidoctor-pdf
    endfunction
    "Call AsciidoctorMappings for all adoc type files. 
    augroup asciidoctor
        autocmd! 
        autocmd BufEnter *.adoc,*.asciidoc call AsciidoctorMappings()
    augroup END
KingJulianS commented 2 years ago

I went on and tested anyway, since I saw that at least it set filetype to asciidoctor now (after space was removed) in the auto command.

habamax commented 2 years ago

Either install asciidoctor-diagram ruby gem or remove it from settings

KingJulianS commented 2 years ago

Ahhh , great, thanks it worked. Still getting the compiler not supported error.

However, I also now managed to create a DOCX with cx, and it opened in LibreOffice with xo.

I think I can live with it as is.

Thanks a mill, Habamax