-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple language mappings? #684
Comments
I think the language mappings suggested in https://github.com/mpastell/language-weave are meant for a very old version of Hydrogen. If I understand correctly, the grammar name is "weave.jl markdown" and the kernel name is "julia". If so, the correct language mapppings are these: { "weave.jl markdown": "julia", "pweave markdown": "python" } If this doesn't work, please, could you post the error message? |
@n-riesco I think the language mappings from weave are correct. For the specific case of weave, instead of using a language mapping the best way would be if they could integrate with our new multi language feature (which should be very easy). |
Oh! I keep confusing that the @lgeiger I think a solution to this issue would be to replace these lines with if (mappedLanguage) {
return mappedLanguage === language || kernelLanguage.toLowerCase() === language;
} In this way, Hydrogen would still consider the julia kernel for julia files despite the @maximsch2 Alternatively, you could create a custom kernel spec by adding something like this to the {
"kernelspecs": {
"weave.jl markdown": {
"spec": {
"argv": [
"julia",
"-i",
"-F",
"/home/user/.julia/v0.5/IJulia/src/kernel.jl",
"{connection_file}"
],
"display_name": "Weave.jl markdown",
"language": "weave.jl markdown"
}
}
}
} |
That's probably part of the solution. I think we also need to change our
That's a valid workaround, though I wouldn't recommend editing the kernelspecs setting as a long term solution since this will likely fail if the julia kernel is updated to a new version. |
Yes, it makes a lot of sense. |
@maximsch2 Would you be interested in implementing multi language support for weave as a first class citizen in Hydrogen? As an example here's what we did to support the |
@lgeiger I have a version that seems to be working, let me make a PR. Thanks for a pointer! |
This will store running kernels by the language from their kernel spec. It also makes sure that all names are normalized to lower case to avoid confusion. Fixes nteract#684
This will store running kernels by the language from their kernel spec. It also makes sure that all names are normalized to lower case to avoid confusion. Fixes #684
I'm using Hydrogen to execute code in Julia files and also wanted to try out Weave.jl. It has it's own Atom language file that suggests using language mappings to get Hydrogen to execute the code: https://github.com/mpastell/language-weave
The issue is, if I set up custom mapping to enable Julia code execution in "weave.jl markdown" files, then I lose that ability in regular "julia" files. It would be great if language mappings would allow to either specify a list of types for the mapping or just the mapping was reversed.
The text was updated successfully, but these errors were encountered: