Skip to content
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

pure julia mode markdown comment highlighting #1

Open
gabrielgellner opened this issue Jun 17, 2016 · 6 comments
Open

pure julia mode markdown comment highlighting #1

gabrielgellner opened this issue Jun 17, 2016 · 6 comments

Comments

@gabrielgellner
Copy link

Is it feasible to add support for the pure Julia form so that the markdown is highlighted nicely using the #' syntax in a .jl file?

@mpastell
Copy link
Collaborator

I'm not sure how it could be done. Let me know if you know of an Atom-package that does something similar and I can look into the code.

@gabrielgellner
Copy link
Author

Could it be similar to how Markdown uses code fences to change the highlighting grammar? You would do some kind of match on the starts with #' and then change the grammar to markdown?
Maybe a region is needed .. in which case would it then be maybe possible to do a match on something like #=' so it would kind of work like inverse Weave mode ... you would do fences for the markdown documentation, with the default mode being julia.

I say this just because I like to have my scripts be valid julia so I don't need to weave at computers without latex/pandoc ... but maybe this is beyond the scope of this package.

A similar issue is:
zargony/atom-language-rust#36

which argues for looking at how html code highlights css and javascript.

Though I really have not idea how atom does its highlighting! Thanks for even considering it!

@mpastell
Copy link
Collaborator

mpastell commented Jul 7, 2016

Sorry for the delay in my reply.

The problem is that if you change grammar of comment lines to markdown they all get highlighted as markdown headers (they start with #).

Anyway I will keep this in mind if I find some free time.

@gabrielgellner
Copy link
Author

That makes sense. I have moved to using #== , ==# blocks to enclose markdown. I have been trying to figure out how to change the grammar to just do the embedded highlighting for blocks of that form.

@tpoisot
Copy link
Contributor

tpoisot commented Apr 13, 2018

I'd like to revive this issue -- right now, I am writing the package of a manual using the #' syntax and it's OK, but not ideal because a lot of formatting is lost.
I was not aware of #== -- is it rendered as markdown when calling weave?
I'd be happy to work on a PR for this.

@mpastell
Copy link
Collaborator

It is currently not rendered as markdown, it would be great if you can contribute a PR. You just need to implement a new reader for the format and come up with a syntax for chunk options

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

No branches or pull requests

3 participants