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

What's the best start of cell marker for Python and Julia scripts? #57

Closed
mwouts opened this issue Sep 5, 2018 · 5 comments · Fixed by #60
Closed

What's the best start of cell marker for Python and Julia scripts? #57

mwouts opened this issue Sep 5, 2018 · 5 comments · Fixed by #60

Comments

@mwouts
Copy link
Owner

mwouts commented Sep 5, 2018

We're currently using # + {} as start of cell marker. But possibly # + (when not following a commented line) would be just enough. And also, Hydrogen seems to use # %%name of cell. Can we design a common, simple and clear pattern?

@grst
Copy link
Contributor

grst commented Sep 5, 2018

maybe stick to hydrogen
-> one standard less and hydrogen is pretty established.

Would hydrogen blow up when adding metadata like this?

# %%name-of-cell {metadata}

@kylebarron
Copy link

That would be fine. Once Hydrogen sees ${comment symbol} %% it treats that line as the start of a block.

Source:
https://github.com/nteract/hydrogen/blob/58ba87e1747366c46f9baca87dcdda27401f6a5a/lib/code-manager.js#L138

@mwouts
Copy link
Owner Author

mwouts commented Sep 6, 2018

Sure! Yet,

For now I would be in favor of

  • preserving the current 'plain python' format for Jupytext's python scripts, and simplify # + {} to # + for explicit code cells with no metadata
  • implementing a 'hydrogen script' format (R, Julia, Python) in Jupytext when specifications for markdown cells (and cell metadata) are chosen. The Hydrogen format must remain easy to parse (simply split on cell markers), as an additional JavaScript parser will have to be implemented in Atom.

@mwouts
Copy link
Owner Author

mwouts commented Sep 6, 2018

I've found more python scripts with cells defined with #%%! VS code has a plugin that uses that convention. It's also used by Spyder. No sign of markdown cells yet, though.

@mwouts
Copy link
Owner Author

mwouts commented Sep 6, 2018

I'll work on an Hydrogen/VS code/Spyder compatible format at #59 (see there for possible specifications of the format). With this issue I'll just simplify # + {} into the lighter # + when possible.

@mwouts mwouts mentioned this issue Sep 7, 2018
@mwouts mwouts closed this as completed in #60 Sep 7, 2018
mwouts added a commit that referenced this issue Sep 7, 2018
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 a pull request may close this issue.

3 participants