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

How do I turn on line wrapping in Google Colab? #6274

Closed
NightMachinery opened this issue Jan 17, 2022 · 3 comments
Closed

How do I turn on line wrapping in Google Colab? #6274

NightMachinery opened this issue Jan 17, 2022 · 3 comments
Milestone

Comments

@NightMachinery
Copy link

I have tried the solutions proposed at #106, including:

from notebook.services.config import ConfigManager
c = ConfigManager()
c.update('notebook', {"CodeCell": {"cm_config": {"lineWrapping": True}}})

Running this in the browser console of the Colab tab:

Jupyter.notebook.get_selected_cell().class_config.set('cm_config',{'lineWrapping':true})

(Which fails, as there is no Jupyter or IPython object.)


from IPython.display import HTML, display

def set_css():
  display(HTML('''
  <style>
    pre {
        white-space: pre-wrap;
    }
  </style>
  '''))
get_ipython().events.register('pre_run_cell', set_css)

This seems to be for the output cells, and it indeed works for them. But I want both the output and the cells to be wrapped. This solution also seems pretty inefficient?

@NightMachinery
Copy link
Author

BTW, I also like to wrap the text in the documentation popups.

@JasonWeill
Copy link
Collaborator

This repository may not be monitored by Google Colab developers. Especially if your issue is specific to Colab, consider opening one at https://github.com/googlecolab/colabtools/issues .

@jtpio
Copy link
Member

jtpio commented Jun 9, 2023

Closing as per #6274 (comment)

@jtpio jtpio closed this as completed Jun 9, 2023
@jtpio jtpio added this to the Reference milestone Jun 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants