Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Include html and liquid grammars #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

burodepeper
Copy link

@burodepeper burodepeper commented May 20, 2016

See #145 for a discussion on this issue. The discussion focuses on liquid, but I noticed that html was missing so I included that too.

I've used the same approach as I have for language-markdown. I haven't found a convenient way to write specs for included grammars, but I think it's acceptable to defer this to the corresponding packages themselves.

@fusion809
Copy link

fusion809 commented May 20, 2016

@burodepeper Ah, it ain't working. I just cloned this repo, applied your patch (which I downloaded from https://github.com/atom/language-gfm/pull/154.patch) and rank apm link language-gfm from its parent directory and reloaded Atom with Ctrl+Alt+R. Then I restarted Atom just to make sure and still I'm seeing this...
screenshot from 2016-05-20 21-29-57

Guessing this is to be fixed by the language-liquid fixes being made?

@burodepeper
Copy link
Author

Could you paste that sample code directly so I can test it locally? I took some samples from liquidmarkup.org and had no issues.

@fusion809
Copy link

fusion809 commented May 20, 2016

Just answered my own question and tried out the latest language-liquid adjustments you's have made and got this:

screenshot from 2016-05-20 21-34-41

So it's all working!

@burodepeper
Copy link
Author

Haha, so it works ; )

@50Wliu
Copy link
Contributor

50Wliu commented May 23, 2016

This is currently blocked on atom/language-todo#43 (comment). We're not sure yet whether we want to accept PRs that add support for languages not under the Atom organization.

@fusion809
Copy link

Well Liquid is the templating engine used by GitHub's official SSG, Jekyll, so I must admit I'm surprised that the Atom organization has not created their own Liquid package.

@burodepeper
Copy link
Author

@50Wliu Understandable, yet still a bummer. (slightly off-topic) I'm not sure what the best place would be to add the following comment (which indirectly relates to the issue you linked to), but I'm always rather reluctant to submit PRs for core packages because they don't get as much "love" as you'd want them to get. I do of course understand the added workload for the Atom devs, and I mean nothing but respect. I would like to see a subset of the core packages (in particular the stand-alonish ones, such as the languages and themes) to be updated outside of the regular update cycle.

(more on-topic) Another way to possibly work around this would be to have the liquid grammar inject itself into other grammars, in the same way that language-todo works. I don't know if this is possible however, because files ending in .css.liquid won't be picked up language-css for the same blocking issue mentioned above. @puranjayjain: any ideas on this?

@fusion809
Copy link

fusion809 commented May 23, 2016

@burodepeper I have an idea. How about we (not even sure if I should say "we" as I'm light on programming skills besides in shell script) create a new package called language-gfm-liquid (or w/e, the name isn't important to me) that provides syntax highlighting for Markdown, Liquid and HTML, essentially a love-child of the language-liquid and language-gfm packages, with this pull injected in. It wouldn't necessary pass its embedded (in Markdown files) Liquid and HTML code onto another package, but would rather render it itself. So it would have the grammars of language-liquid inserted into it. If this is what you meant in your last comment, sorry, wasn't sure if it was.

@50Wliu
Copy link
Contributor

50Wliu commented May 23, 2016

Another way to possibly work around this would be to have the liquid grammar inject itself into other grammars, in the same way that language-todo works.

I would love for this to happen.

@puranjayjain
Copy link

puranjayjain commented May 24, 2016

Another way to possibly work around this would be to have the liquid grammar inject itself into other grammars, in the same way that language-todo works.

@burodepeper @50Wliu I would want something like that to happen (documented too) since many of the languages depend on each other like the most common html with inline css, js.

Another scenario that comes in my mind is that of a template-based languages which add on top of another language, in those cases they must inherit the parent language (or languages) and add on top of it.

I would want both of this to be documented to ease the development of language packages as such

Now on topic I think the both the approach would do wonders to our .css.liquid files. There must be a way to do something like this (abstract code). Similar to @burodepeper 's approach in language-markdown

some-pattern: {
inherit: language-css
}

So that part of the code can enjoy language-css and autocomplete along with their tokenisation yet being a part of language liquid

@fusion809
Copy link

Well if anyone wants a quick solution, before these pull issues are resolved see my new fork of this package language-gfm2. I have even incorporated this package and language-liquid in the Atom package my atom-installer (a cross-distribution Atom installer for Linux written in Shell script) builds and installs.

@mime0n
Copy link

mime0n commented Sep 24, 2017

Hello. I'm a beginner and really don't understand how to install language-liquid into Atom. In Atom I have language-gfm already installed but I see no package called language-liquid. How would I go about getting language-liquid working in Atom?

I tried following the instruction at the top from fusion809 #154 (comment) but I have no idea how to apply patches. Totally lost.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants