files.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. .. _working-with-files:
  2. Working with Files
  3. ------------------
  4. Opening Files
  5. ~~~~~~~~~~~~~
  6. The file browser and File menu enable you to work with files and
  7. directories on your system. This includes opening, creating, deleting,
  8. renaming, downloading, copying, and sharing files and directories.
  9. The file browser is in the left sidebar Files tab:
  10. .. image:: images/file_menu_left.png
  11. :align: center
  12. :class: jp-screenshot
  13. Many actions on files can also be carried out in the File menu:
  14. .. image:: images/file_menu_top.png
  15. :align: center
  16. :class: jp-screenshot
  17. .. _open-file:
  18. To open any file, double-click on its name in the file browser:
  19. .. raw:: html
  20. <div class="jp-youtube-video">
  21. <iframe src="https://www.youtube-nocookie.com/embed/Rh-vwjTwBTI?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  22. </div>
  23. .. _newtab:
  24. You can also drag a file into the main work area to create a new tab:
  25. .. raw:: html
  26. <div class="jp-youtube-video">
  27. <iframe src="https://www.youtube-nocookie.com/embed/uwMmHeDmRxk?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  28. </div>
  29. .. _multiple-viewers:
  30. Many files types have :ref:`multiple viewers/editors <file-and-output-formats>`.
  31. For example, you can open a Markdown file in a :ref:`text editor <file-editor>` or as rendered HTML.
  32. A JupyterLab extension can also add new viewers/editors for files.
  33. To open a file in a non-default viewer/editor, right-click on its name in the
  34. file browser and use the "Open With..." submenu to select the viewer/editor:
  35. .. raw:: html
  36. <div class="jp-youtube-video">
  37. <iframe src="https://www.youtube-nocookie.com/embed/1kEgUqAeYo0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  38. </div>
  39. .. _single-doc-sync:
  40. A single file can be open simultaneously in multiple viewer/editors and
  41. they will remain in sync:
  42. .. raw:: html
  43. <div class="jp-youtube-video">
  44. <iframe src="https://www.youtube-nocookie.com/embed/87ALbxm1Y3I?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  45. </div>
  46. .. _file-navigation:
  47. The file system can be navigated by double-clicking on folders in the
  48. listing or clicking on the folders at the top of the directory listing:
  49. .. raw:: html
  50. <div class="jp-youtube-video">
  51. <iframe src="https://www.youtube-nocookie.com/embed/2OHwJzjG-l4?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  52. </div>
  53. .. _file-share:
  54. Right-click on a file or directory and select "Copy Shareable Link" to
  55. copy a URL that can be used to open JupyterLab with that file or
  56. directory open.
  57. .. image:: images/shareable_link.png
  58. :align: center
  59. :class: jp-screenshot
  60. Creating Files and Activities
  61. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62. .. _file-create-plus:
  63. Create new files or activities by clicking the ``+`` button at the top
  64. of the file browser. This will open a new Launcher tab in the main work area,
  65. which enables you to pick an activity and kernel:
  66. .. raw:: html
  67. <div class="jp-youtube-video">
  68. <iframe src="https://www.youtube-nocookie.com/embed/QL0IxDAOEc0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  69. </div>
  70. .. _file-create-menu:
  71. You can also create new documents or activities using the File menu:
  72. .. image:: images/file_create_text_file.png
  73. :align: center
  74. :class: jp-screenshot
  75. .. _current-directory:
  76. The current working directory of a new activity or document will be the
  77. directory listed in the file browser (except for a terminal, which
  78. always starts in the root directory of the file browser):
  79. .. raw:: html
  80. <div class="jp-youtube-video">
  81. <iframe src="https://www.youtube-nocookie.com/embed/OfISSOTiGTY?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  82. </div>
  83. .. _file-rename:
  84. A new file is created with a default name. Rename a file by
  85. right-clicking on its name in the file browser and selecting “Rename”
  86. from the context menu:
  87. .. raw:: html
  88. <div class="jp-youtube-video">
  89. <iframe src="https://www.youtube-nocookie.com/embed/y3xzXelypjs?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  90. </div>
  91. Uploading and Downloading
  92. ~~~~~~~~~~~~~~~~~~~~~~~~~
  93. .. _file-upload:
  94. Files can be uploaded to the current directory of the file browser by
  95. dragging and dropping files onto the file browser, or by clicking the
  96. "Upload Files" button at the top of the file browser:
  97. .. raw:: html
  98. <div class="jp-youtube-video">
  99. <iframe src="https://www.youtube-nocookie.com/embed/1bd2QHqQSH4?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  100. </div>
  101. .. _file-download:
  102. Any file in JupyterLab can be downloaded by right-clicking its name in
  103. the file browser and selecting “Download” from the context menu:
  104. .. raw:: html
  105. <div class="jp-youtube-video">
  106. <iframe src="https://www.youtube-nocookie.com/embed/Wl7Ozl6rMcc?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  107. </div>