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

Proposal: Alternate Julia comment syntax #161

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

Conversation

manuelbb-upb
Copy link
Contributor

Hi,
as always, thanks for the great work!

This is just a proposal for an alternative syntax for julia comments in code blocks.
The usual style is ## comment and this will render as # comment.

However, ## is one of the code cell delimiters in VSCode (which are not user configurable).
Thus, the usual syntax can hinder a code cell oriented workflow.

I implemented #~, added docs and some tests.

  • Of course, ~ is up for debate, but it seems to be present on most keyboard layouts and does not clash with comments in code blocks using other languages.
  • By the replacement rules I placed in "src/Literate.jl", comments like #~Comment are allowed and render as #Comment.
    The usual ## requires a blank space. What is the rationale behind this?

@manuelbb-upb
Copy link
Contributor Author

Shortly after I had opened this pull request, there was a change in the vscode extension:
julia-vscode/julia-vscode#2567
Cell delimiters can be configured now.
For example, I disabled the ## delimiter, and in my Literate files I now use #%%#src as my clunky delimiter.

@fredrikekre
Copy link
Owner

Okay, nice. So this PR isn't needed? Perhaps it can be added to the tips and tricks section in the manual?

@manuelbb-upb
Copy link
Contributor Author

At least I am not as desperate for this functionality as i was 3 years ago 😁

I still think having a configurable comment pattern in Literate.jl would be cool to have, but realistically I won't find time to update this proposal anytime soon.
Maybe we can convert this to a draft, so as to not forget about it?
But closing is fine with me too.

A note for the vscode configuration in the manual would certainly be nice :)
I'll try to open a separate pull request in the coming days.

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

Successfully merging this pull request may close these issues.

2 participants