Skip to content

Commit 660c001

Browse files
authored
docs: Update README and npm-scripts to be up to date (#134)
docs: Update README and npm-scripts to be up to date
2 parents 6175d30 + a77838b commit 660c001

File tree

4 files changed

+88
-33
lines changed

4 files changed

+88
-33
lines changed

.vscode/settings.json

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
{
22
"workbench.colorCustomizations": {
3-
"activityBar.background": "#fb2045",
4-
"activityBar.foreground": "#e7e7e7",
5-
"activityBar.inactiveForeground": "#e7e7e799",
6-
"activityBarBadge.background": "#115e02",
3+
"activityBar.background": "#6ca2ee",
4+
"activityBar.foreground": "#15202b",
5+
"activityBar.inactiveForeground": "#15202b99",
6+
"activityBarBadge.background": "#c81761",
77
"activityBarBadge.foreground": "#e7e7e7",
8-
"titleBar.activeBackground": "#e4042a",
9-
"titleBar.inactiveBackground": "#e4042a99",
8+
"titleBar.activeBackground": "#3e85e9",
9+
"titleBar.inactiveBackground": "#3e85e999",
1010
"titleBar.activeForeground": "#e7e7e7",
1111
"titleBar.inactiveForeground": "#e7e7e799",
12-
"statusBar.background": "#e4042a",
13-
"statusBarItem.hoverBackground": "#fb2045",
12+
"statusBar.background": "#3e85e9",
13+
"statusBarItem.hoverBackground": "#6ca2ee",
1414
"statusBar.foreground": "#e7e7e7"
15-
}
15+
},
16+
"peacock.color": "#3e85e9",
17+
"spellright.language": [
18+
"en",
19+
"de"
20+
],
21+
"spellright.documentTypes": [
22+
"markdown",
23+
"latex",
24+
"plaintext"
25+
]
1626
}

README.md

Lines changed: 66 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,92 @@ Hosted on:
66

77
[![Netlify Badge](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://basiljs2.netlify.com/)
88

9-
This repo holds the [site/docs for Basil.js](https://basiljs.github.io/)
9+
This repo holds the [site/docs for Basil.js](https://basiljs.github.io/). The current state of development (develop branch) can be found here [basiljs2.netlify.com](https://basiljs2.netlify.com/)
10+
## Update Basil API
11+
12+
If there are changes to the API of Basil.js you can update the data on this repo as follows.
13+
14+
```bash
15+
16+
git pull [email protected]:basiljs/basiljs.github.io.git
17+
cd basiljs.github.io
18+
# get all branches
19+
git fetch -a
20+
# get into the develop branch
21+
git checkout -b develop origin/develop
22+
# now make your new branch based on develop
23+
git checkout -b chore/update-docs
24+
# build the new data source for the site
25+
# This will:
26+
27+
# - Pull the Basil.js' branch `develop` with npm from GitHub (eventually this should be the master, not the develop branch).
28+
# - Generate the file `./build-scripts/api/data.json` from `./node_modules/basiljs/basil.js` using [documentation.js](http://documentation.js.org/).
29+
# - Generate the following files for the index.
30+
# + `./_data/categories.json`
31+
# + `./_data/cats-and-subcats.json`
32+
# - Also generate all the files for the subpages of `_source/reference`.
33+
npm run build:api-markup
34+
# After that you can just commit all the changes and push it the repo again. Netlify will take care of the Jekyll build.
35+
# Only add the files you really want to.
36+
# Adding all with `git add .` is acutally not the right way
37+
# use gits interactive mode or some more specific paths then `.`
38+
git add -i
39+
git commit -m "chore: Update Basil.js api to latest state [Add your favorite emoji here]"
40+
# push current HEAD to remote
41+
git push -u origin HEAD
42+
# Now go to the GitHub UI and create your PR
43+
```
1044

11-
## Deploy
45+
## Development
1246

13-
If there are some changed to the API of Basil.js you can update the data on this repo as follows.
47+
To build these docs we are using [Webpack](https://webpack.js.org/) and [Jekyll](https://jekyllrb.com/). You need both of these to develop on this.
1448

15-
npm run build
49+
- Create a new branch based on branch `develop` (see the code above for a how to 👆).
50+
- Do your thing
51+
- Create a pull request against develop
1652

17-
This will:
53+
Netlify will create a branch and deploy preview for you and you can see your changes online. Every push to your branch will trigger a new build and will be linked on the PR page.
1854

19-
- Pull the branch develop with npm from GitHub.
20-
- Generate the file `./.bin/api/data.json` from `./node_modules/basiljs/basil.js` using [documentation.js](http://documentation.js.org/).
21-
- Generate the following files for the index.
22-
+ `./_data/categories.json`
23-
+ `./_data/cats-and-subcats.json`
24-
- Also generate all the files for the subpages.
55+
To develop locally take a look at the steps below. 👇
2556

26-
After that you can just commit all the changes and push it the repo again. GitHub pages will take care of the jekyll build.
57+
### Markup + SCSS
2758

59+
Most of the Jekyll [liquid magic](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) happens in `./_source`.
2860

29-
## Development
30-
31-
To build these docs we are using [Node.js](https://nodejs.org/en/) and [Jekyll](https://jekyllrb.com/). You need both of them installed to develop on this.
61+
To develop in this run:
3262

33-
In the `.bin/` folder you have the scripts to generate the files for the reference. The entry point is `index.js`.
63+
```bash
64+
# once
65+
bundle install
66+
bundle update
67+
# whenever you want to work on the markup/content
68+
# (the --limit_posts 1 --incremental flags are needed
69+
# because we have lots of pages and need to speedup the build)
70+
bundle exec jekyll serve --livereload --limit_posts 1 --incremental
71+
```
3472

35-
Most of the jekyll [liquid magic](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) happens in `./index.html`, `_includes/entry-card.html`.
73+
### Javascript
3674

37-
To develop in this run:
75+
To work on the Javasscript of the site you need to run
3876

39-
bundle install
40-
bundle update
41-
bundle exec jekyll serve --livereload
77+
```bash
78+
# once
79+
# needs npm v5.7 or higer
80+
npm ci
81+
# when you develop on it
82+
# (starts the webpack dev watch build toolchain)
83+
npm run webpack:dev
84+
```
4285

4386
## Recipes
4487

4588
Resize and crop multiple images using [`mogrify`](https://www.imagemagick.org/script/mogrify.php)
4689

47-
```
90+
```bash
4891
mogrify -resize 320x180^ -gravity Center -extent 320x180 -quality 100 -format png ./*/thumbnail.jpg
4992

5093
```
94+
5195
## License
5296

5397
Copyright (c) 2013-2019 Basil.js

bootstrap-scripts/update-and-generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ pwd
55
npm install basiljs/basil.js#develop -D
66
cp ./node_modules/basiljs/changelog.txt ./_source/download/
77
npm run documentationjs -- build ./node_modules/basiljs/basil.js -o ./build-scripts/api/data.json
8-
node build-scripts/dist/index.js
8+
node build-scripts/src/index.js

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"jekyll:dev": "bundle exec jekyll serve --livereload --incremental --limit_posts 5",
1010
"jekyll:prod": "JEKYLL_ENV=production bundle exec jekyll build",
1111
"documentationjs": "documentation",
12-
"update-and-generate": "sh ./bootstrap-scripts/update-and-generate.sh"
12+
"update-and-generate": "sh ./bootstrap-scripts/update-and-generate.sh",
13+
"build:api-markup":"npm run update-and-generate"
1314
},
1415
"repository": {
1516
"type": "git",

0 commit comments

Comments
 (0)