neorg icon indicating copy to clipboard operation
neorg copied to clipboard

Neorg tangling does not want to work with custom filetypes.

Open n-shift opened this issue 3 years ago • 5 comments

File:

@document.meta
tangle: ./foo.bar
@end

@code bar
test
@end

Running :Neorg tangle current-file: Nothing to tangle! When directly specifying the file with #tangle tag tangling works. The filetype is defined in filetype.lua

n-shift avatar Jul 08 '22 19:07 n-shift

@vhyrro

n-shift avatar Jul 08 '22 19:07 n-shift

I guess that because the extension isn't recognized

max397574 avatar Jul 08 '22 20:07 max397574

Screenshot 2022-07-08 at 22 59 36 i guess you could use this

max397574 avatar Jul 08 '22 20:07 max397574

I also have this problem, even copying the exact same examples given in the tangle tutorial.

A more explicit example of a script that says "Nothing to tangle":

@document.meta
title: tangletest
authors: egolep
tangle: {
    languages: {
        lua: ./test-lua-output.lua
        python: ./test-python-output.py 
        julia: ./test-julia-output.jl
        rust: ./test-rust-output.rs
    }
    scope: all
}
@end

@code lua
print("Hello")
@end

@code lua
print("Sup")
@end

@code python
print("Ayo")
@end

@code julia
println("What")
@end

@code rust
println!("Hey")
@end

egolep avatar Jul 13 '22 21:07 egolep

I used your example (@shift-d) and I didn't have any problems. Is the issue relevant?

I've added new filetype:

" ~/.config/nvim/ftdetect/bar.vim 
autocmd BufNewFile,BufRead *.bar set filetype=bar

And run tangle. I got the expected result (foo.bar):

test

danilshvalov avatar Aug 21 '22 00:08 danilshvalov

I'm running into this as well:

@document.meta
tangle: ./test-vifmrc
@end

* This is a test, should export the below to a new file

  @code vifm
  test
  @end

I did define a ~/.config/nvim/ftdetect/vifm.vim file as so

✦ ➜ cat /home/vendion/.config/nvim/ftdetect/vifm.vim
autocmd BufNewFile,BufRead *.vifm set filetype=vifm

But when I try to tangle the file, I get “Nothing to tangle!”

Doing the following worked for me, but seems like a hack

@document.meta
tangle: {
    languages: {
      vifm: ./test
    }
    scope: all
}
@end

* This is a test, should export the below to a new file

  @code vifm
  test
  @end

vendion avatar Mar 24 '23 17:03 vendion