atom-dbt
atom-dbt copied to clipboard
Markdown Preview doesn't work with atom-dbt
The package seems to break the Markdown Preview feature. It doesn't work (eg. using the keyboard shortcut of going to Packages -> Markdown Preview -> Toggle Preview) when the Markdown file is detected as Markdown (Jinja Templates) within the Atom project, but it will if manually switched back to regular Markdown.
I'm using (in case it's environment specific): Atom: 1.34.0 x64 Electron: 2.0.16 OS: Mac OS X 10.14.3
Hey @MartinGuindon!
Thanks for the issue :)
So I think this is expected behaviour – as @tconbeer pointed out, this package sets .md files to use the (source.gfm.jinja) language as their default here
That's definitely the desired behaviour for me – I mainly work with Markdown in dbt, so want my Markdown files to always be Jinja-flavored, so I'm unwilling to change that.
I think there's two options here then:
- Change the default on your Atom installation to use non-jinja-flavoured (
source.gfm) markdown formdfiles. To do this, go to yourconfig.csonfile (cmd + shft + pand then type inconfig, and chooseApplication: Open Your Config), and add this to it:
"*":
core:
customFileTypes:
"source.gfm": [
"md"
]
OR (my preferred approach)
2. Change your markdown-preview package to include jinja-flavoured-markdown. Again, go to your config.cson file, and add:
"*":
"markdown-preview":
grammars: [
"source.gfm",
"source.litcoffee",
"text.html.basic",
"text.md",
"text.plain",
"text.plain.null-grammar",
"source.gfm.jinja"
]
Solution 2 works great. Thanks, @clrcrl !
Changed my mind – going to keep this open. There's probably a better way to handle this in the package to be honest, but I don't expect to look into this for quite some time!