Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit e1e1be3

Browse files
committed
feat(docs): prepare for readthedocs
1 parent 46db6fd commit e1e1be3

File tree

12 files changed

+197
-81
lines changed

12 files changed

+197
-81
lines changed

README.md

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -25,74 +25,9 @@ All is easily configurable by changing values in your `gulpfile.yml` file in you
2525
- JS specs => JS tests using Karma
2626

2727

28-
## Prerequisites
28+
## Documentation
2929

30-
- [Node](https://nodejs.org)
31-
- [Gulp-cli](http://gulpjs.com/): `npm install -g gulp-cli`
32-
33-
34-
## Installation
35-
36-
- `npm install gulp-drupal-theme-core --save-dev`
37-
- Create a `gulpfile.yml` in your theme, and overrides options from the `gulpfile.default.yml`
38-
- Make a `gulpfile.js` in your project, with:
39-
```js
40-
"use strict";
41-
42-
const gulp = require("gulp");
43-
const yaml = require("js-yaml");
44-
const fs = require("fs");
45-
46-
// `rc` allows all config options to be overridden with CLI flags like `--js.enabled="` or in `~/.p2-theme-corerc` files, among many others: https://www.npmjs.com/package/rc
47-
const config = require("rc")("gulp-drupal-theme-core", yaml.safeLoad(fs.readFileSync(`${__dirname}/gulpfile.yml`, "utf8"), { json: true }));
48-
const themeCore = require("gulp-drupal-theme-core");
49-
50-
const tasks = {
51-
compile: [],
52-
watch: [],
53-
validate: [],
54-
clean: [],
55-
"default": []
56-
};
57-
58-
themeCore(gulp, config, tasks);
59-
60-
gulp.task("clean", gulp.parallel(tasks.clean));
61-
gulp.task("compile", gulp.series(
62-
"clean",
63-
gulp.series(tasks.compile)
64-
));
65-
gulp.task("validate", gulp.parallel(tasks.validate));
66-
gulp.task("watch", gulp.parallel(tasks.watch));
67-
tasks.default.push("watch");
68-
gulp.task("default", gulp.series(
69-
"compile",
70-
gulp.parallel(tasks.default)
71-
));
72-
```
73-
74-
### Babel
75-
In order to use Babel, you need to create a `.babelrc` into your project, with the presets that you want installed.
76-
77-
### ESLINT
78-
You need to create a `.eslintrc.js` file, and specify whitch rules that you want (`eslint-config-ovh` is recommanded).
79-
80-
81-
## Usage
82-
83-
### Global Commands
84-
85-
- `gulp` - Run all compile tasks, and watch for changes
86-
- `gulp compile` - Run all compile tasks
87-
- `gulp validate` - Run all validate tasks (eslint, ...)
88-
- `gulp watch` - Watch for changes
89-
- `gulp clean` - Run all clean tasks
90-
91-
### Specifics Commands
92-
93-
You can launch specifics tasks, for example "lint CSS files". In this example, you can use `gulp validate:css`.
94-
95-
All the documentation can be found inside the [docs] folder.
30+
Full documentation is available [here](https://drucker.readthedocs.io/en/latest).
9631

9732

9833
## Contributing

docs/banner.png

39.7 KB
Loading

docs/extra.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
p + ul,
2+
p + ol {
3+
margin-top: -20px !important;
4+
margin-left: 15px;
5+
}
6+
.admonition > *:last-child {
7+
margin-bottom: 0 !important;
8+
}
9+
10+
.admonition.quote,
11+
.admonition.success {
12+
padding: 12px;
13+
margin-bottom: 24px;
14+
line-height: 24px;
15+
}
16+
.admonition.quote {
17+
background: hsla(0,0%,93%,.5);
18+
}
19+
.admonition.success {
20+
background: rgba(0,200,83,.1);
21+
}
22+
23+
.admonition.note {
24+
border-left: .2rem solid #00b0ff !important;
25+
}
26+
.admonition.success {
27+
border-left: .2rem solid #00c853 !important;
28+
}
29+
.admonition.danger {
30+
border-left: .2rem solid #ff1744 !important;
31+
}
32+
.admonition.warning {
33+
border-left: .2rem solid #ff9100 !important;
34+
}
35+
.admonition.cite {
36+
border-left: .2rem solid #9e9e9e;
37+
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Browser-sync
2-
31
Create a connection between your desk and your website, using BrowserSync.
42

53
## Commands

docs/css.md renamed to docs/features/css.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# SCSS
2-
3-
Compiles SCSS to CSS using [`gulp-sass`](https://github.com/dlmanning/gulp-sass), which in turn uses `node-sass`, which in turn uses `libsass`.
1+
Compiles SCSS to CSS using [gulp-sass](https://github.com/dlmanning/gulp-sass), which in turn uses `node-sass`, which in turn uses `libsass`.
42

53
## Usage
64

@@ -17,7 +15,7 @@ You can create individual CSS files bundle, using the config:
1715

1816
- `gulp css` - Compile SCSS to CSS
1917
- `gulp watch:css` - Watch and compile
20-
- `gulp validate:css` - Test SCSS with [`gulp-sass-lint`](https://github.com/sasstools/gulp-sass-lint), which uses [`sass-lint`](https://github.com/sasstools/sass-lint) (Pure node.js - no Ruby)
18+
- `gulp validate:css` - Test SCSS with [gulp-sass-lint](https://github.com/sasstools/gulp-sass-lint), which uses [sass-lint](https://github.com/sasstools/sass-lint) (Pure node.js - no Ruby)
2119

2220
## Config
2321

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Drupal
2-
31
Launch a Drupal command.
42

53
## Commands
@@ -14,6 +12,6 @@ Launch a Drupal command.
1412

1513
## Notes
1614

17-
- If you want to use it with [`Drucker`](https://github.com/ovh-ux/drucker), you need to:
15+
- If you want to use it with [Drucker](https://github.com/ovh-ux/drucker), you need to:
1816
- set the `config.drupal.dir` to `./path/to/drucker`
1917
- set the `config.drupal.command` to `. load-env && drush cc all`

docs/icons.md renamed to docs/features/icons.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Icons
2-
3-
Uses [`gulp-iconfont`](https://github.com/nfroidure/gulp-iconfont). Grabs a folder of SVG icons and turns them into font icons, creates a Sass mixin and class for each based on filename, adds all to a demo page.
1+
Uses [gulp-iconfont](https://github.com/nfroidure/gulp-iconfont). Grabs a folder of SVG icons and turns them into font icons, creates a Sass mixin and class for each based on filename, adds all to a demo page.
42

53
## Usage
64

docs/js.md renamed to docs/features/js.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# JS
2-
31
Compiles JS files using Babel. You can optionaly concat, uglify, and add sourcemaps.
42

53
## Commands

docs/index.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,103 @@
1+
Gulp Drupal Theme - Core
2+
========================
3+
4+
![gulp-drupal-theme-core-banner](banner.png)
5+
16
This theme core is to be included in your main project and sets up many Gulp tasks that can work in many flexible ways by passing in different `config` objects, which can be based off of `gulpfile.default.yml` (and is merged with).
7+
8+
9+
## Features
10+
11+
- SCSS => CSS compiling with LibSass, PostCSS, linting, and SourceMaps
12+
- JS compiling via Babel, linting and aggregation
13+
- WebPack module bundling
14+
- SVG => Font Icons compiling with support for adding mixins and classes to SCSS along with a demo page
15+
- Drupal file watching to trigger Drush cache clears
16+
17+
All is easily configurable by changing values in your `gulpfile.yml` file in your project. These values are merged into the `gulpfile.default.yml` file - look there for the available options and defaults.
18+
19+
### TODO
20+
21+
- BrowserSync live reload and style injection (should be OK, not tested)
22+
- Images => Images optimization (to validate)
23+
- JS specs => JS tests using Karma
24+
25+
26+
## Prerequisites
27+
28+
- [Node](https://nodejs.org)
29+
- [Gulp-cli](http://gulpjs.com/): `npm install -g gulp-cli`
30+
31+
32+
## Installation
33+
34+
- `npm install gulp-drupal-theme-core --save-dev`
35+
- Create a `gulpfile.yml` in your theme, and overrides options from the `gulpfile.default.yml`
36+
- Make a `gulpfile.js` in your project, with:
37+
```js
38+
"use strict";
39+
40+
const gulp = require("gulp");
41+
const yaml = require("js-yaml");
42+
const fs = require("fs");
43+
44+
// `rc` allows all config options to be overridden with CLI flags like `--js.enabled="` or in `~/.p2-theme-corerc` files, among many others: https://www.npmjs.com/package/rc
45+
const config = require("rc")("gulp-drupal-theme-core", yaml.safeLoad(fs.readFileSync(`${__dirname}/gulpfile.yml`, "utf8"), { json: true }));
46+
const themeCore = require("gulp-drupal-theme-core");
47+
48+
const tasks = {
49+
compile: [],
50+
watch: [],
51+
validate: [],
52+
clean: [],
53+
"default": []
54+
};
55+
56+
themeCore(gulp, config, tasks);
57+
58+
gulp.task("clean", gulp.parallel(tasks.clean));
59+
gulp.task("compile", gulp.series(
60+
"clean",
61+
gulp.series(tasks.compile)
62+
));
63+
gulp.task("validate", gulp.parallel(tasks.validate));
64+
gulp.task("watch", gulp.parallel(tasks.watch));
65+
tasks.default.push("watch");
66+
gulp.task("default", gulp.series(
67+
"compile",
68+
gulp.parallel(tasks.default)
69+
));
70+
```
71+
72+
### Babel
73+
In order to use Babel, you need to create a `.babelrc` into your project, with the presets that you want installed.
74+
75+
### ESLINT
76+
You need to create a `.eslintrc.js` file, and specify whitch rules that you want (`eslint-config-ovh` is recommanded).
77+
78+
79+
## Usage
80+
81+
### Global Commands
82+
83+
- `gulp` - Run all compile tasks, and watch for changes
84+
- `gulp compile` - Run all compile tasks
85+
- `gulp validate` - Run all validate tasks (eslint, ...)
86+
- `gulp watch` - Watch for changes
87+
- `gulp clean` - Run all clean tasks
88+
89+
### Specifics Commands
90+
91+
You can launch specifics tasks, for example "lint CSS files". In this example, you can use `gulp validate:css`.
92+
93+
All the documentation can be found inside the [Features](features) section.
94+
95+
96+
## Credits
97+
98+
Original project from [p2-theme-core](https://github.com/phase2/p2-theme-core).
99+
100+
101+
## License
102+
103+
MIT (original license)

docs/troubleshooting.md

Whitespace-only changes.

0 commit comments

Comments
 (0)