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

Change #' to simply # and require ## for julia comments #3

Closed
fredrikekre opened this issue May 2, 2018 · 8 comments
Closed

Change #' to simply # and require ## for julia comments #3

fredrikekre opened this issue May 2, 2018 · 8 comments

Comments

@fredrikekre
Copy link
Owner

As discussed in https://discourse.julialang.org/t/ann-literate-jl/10651/9, using #' could be annoying, and julia comments are probably not as frequent as markdown input.

@Datseris
Copy link
Contributor

Datseris commented May 2, 2018

Sounds like a good plan!

@KristofferC
Copy link
Collaborator

Agree that #' is a bit annoying. I think the # and ## would probably work well.

@piever
Copy link

piever commented May 2, 2018

I also think it'd be better! Writing markdown spanning multiple lines is probably much more common in these kind of files and it's good to be able to use the editor shortcut for that.

@aalexandersson
Copy link

The user-written Stata command markstat uses the simple "one tab or four spaces" rule to distinguish Stata and Markdown which works well. Stata code blocks are defined similar to Github code blocks like this

```s
  // Stata code goes here
```

I prefer a similar solution where I would not have to type a character such as # to get Markdown in Julia. Perhaps like the Stata approach above but with j or instead of s as an optional language identifier for Julia.

Caveat (in case it is not obvious): I do not know Julia at all, just starting to learn as prep for Julia 1.0.

@tshort
Copy link

tshort commented May 2, 2018

How about including the multi-line comment field, too? It'd be even easier to include/format markdown there.

#=
# heading

Some *text*...
=#

Another option is to include something in the leading indicator like #=md.

@fredrikekre
Copy link
Owner Author

How about including the multi-line comment field, too?

I am not a big fan of multiline comments personally, It breaks syntax highlighting in some editors, complicates the quite minimal current syntax, and makes parsing of the source file more complicated. I think going with #4 is good enough, which should make it much simpler to comment-toggle the markdown lines, if you prefer to edit them without the leading # , and then toggle back.

@JeffreySarnoff
Copy link

Multiline comments provided limited literacy before it was fashionable. I still use them when, six months hence, l need to remember a subtle something.
Would there be a way to adapt Julia's block delimiters and use ##= .. #=# without requiring mensurable effort.

Either way, I am appreciative of the work. Maybe now, I can provide the sort of microtutorial others will utilize. Thank you.

@waldyrious
Copy link
Contributor

Related to @aalexandersson's point above, and just for reference (I'm not convinced this would be preferable to # v.s ##), back in 2013 I filled jashkenas/docco#216, which suggests omitting the space after the comment marker to distinguish intentional documentation from (temporarily?) commented-out code. Thought I'd mention that option here, for completeness.

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

8 participants