Skip to content

Commit a0dc188

Browse files
GuzmanPIjorgeucanofacurodriguez
authored
fix(docs): Add better written docs for: Prerequisites, Getting Starte… (#383)
* fix(docs): Add better written docs for: Prerequisites, Getting Started, Blog, Scully, Issues, Plugins, Polyfills and Code of Conduct * Update docs/getting-started_es.md Co-Authored-By: Facundo Rodriguez <rodriguez.facu23@gmail.com> Co-authored-by: Jorge Cano <jorgeucano@gmail.com> Co-authored-by: Facundo Rodriguez <rodriguez.facu23@gmail.com>
1 parent db41c66 commit a0dc188

14 files changed

Lines changed: 174 additions & 144 deletions

docs/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ order: 900
55

66
# Code of Conduct
77

8-
This will be prepared before we end the alpha phase of our development.
9-
10-
[Full Documentation ➡️](scully.md)
8+
This will be ready before alpha phase of Scully's development.

docs/blog.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# Scully with Blogs
1+
---
2+
title: Adding Blog Support
3+
order: 600
4+
---
5+
6+
# Blogs in Scully
27

3-
Scully is your best friend when you want to move your blog to Angular!
8+
Scully is the best option for moving a blog to Angular!
49

5-
We have a schematic that will add the necessary pieces to your project to enable blogging with markdown files in your
6-
Angular app.
10+
It has a schematic that enables Angular applications to use markdown files for blog's content.
711

812
1. [Adding Blog Support](#adding-blog-support)
913
2. [Generating New Blog Posts](#generating-new-blog-posts)
@@ -13,54 +17,51 @@ Angular app.
1317
To add blog support to your app, run the following command:
1418

1519
```bash
16-
ng g @scullyio/init:blog
20+
ng generate @scullyio/init:blog
1721
```
1822

19-
This will add the blog components/modules/routes to your Angular app, as well as a folder for your blog markdown files.
20-
If you don't want the folder to be called 'blog', you can run a longer command to provide your own custom names/folders.
23+
This command adds the blog modules's roues to the Angular application. In addition, it creates a `./blog` folder for the blog's markdown files.
2124

22-
To name your blog folders and components another name, run the following command with your own name:
25+
To create a folder with a different name, run the following command:
2326

2427
```bash
25-
ng g @scullyio/init:markdown --name=my-test --slug=my-slug-id
28+
ng generate @scullyio/init:markdown --name=my-markdown --slug=my-slug-id
2629
```
2730

2831
or
2932

3033
```bash
31-
ng g @scullyio/init:markdown --name="my text" --slug="my slug id"
34+
ng generate @scullyio/init:markdown --name="my markdown" --slug="my slug id"
3235
```
3336

34-
the following table shows all available options:
37+
**NOTE:** Slug is .
38+
39+
The following table shows all available options:
40+
41+
| Option | Description | Default |
42+
| -------------- | --------------------------------------------------------- | ------------------------ |
43+
| `name` | Defines the name for the created module | 'blog' |
44+
| `slug` | Define the name for the `:slug` | 'id' |
45+
| `routingScope` | Sets a routing scope (`Root` or `Child`) | Child |
46+
| `sourceDir` | Defines a source directory name (default: `name`) | value from `name` option |
47+
| `route` | Defines a route path before the `:slug` (default: `name`) | value from `name` option |
3548

36-
| option | description | default |
37-
| -------------- | ------------------------------------------------------------------------------ | ------------------------ |
38-
| `name` | define the name for the created module | 'blog' |
39-
| `slug` | define the name for the `:slug` | 'id' |
40-
| `routingScope` | set a routing scope (`Root` or `Child`) | Child |
41-
| `sourceDir` | define a source dir name (when not used, `name` is used instead) | value from `name` option |
42-
| `route` | define a route path before the `:slug` (when not used, `name` is used instead) | value from `name` option |
49+
Scully works well in combination with other tools and [utilities](utils.md).
4350

44-
> If your markdown content will include code blocks, you may want the [code to be highlighted](utils.md).
51+
For instance, if the markdown content includes code blocks, and you want to highlight it us the use a utility.
4552

4653
## Generating New Blog Posts
4754

48-
To add a new blog post, run the following command:
55+
To create a new blog post, run the following command:
4956

5057
```bash
51-
ng g @scullyio/init:post --name="This is my post"
58+
ng generate @scullyio/init:post --name="This is my post"
5259
```
5360

54-
the following table shows all available options:
61+
The following table shows all available options:
5562

5663
| option | description | default |
5764
| -------------- | ------------------------------------------------------ | --------- |
5865
| `name` | define the name for the created post | 'blog-X' |
5966
| `target` | define the target directory for the new post file | 'blog' |
6067
| `metaDataFile` | use a meta data yaml template from a file for the post | undefined |
61-
62-
[Check how to integrate Scully with other tools.](utils.md)
63-
64-
---
65-
66-
[Full Documentation ➡️](scully.md)

docs/getting-started.md

Lines changed: 41 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,29 @@ title: Getting Started
33
order: 200
44
---
55

6-
# Scully - Getting Started
6+
# Getting Started with Scully
77

8-
[Español](getting-started_es.md)
8+
Welcome to Scully!
99

10-
## Prerequisites
10+
Before getting started, please read the [Prerequisites](pre-requisites.md).
1111

12-
The first thing you need to get started with Scully is a working Angular app using **Angular 8.x.x** or **9.x.x** and **Node 12.x.x**
13-
14-
You can create a new Angular 9 app using the following command:
15-
16-
```bash
17-
npx -p @angular/cli ng new my-scully-app
18-
```
19-
20-
If that fails, you can install the Angular CLI globally and create a new app with that version.
21-
22-
```
23-
npm install -g @angular/cli
24-
ng new my-scully-app
25-
```
26-
27-
Find more info here [👉 angular.io/cli](https://angular.io/cli)
28-
29-
**NOTE:** Scully will use Chromium. Make sure your Operating System (and its restrictions by your administrator) allow installing and executing Chromium.
30-
31-
This getting started doc covers the three steps to adding Scully into your project.
12+
This getting started guide covers three topics:
3213

3314
1. [Installation](#installation)
34-
2. [Build](#build)
35-
3. [Test](#test)
15+
2. [Building](#build)
16+
3. [Testing](#test)
3617

3718
## Installation
3819

39-
To install Scully, execute the following command from the root directory of your Angular project (in a terminal window):
20+
First, open your Angular application. Inside the project's root directory run the following command:
4021

4122
```bash
4223
ng add @scullyio/init
4324
```
4425

45-
The command above installs dependencies and configures the files needed to start building with Scully (_we will further elaborate on this in upcoming releases_).
26+
This command installs dependencies and configures the files needed by Scully.
4627

47-
If the installation was successful a message similar to this one will be displayed:
28+
Once the installation finishes the following message will be displayed:
4829

4930
```bash
5031
Installed packages for tooling via yarn.
@@ -59,31 +40,25 @@ CREATE scully.config.js (65 bytes)
5940
UPDATE package.json (1507 bytes)
6041
```
6142

62-
#### IMPORTANT: _Scully requires the router to be present in your application, don't forget to add it._
63-
64-
#### IMPORTANT: _Scully requires the distribution files to be in a subfolder of `./dist`_
65-
66-
If you have an angular app, that outputs the distribution files directly into the root of `./dist` Scully can't copy all of the dist files. This is an OS file-system issue. We can't copy recursively into a subfolder of dist. The solution is to set the option `architect->build->options->outputPath` to a subfolder.
43+
## ng generate @scullyio/init:blog
6744

68-
## ng g @scullyio/init:blog
45+
This command will generate a blog module. [more info here](blog.md)
6946

70-
This command will generate a blog module. [more info here](https://github.com/scullyio/scully/blob/master/docs/blog.md)
71-
72-
Once it's generated you can open the default `app.component.html` created by angular-cli and remove the whole placeholder leaving only the router outlet tag `<router-outlet></router-outlet>`
47+
Once it is generated remove all the content in the `app.component.html` file, and add only the router outlet tag `<router-outlet></router-outlet>`.
7348

7449
### Home page
7550

76-
Since the default template from angular-cli doesn't ship an entry point for route, it might be confusing to get Scully working on the very first shot.
51+
It is necessary to create a _route entry point_ because the Angular CLI does not create one by default.
52+
53+
Create a _Home Module_ with a _Home Component_ and its routes already configured with the following command:
7754

7855
```ts
79-
ng g m home --route=home --module=app-routing
56+
ng generate module home --route=home --module=app-routing
8057
```
8158
82-
This command will generate the new home page module plus a new component with a route configured.
59+
### Configuring the home module as root
8360
84-
### Configure home as root
85-
86-
Open `app-routing.module.ts` and let the path attribute empty for the home route.
61+
Open the `app-routing.module.ts` file and set an empty path attribute for the home route as shown below:
8762
8863
```ts
8964
const routes: Routes = [
@@ -95,9 +70,9 @@ const routes: Routes = [
9570
];
9671
```
9772

98-
### Inject route service
73+
### Inject the route service
9974

100-
Scully provides a service to easy get access on generated routes. To list these in your template open `home.component.ts` by adding the following code:
75+
Scully provides a service for accessing generated routes with ease. To use it, open the `home.component.ts` file and add the following code:
10176

10277
```ts
10378
import {ScullyRoutesService} from '@scullyio/ng-lib';
@@ -119,7 +94,7 @@ export class HomeComponent implements OnInit {
11994
}
12095
```
12196

122-
and then loop inside `home.component.html`
97+
Now, it is possible to loop through the links inside the template by opening the `home.component.html` file and adding the following code:
12398

12499
```html
125100
<p>home works!</p>
@@ -129,46 +104,37 @@ and then loop inside `home.component.html`
129104
</ul>
130105
```
131106

132-
## Build
133-
134-
By now you should have your Angular project with Scully successfully installed, so let us run a Scully build and turn your site into a
135-
pre-rendered Angular app.
136-
137-
Since Scully runs based on a build of your app, the first step is to build your Angular project (with added routes), subsequently running the Scully build.
107+
**NOTE:** If you don't add any route, scully will pre-render 0 pages.
138108

139-
```bash
140-
ng build
141-
npm run scully
142-
```
109+
## Build
143110

144-
That's it, you're done! In your project directory, you should now have a `/dist/static` folder containing the built version
145-
of your app.
111+
At this point, you have your Angular project with Scully successfully installed.
146112

147-
**NOTE:** If you had any errors or warnings during the build phase, please follow the instructions in the errors/warnings
148-
(if applicable) or [submit an issue](https://github.com/scullyio/scully/issues/new/choose).
113+
#### IMPORTANT: _Scully requires the distribution files in the `./dist/my-scully-app` folder._
149114

150-
**NOTE:** If you don't add any route, scully will pre-render 0 pages.
115+
**NOTE:** If the angular application outputs the distribution files directly into the root folder `./dist`. Scully is not able to copy all files. This is an OS file-system issue.
151116

152-
## Test
117+
Build the application in order to generate the distribution files:
153118

154-
Now that your project has been pre-rendered, you can validate the build by either:
119+
```
120+
ng build
121+
```
155122

156-
#### Serving the contents
123+
Now, lets build Scully and turn your Angular app into a pre-rendered static site.
157124

158-
By utilizing something like [http-server](https://www.npmjs.com/package/http-server) you can serve the contents of your
159-
`dist/static` folder. All of the routes in your non-pre-rendered Angular app should still work. Not all apps are
160-
capable of running without.
125+
```bash
126+
npm run scully
127+
```
161128

162-
[//]: # 'Missing text for the line above'
129+
Congratulations! You have turned your Angular application into a wicked fast pre-rendered one thanks to Scully.
163130

164-
**Extra Credit**: While serving your app, [disable JavaScript](https://developers.google.com/web/tools/chrome-devtools/javascript/disable)
165-
and make sure that it still works. This is the goal for your app, to run with JavaScript disabled. Most parts of your app should still work without JS enabled.
131+
The built version is in the `./dist/static` folder. This folder contains ol the pages in the site.
166132

167-
#### Browsing the contents
133+
**NOTE:** In case of any errors or warnings during the build process, please follow the instructions in the errors/warnings section (_Coming soon_) or [submit an issue](https://github.com/scullyio/scully/issues/new/choose).
168134

169-
Browse the contents of your `dist/static` directory and make sure that all of your pages were pre-rendered and saved to
170-
HTML correctly.
135+
#### Serving the content
171136

172-
---
137+
Use [http-server](https://www.npmjs.com/package/http-server) to serve the `dist/static` folder's content.
173138

174-
[Full Documentation ➡️](scully.md)
139+
**Extra Credit**: While serving the static app, [disable JavaScript](https://developers.google.com/web/tools/chrome-devtools/javascript/disable)
140+
and make sure that the site's navigation still works and most parts of it should still work without JS enabled.

docs/getting-started_es.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# Scully - Empezando
1+
---
2+
title: Primeros pasos
3+
order: 200
4+
---
5+
6+
# Scully - Primeros pasos
27

3-
## Requerimientos previos
8+
## Requisitos previos
49

510
Lo primero que se necesita para comenzar con Scully es una aplicación Angular que utilice **Angular 8.x.x** o **9.x.x** y **Node 12.x.x**
611

docs/issues.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
# Scully Issues
1+
---
2+
title: Issues
3+
order: 1000
4+
---
5+
6+
# Issues
27

38
To create a bug report go to [Scully Bug template](https://github.com/scullyio/scully/issues/new?assignees=&labels=bug&template=---bug-report.md&title=).
49

510
To propose a new feature go to [Scully Feature request](https://github.com/scullyio/scully/issues/new?assignees=&labels=enhancement&template=---feature-request.md&title=)
611

7-
We are working on better documentation for creating issues.
8-
9-
[Full Documentation ➡️](scully.md)
12+
The Scully team is working on better documentation for creating issues.

docs/plugins.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
title: Plugins
3+
order: 700
4+
---
5+
16
# <a name="plugins"></a> Plugins
27

38
Scully uses a plugin system to allow users to define new ways for Scully to pre-render your app. There are three main

docs/polyfills.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1+
---
2+
title: Polyfills
3+
order: 800
4+
---
5+
16
# Polyfills
27

3-
Depending on the browsers and environments your app targets, polyfills may be
4-
required. This page lists some recommended polyfills.
8+
Depending on the browser and environment that your application targets, some polyfills may be
9+
required. This page lists the recommended polyfills.
510

611
## `Event()` constructor
712

8-
We use [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)
9-
inside Scully to be aware of different points in the lifecycle of the application.
13+
Scully uses [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)
14+
to be aware of different points in the application's lifecycle.
1015

11-
To make this work in **Internet Explorer 10+**, include the following polyfill.
16+
To make **Internet Explorer 10+** work, install the following polyfill:
1217

1318
`npm install events-polyfill`
1419

0 commit comments

Comments
 (0)