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

Support cell Scope Type in Plaintext Notebooks #1980

Open
C-Loftus opened this issue Oct 27, 2023 · 1 comment
Open

Support cell Scope Type in Plaintext Notebooks #1980

C-Loftus opened this issue Oct 27, 2023 · 1 comment
Labels
lang-python Issues related to Python programming language support

Comments

@C-Loftus
Copy link
Contributor

Plaintext Notebooks along the lines of https://github.com/mwouts/jupytext are a good choice for voice coding instead of the specialized editors like the VSCode Jupyter Extension. It is easier to move cells around and manipulate text given the fact that they are all part of the same file (whereas in the extension each cell is its own pseudo file)

Currently the cell scope type does not support these sorts of plaintext notebooks where each cell is created with the characters # %%
We would also need to support # %% [markdown] to declare a markdown block.
According to the behavior of the vscode implementation, a cell is defined as having exactly one leading # then at least two % symbols on the same line, directly after, not including whitespace. There can be any number of spaces between these declaraction characters and any character after the last %

Examples of valid cells (each of these will create a new cell and cause the visual studio code extension to label it as such)

    # %%

    # %% test

    # %%%%% test2

    # %%%

    #           %%%%%

    # %% [markdown]

Example of Invalid Cells

    ##%%

    #### %%

    # test # %%

    ### %%% test

An example of using it can be found below
image
More documentation can be found here: https://code.visualstudio.com/docs/python/jupyter-support-py

@C-Loftus C-Loftus changed the title Support cell Scope Type in Support Plaintext Notebooks Support cell Scope Type in Plaintext Notebooks Oct 27, 2023
@auscompgeek auscompgeek added the lang-python Issues related to Python programming language support label Oct 28, 2023
@C-Loftus
Copy link
Contributor Author

C-Loftus commented Nov 1, 2023

just wanted to note as well that the discussion on quarto here #880 might be of relevance. it appears that certain plaintext notebooks use the markdown code cells syntax as well instead so what is considered a cell might have to be parsed slightly differently depending on the type of plaintext notebook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-python Issues related to Python programming language support
Projects
None yet
Development

No branches or pull requests

2 participants