Skip to content

Commit 00d6356

Browse files
committed
trim Quick Source tut sections
1 parent e59f321 commit 00d6356

9 files changed

Lines changed: 36 additions & 70 deletions

File tree

112 Bytes
Loading
82.7 KB
Loading

microsoft-edge/devtools-guide-chromium/quick-source/quick-source-tool.md

Lines changed: 28 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -30,56 +30,25 @@ If you open or close a file in one tool, the file is opened or closed in the oth
3030

3131

3232
<!-- ====================================================================== -->
33-
## Open a file in the Quick source tool
34-
35-
<!-- todo: run & show localhost in addr bar instead of github.io -->
36-
37-
To view source files while using a tool than the **Sources** tool in the **Activity Bar**, use the **Quick source** tool, as follows:
38-
39-
1. Open a webpage; for example, open [Demo To Do](https://microsoftedge.github.io/Demos/demo-to-do/) in a new window or page.<!-- todo: localhost -->
40-
41-
1. Right-click the webpage and then select **Inspect**.
42-
43-
DevTools opens.
44-
45-
1. In the **Activity Bar** at the top of DevTools, select the **Sources** (![The Sources tool icon](./quick-source-tool-images/sources-icon.png)) tool.
46-
47-
1. In the **Sources** (![The Sources tool icon](./quick-source-tool-images/sources-icon.png)) tool, in the **Page** tab, select one or more files, such as `to-do.js`.
48-
49-
The tabs for the selected files are opened in the **Sources** tool:
50-
51-
![The Sources tool > Page tab with a file selected](./quick-source-tool-images/sources-tool-page-tab-file-selected.png)
52-
53-
1. In the **Activity Bar** at the top of DevTools, select a tool other than **Sources**, such as **Elements** (![Elements icon](./quick-source-tool-images/elements-tool-icon.png)).
54-
55-
1. If the **Quick View** toolbar isn't shown at the bottom of DevTools, press **Esc**.
56-
57-
1. In the **Quick View** toolbar at the bottom of DevTools, click the **More tools** button, and then select **Quick source**.
58-
59-
The **Quick source** tool expands in **Quick View** at the bottom of DevTools, and displays the same files that are open in the **Sources** tool:
60-
61-
![A file displayed in the Quick source tool](./quick-source-tool-images/file-displayed-in-quick-source.png)<!-- todo: simpler display -->
62-
63-
You can now view or edit the file in the **Quick source** tool, at the same time as displaying a different tool in the main part of DevTools.
33+
## Edit local source files in DevTools by selecting a Workspace folder
6434

65-
See also:
66-
* [Using the Page tab to explore resources that construct the current webpage](../sources/index.md#using-the-page-tab-to-explore-resources-that-construct-the-current-webpage) in _Sources tool overview_.
35+
This is an end-to-end tutorial of all steps to demonstrate the **Quick source** tool, by using the ToDo web app in the **MicrosoftEdge / Demos** repo.
6736

37+
By selecting a local folder as a **Workspace** in the **Sources** tool, you can then edit files from within the **Quick source** tool at the same time as displaying a different tool, and have those edits be saved to your local drive. This way, you can edit files in the **Quick source** tool while using another tool, such as **Elements** or **Network**, and have your edits be saved to the corresponding source file on your local drive.
6838

69-
<!-- ====================================================================== -->
70-
## Edit local source files in DevTools by selecting a Workspace folder
39+
To edit source files in the **Quick source** tool, you'll do the following:
7140

72-
By selecting a local folder as a **Workspace** in the **Sources** tool, you can then edit files from within the **Quick source** tool at the same time as displaying a different tool, and have those edits be saved to your local drive. This way, you can edit files in the **Quick source** tool while using another tool, such as **Elements** or **Network**, and have your edits be saved to the corresponding source file on your local drive.
41+
1. Have access to the webpage source files locally, such as a cloned repo.
7342

74-
To edit source files in the **Quick source** tool:
43+
1. In the **Workspace** tab in the **Sources** (![The Sources tool icon](./quick-source-tool-images/sources-icon.png)) tool, add a local folder of source files.
7544

76-
1. Have access to your source files locally, such as a cloned repo. See [Have local source files, such as a cloned repo](#have-local-source-files-such-as-a-cloned-repo), below.
45+
1. In the **Workspace** tab, open a file, such as a `.js` file.
7746

78-
1. In the **Workspace** tab in the **Sources** (![The Sources tool icon](./quick-source-tool-images/sources-icon.png)) tool, add a local folder of source files. See [Select a local folder of source files as the Workspace](#select-a-local-folder-of-source-files-as-the-workspace), below.
47+
1. In the **Activity Bar**, select a tool other than the **Sources** tool, such as the **Elements** tool.
7948

80-
1. In the **Activity Bar**, select a tool other than the **Sources** tool, such as the **Elements** tool. Then in the **Quick View** panel at the bottom of DevTools, open the **Quick source** tool. See [Open the Quick source tool](#open-the-quick-source-tool), below.
49+
1. In the **Quick View** panel at the bottom of DevTools, open the **Quick source** tool. The opened `.js` file is shown in a streamlined editor, and the **Elements** tool is still displayed.
8150

82-
These steps are detailed below.
51+
These steps are detailed in the tutorial below.
8352

8453

8554
<!-- ====================================================================== -->
@@ -113,7 +82,7 @@ For example, if not done already, clone the **MicrosoftEdge / Demos** repo to yo
11382

11483
```Shell
11584
# example location where the repo directory will be added:
116-
cd c:/users/localAccount/github/
85+
cd ~/GitHub
11786
git clone https://github.com/MicrosoftEdge/Demos.git
11887
```
11988

@@ -136,6 +105,19 @@ Continue with the next section.
136105

137106
If you use the git bash shell, it's a UNIX shell, so even on Windows, you need to wrap a directory path that has backslashes in quotes, or else use forward slashes rather than backslashes.
138107

108+
1. Create a working branch named "test" and switch to it (to avoid altering the demo's files in the "main" branch):
109+
110+
```Shell
111+
git checkout -b test
112+
```
113+
114+
That's equivalent to:
115+
116+
```Shell
117+
git branch test
118+
git switch test
119+
```
120+
139121
1. Run one of the following commands, to start the web server:
140122

141123
```bash
@@ -199,16 +181,6 @@ Continue with the next section.
199181

200182
![The Sources tool with a file selected](./quick-source-tool-images/sources-tool-with-file-selected.png)
201183

202-
1. In the **Activity Bar** at the top of DevTools, select a tool other than the **Sources** (![The Sources tool icon](./quick-source-tool-images/sources-icon.png)) tool, such as the **Elements** (![The Elements tool icon](./quick-source-tool-images/elements-tool-icon.png)) tool.
203-
204-
The **Quick source** tool expands in **Quick View** at the bottom of DevTools, and has a tab for each open file:
205-
206-
![A file displayed in the Quick source tool.](./quick-source-tool-images/file-displayed-in-quick-source-2.png)<!-- todo: localhost in addr bar -->
207-
208-
1. If there's no longer a green "mapped" dot on the HTML, JS, or CSS file, long-click or right-click the **Refresh** button in Microsoft Edge, and then select **Hard refresh** (**Ctrl+Shift+R**).
209-
210-
Continue with the next section.
211-
212184

213185
<!-- ====================================================================== -->
214186
## Open the Quick source tool and edit a file
@@ -223,7 +195,7 @@ Suppose you want to continue viewing the **Elements** tool, but you want to simu
223195

224196
The **Quick source** tool opens in **Quick View** at the bottom of DevTools:
225197

226-
![The Quick source tool, containing a Select folder link](./quick-source-tool-images/quick-source-select-folder.png)<!--todo:localhost-->
198+
![The Quick source tool, containing the opened .js file](./quick-source-tool-images/quick-source-with-js-file.png)
227199

228200
`todo.js` is displayed, because that file is open in the **Sources** tool.
229201

@@ -253,10 +225,12 @@ Suppose you want to continue viewing the **Elements** tool, but you want to simu
253225

254226
Now, when you edit the folder's files in DevTools, the edits are not only made to the transient file that's returned by the server, but are also saved to the source files on your local drive. You can edit the file from within the **Quick source** tool at the same time as displaying another tool (or from within the **Sources** tool).
255227

228+
This is the end of the tutorial steps.
229+
256230
See also:
257231
* [Add a local folder to the workspace, to use DevTools to edit files and save changes to disk](../sources/index.md#add-a-local-folder-to-the-workspace-to-use-devtools-to-edit-files-and-save-changes-to-disk) in _Sources tool overview_.
258232
* [Edit and save files in a workspace (Sources tool Workspace tab)](../workspaces/index.md)
259-
* [Step 4: Save a JavaScript change to disk](../workspaces/index.md#step-4-save-a-javascript-change-to-disk) in _Edit and save files in a workspace (Sources tool Workspace tab)_
233+
* [Step 6: Save a JavaScript change to disk](../workspaces/workspace-tutorial.md#step-6-save-a-javascript-change-to-disk) in _Workspace tutorial (Sources tool Workspace tab)_
260234

261235

262236
<!-- ====================================================================== -->

microsoft-edge/devtools-guide-chromium/sources/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ Use the **Sources** tool to view, modify, and debug front-end JavaScript code, a
4848
* [Transformations from source code to compiled front-end code](#transformations-from-source-code-to-compiled-front-end-code)
4949
* [Editing CSS](#editing-css)
5050
* [Editing CSS by using the Styles tab in the Elements tool, when using the Workspace tab of the Sources tool](#editing-css-by-using-the-styles-tab-in-the-elements-tool-when-using-the-workspace-tab-of-the-sources-tool)
51-
* [The Page tab or Workspace tab in the Sources tool](#the-page-tab-or-workspace-tab-in-the-sources-tool)
51+
* [Editing CSS in the Page tab or Workspace tab in the Sources tool](#editing-css-in-the-page-tab-or-workspace-tab-in-the-sources-tool)
5252
* [Editing an HTML file](#editing-an-html-file)
5353
* [Going to a line number or function](#going-to-a-line-number-or-function)
5454
* [Quick source tool, to display source files when using a different tool](#quick-source-tool-to-display-source-files-when-using-a-different-tool)
5555
* [Using the Debugger pane to debug JavaScript code](#using-the-debugger-pane-to-debug-javascript-code)
5656
* [The basic approach to using a debugger](#the-basic-approach-to-using-a-debugger)
57-
* [Advantages of the debugger's Watch and Scope over console.log](#advantages-of-the-debuggers-watch-and-scope-over-console.log)
57+
* [Advantages of the debugger's Watch and Scope over console.log](#advantages-of-the-debuggers-watch-and-scope-over-consolelog)
5858
* [Debug from Visual Studio Code directly](#debug-from-visual-studio-code-directly)
5959
* [Articles about debugging](#articles-about-debugging)
6060
* [See also](#see-also)
@@ -325,7 +325,7 @@ The following subsections cover the Editor pane:
325325
* [Reformatting a minified JavaScript file with pretty-print](#reformatting-a-minified-javascript-file-with-pretty-print)
326326
* [Mapping minified code to your source code to show readable code](#mapping-minified-code-to-your-source-code-to-show-readable-code)
327327
* [Transformations from source code to compiled front-end code](#transformations-from-source-code-to-compiled-front-end-code)
328-
* [Editing a CSS file](#editing-a-css-file)
328+
* [Editing CSS in the Page tab or Workspace tab in the Sources tool](#editing-css-in-the-page-tab-or-workspace-tab-in-the-sources-tool)
329329
* [Editing an HTML file](#editing-an-html-file)
330330
* [Going to a line number or function](#going-to-a-line-number-or-function)
331331
* [Quick source tool, to display source files when using a different tool](#quick-source-tool-to-display-source-files-when-using-a-different-tool)
@@ -449,7 +449,7 @@ See also:
449449

450450

451451
<!-- ---------- -->
452-
###### The Page tab or Workspace tab in the Sources tool
452+
###### Editing CSS in the Page tab or Workspace tab in the Sources tool
453453

454454
The **Page** or **Workspace** tab in the **Sources** tool supports directly editing a CSS file. For example, if you edit the CSS file from the tutorial [Edit and save files in a workspace (Sources tool Workspace tab)](../workspaces/index.md) to match the style rule below, the `H1` element in the upper left of the rendered webpage changes to green:
455455

microsoft-edge/devtools-guide-chromium/workspaces/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Use the **Workspace** tab in the **Sources** tool to display and edit the conten
3333
The typical way to set up a workspace is to set it up to display the source files of your website's frontend code. This way, you use DevTools both to inspect your website, and to make changes to its source files. This way, the changes that you make are saved on your computer, rather than lost when you refresh the page.
3434

3535
See also:
36-
* [Workspaces tutorial (Sources tool Workspace tab)](workspace-steps.md)
36+
* [Workspace tutorial (Sources tool Workspace tab)](./workspace-tutorial.md)
3737

3838

3939
<!-- ====================================================================== -->
@@ -143,7 +143,7 @@ The **Page** tab of the **Sources** tool doesn't allow you to save changes to th
143143

144144
The following steps demonstrate that edits in the **Elements** tool DOM tree aren't preserved across page refreshes:
145145

146-
1. Set up the Workspaces demo as described in [Workspaces tutorial (Sources tool Workspace tab)](./workspace-steps.md).
146+
1. Set up the Workspaces demo as described in [Workspace tutorial (Sources tool Workspace tab)](./workspace-tutorial.md).
147147

148148
1. In DevTools, select the **Elements** (`</>`) tool.
149149

@@ -211,7 +211,7 @@ See also:
211211
<!-- ====================================================================== -->
212212
## See also
213213

214-
* [Workspaces tutorial (Sources tool Workspace tab)](workspace-steps.md)
214+
* [Workspace tutorial (Sources tool Workspace tab)](./workspace-tutorial.md)
215215
* [Open a demo folder from the Workspace tab in the Sources tool](../../devtools-guide-chromium/sample-code/sample-code.md#open-a-demo-folder-from-the-workspace-tab-in-the-sources-tool) in _Sample code for DevTools_.
216216
* [Track changes to files using the Changes tool](../changes/changes-tool.md)
217217
* [Display or edit source files using the Quick source tool](../quick-source/quick-source-tool.md)

microsoft-edge/devtools-guide-chromium/workspaces/workspace-tutorial.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,7 @@ Clone the **MicrosoftEdge / Demos** repo to your local drive, including the `/wo
5555

5656
```Shell
5757
# Example location where the repo directory will be added:
58-
pwd
59-
# Result: /c/Users/localAccount
60-
mkdir github
61-
# Result: cannot create directory ‘github’: File exists
62-
cd github
63-
pwd
64-
# Result: /c/Users/localAccount/github
58+
cd ~/GitHub
6559
git clone https://github.com/MicrosoftEdge/Demos.git
6660
```
6761

@@ -89,8 +83,6 @@ Continue with the next section.
8983
pwd
9084
```
9185

92-
Modify `\localAccount\` or other parts of the path shown above, as needed. Example path: `"C:\Users\localAccount\GitHub\Demos\workspaces"`.
93-
9486
A directory for use with the **Sources** tool's **Workspace** tab can have any name. This demo directory is named `/workspaces/`.
9587

9688
1. Create a working branch named "test" and switch to it (to avoid altering the demo's files in the "main" branch):

0 commit comments

Comments
 (0)