Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit cdff911

Browse files
committed
Updated advanced-pattern-reload-browser page
Trying to address some overlap issues with the docs This is part of pattern-lab/patternlab-node#70 for version 1.0.0 release prep
1 parent d7b3374 commit cdff911

File tree

2 files changed

+66
-29
lines changed

2 files changed

+66
-29
lines changed

patternlabsite/docs/advanced-auto-regenerate.md

+24-27
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,6 @@ The Node version of Pattern Lab has the ability to watch for changes to patterns
7575

7676
## How to Start the Watch and Self-Host the Pattern Lab Website
7777

78-
By default, running `grunt serve` or `gulp serve` will compile the Pattern Lab website and host it on <a href="http://localhost:3000">http://localhost:3000</a> via the excellent [BrowserSync](http://www.browsersync.io/docs/) library. This is the recommended way to launch Pattern Lab Node versus using the filesystem.
79-
80-
BrowserSync is a tool with a lot of depth, but Pattern Lab Node ships with the following task configurations inside the [Gruntfile](https://github.com/pattern-lab/patternlab-node/blob/master/Gruntfile.js):
81-
82-
```
83-
browserSync: {
84-
dev: {
85-
options: {
86-
server: './public',
87-
watchTask: true,
88-
plugins: [
89-
{
90-
module: 'bs-html-injector',
91-
options: {
92-
files: './public/index.html'
93-
}
94-
}
95-
]
96-
}
97-
}
98-
},
99-
bsReload: {
100-
css: './public/**/*.css'
101-
}
102-
```
103-
10478
The watch configuration also tells Pattern Lab Node what files to reload when changes are made. Here's the excerpt from the [Gruntfile](https://github.com/pattern-lab/patternlab-node/blob/master/Gruntfile.js) again:
10579

10680
```
@@ -125,8 +99,31 @@ watch: {
12599
}
126100
},
127101
```
102+
By default, running `grunt serve` or `gulp serve` will compile the Pattern Lab website and open it at [http://localhost:3000](http://localhost:3000) on your default browser via the excellent [BrowserSync](http://www.browsersync.io/docs/) library. This is the recommended way to launch Pattern Lab Node versus using the filesystem.
103+
104+
BrowserSync is a tool with a lot of depth, but Pattern Lab Node ships with the following task configurations inside the [Gruntfile](https://github.com/pattern-lab/patternlab-node/blob/master/Gruntfile.js):
128105

129-
You'll notice that if you have this open across different browsers, we do our best to keep the website in sync, but there is a known issue with synced navigation using the main menu. BrowserSync also hosts an administration interface that sits alongside the Pattern Lab website and by default can be found at [http://localhost:3001](http://localhost:3001).
106+
```
107+
browserSync: {
108+
dev: {
109+
options: {
110+
server: './public',
111+
watchTask: true,
112+
plugins: [
113+
{
114+
module: 'bs-html-injector',
115+
options: {
116+
files: './public/index.html'
117+
}
118+
}
119+
]
120+
}
121+
}
122+
},
123+
bsReload: {
124+
css: './public/**/*.css'
125+
}
126+
```
130127

131128
## How to Stop the Watch
132129

patternlabsite/docs/advanced-reload-browser.md

+42-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22
layout: docs
33
title: Auto Reloading the Browser Window When Changes Are Made | Pattern Lab
44
heading: Auto Reloading the Browser Window When Changes Are Made
5+
languages:
6+
- language: php
7+
- language: node
58
---
69

10+
<!--- start php -->
711

8-
Rather than manually refreshing your browser when your patterns or CSS change you can have the PHP version of Pattern Lab auto-reload your browser window for you.
12+
<div class="tab-panel" id="php">
13+
<h2 class="language-title">php</h2>
14+
15+
{% capture m %}
16+
17+
18+
Rather than manually refreshing your browser when your patterns or CSS change you can have the PHP version of Pattern Lab auto-reload your browser window for you.
919

1020
## How to Start the Auto-Reload Server
1121

@@ -37,4 +47,34 @@ For Linux and Windows users you can also start the service from the command line
3747

3848
## How to Stop the Service
3949

40-
To stop the service on Mac OS X you can press `CTRL+C` in the Terminal window where the process is running. If you've used the method above to start the watch and the auto-reload server they will both shut down when using `CTRL+C`.
50+
To stop the service on Mac OS X you can press `CTRL+C` in the Terminal window where the process is running. If you've used the method above to start the watch and the auto-reload server they will both shut down when using `CTRL+C`.
51+
52+
{% endcapture %}
53+
{{ m | markdownify }}
54+
55+
</div>
56+
57+
<!--- end php -->
58+
59+
60+
<!--- start node -->
61+
62+
<div class="tab-panel" id="node">
63+
<h2 class="language-title">node</h2>
64+
65+
{% capture m %}
66+
67+
Rather than manually refreshing your browser when your patterns or CSS change, the Node version of Pattern Lab auto-reloads your browser window for you using [BrowserSync](http://www.browsersync.io/).
68+
69+
Auto-reloading is a behavior that is done in concert with file watching. You can read more about how these two features work together [here](/docs/advanced-auto-regenerate.html).
70+
71+
## How to Start and Connect to Pattern Lab with BrowserSync
72+
73+
Running 'grunt serve' or 'gulp serve' from the command line of your working directory will start up Pattern Lab Node with BrowserSync and launch [http://localhost:3000](http://localhost:3000) in your default browser.
74+
75+
{% endcapture %}
76+
{{ m | markdownify }}
77+
78+
</div>
79+
80+
<!--- end node -->

0 commit comments

Comments
 (0)