files.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. .. _file-copy-path:
  61. Right-click on a file or directory and select "Copy Path" to copy the
  62. filesystem relative path. This can be used for passing arguments to open
  63. files in functions called in various kernels.
  64. Creating Files and Activities
  65. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66. .. _file-create-plus:
  67. Create new files or activities by clicking the ``+`` button at the top
  68. of the file browser. This will open a new Launcher tab in the main work area,
  69. which enables you to pick an activity and kernel:
  70. .. raw:: html
  71. <div class="jp-youtube-video">
  72. <iframe src="https://www.youtube-nocookie.com/embed/QL0IxDAOEc0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  73. </div>
  74. .. _file-create-menu:
  75. You can also create new documents or activities using the File menu:
  76. .. image:: images/file_create_text_file.png
  77. :align: center
  78. :class: jp-screenshot
  79. .. _current-directory:
  80. The current working directory of a new activity or document will be the
  81. directory listed in the file browser (except for a terminal, which
  82. always starts in the root directory of the file browser):
  83. .. raw:: html
  84. <div class="jp-youtube-video">
  85. <iframe src="https://www.youtube-nocookie.com/embed/OfISSOTiGTY?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  86. </div>
  87. .. _file-rename:
  88. A new file is created with a default name. Rename a file by
  89. right-clicking on its name in the file browser and selecting “Rename”
  90. from the context menu:
  91. .. raw:: html
  92. <div class="jp-youtube-video">
  93. <iframe src="https://www.youtube-nocookie.com/embed/y3xzXelypjs?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  94. </div>
  95. Uploading and Downloading
  96. ~~~~~~~~~~~~~~~~~~~~~~~~~
  97. .. _file-upload:
  98. Files can be uploaded to the current directory of the file browser by
  99. dragging and dropping files onto the file browser, or by clicking the
  100. "Upload Files" button at the top of the file browser:
  101. .. raw:: html
  102. <div class="jp-youtube-video">
  103. <iframe src="https://www.youtube-nocookie.com/embed/1bd2QHqQSH4?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  104. </div>
  105. .. _file-download:
  106. Any file in JupyterLab can be downloaded by right-clicking its name in
  107. the file browser and selecting “Download” from the context menu:
  108. .. raw:: html
  109. <div class="jp-youtube-video">
  110. <iframe src="https://www.youtube-nocookie.com/embed/Wl7Ozl6rMcc?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  111. </div>