Skip to content

Commit e5fe406

Browse files
committed
[chore] moving documentation to mkdocs.
1 parent 525c35c commit e5fe406

20 files changed

+255
-275
lines changed

Diff for: Makefile

+19-21
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ REMOTE="[email protected]:reactjs/react-modal"
1111
CURRENT_VERSION:=$(shell jq ".version" package.json)
1212
COVERAGE?=true
1313

14+
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
15+
CURRENT_VERSION:=$(shell jq ".version" package.json)
16+
17+
VERSION:=$(if $(RELEASE),$(shell read -p "Release $(CURRENT_VERSION) -> " V && echo $$V),$(subst /,-,$(BRANCH)))
18+
1419
help: info
1520
@echo
1621
@echo "Current version: $(CURRENT_VERSION)"
@@ -38,10 +43,10 @@ info:
3843
deps: deps-project deps-docs
3944

4045
deps-project:
41-
@[[ ! -z "$(YARN)" ]] && $(YARN) install || $(NPM) install
46+
@$(PKM) install
4247

4348
deps-docs:
44-
@gitbook install
49+
@pip install --user mkdocs mkdocs-material jsx-lexer
4550

4651
# Rules for development
4752

@@ -64,47 +69,40 @@ lint:
6469
@npm run lint
6570

6671
docs: build-docs
67-
gitbook serve
72+
mkdocs serve
6873

6974
# Rules for build and publish
7075

7176
check-working-tree:
72-
@sh ./scripts/repo_status
73-
74-
version:
75-
@echo "[Updating react-modal version]"
76-
@sh ./scripts/version $(CURRENT_VERSION)
77-
@$(JQ) '.version' package.json | cut -d\" -f2 > .version
78-
79-
branch:
80-
@echo "[Release from branch]"
81-
@git branch | grep '^*' | awk '{ print $$2 }' > .branch
82-
@[[ "`cat .branch`" != "master\n" ]] && echo "Current branch: `cat .branch`" || (echo "Fail. Current branch is not master." && exit 1)
77+
@[[ ! -z "`git status -s`" ]] && \
78+
echo "Stopping publish. There are change to commit or discard." && \
79+
exit 1
8380

8481
changelog:
85-
@echo "[Updating CHANGELOG.md $(CURRENT_VERSION) > `cat .version`]"
86-
@python3 ./scripts/changelog.py v$(CURRENT_VERSION) v`cat .version` > .changelog_update
82+
@echo "[Updating CHANGELOG.md $(CURRENT_VERSION)]"
83+
@python3 ./scripts/changelog.py v$(CURRENT_VERSION) v$(VERSION) > .changelog_update
8784
@cat .changelog_update CHANGELOG.md > tmp && mv tmp CHANGELOG.md
85+
@rm .changelog_update
8886

8987
compile:
9088
@echo "[Compiling source]"
9189
$(BABEL) src --out-dir lib
9290

9391
build: compile
9492
@echo "[Building dists]"
95-
@./node_modules/.bin/webpack --config ./scripts/webpack.dist.config.js
93+
@npx webpack --config ./scripts/webpack.dist.config.js
9694

9795
release-commit:
98-
git commit --allow-empty -m "Release v`cat .version`."
96+
git commit --allow-empty -m "Release v$(VERSION)."
9997
@git add .
10098
@git commit --amend -m "`git log -1 --format=%s`"
10199

102100
release-tag:
103-
git tag "v`cat .version`"
101+
git tag "v$(VERSION)"
104102

105103
publish-version: release-commit release-tag
106104
@echo "[Publishing]"
107-
git push $(REMOTE) "`cat .branch`" "v`cat .version`"
105+
git push $(REMOTE) "$(BRANCH)" "v$(VERSION)"
108106
npm publish
109107

110108
pre-publish: clean branch version changelog
@@ -122,7 +120,7 @@ init-docs-repo:
122120
build-docs:
123121
@echo "[Building documentation]"
124122
@rm -rf _book
125-
@gitbook build -g reactjs/react-modal
123+
@mkdocs build
126124

127125
pre-publish-docs: clean-docs init-docs-repo deps-docs
128126

Diff for: docs/README.md

-184
This file was deleted.

Diff for: docs/SUMMARY.md

-31
This file was deleted.

Diff for: docs/accessibility/README.md renamed to docs/accessibility/index.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
## Accessibility
2-
31
react-modal aims to be fully accessible, using the
42
[WAI-ARIA](https://www.w3.org/WAI/intro/aria) guidelines to support users of
53
assistive technologies. This page describes some of react-modal's
64
accessibility-oriented features, along with their configuration options.
75

8-
### The app element {#app-element}
6+
### [The app element](#app-element)
97

108
It is important for users of screenreaders that other page content be hidden
119
(via the `aria-hidden` attribute) while the modal is open. To allow
@@ -14,14 +12,14 @@ selector identifying the root of your app. For example, if your app content is
1412
located inside an element with the ID `root`, you could place the following
1513
call somewhere in your code before any modals are opened:
1614

17-
```js
15+
```jsx
1816
Modal.setAppElement('#root');
1917
```
2018

2119
You can also pass a DOM element directly, so that the above example could be
2220
rewritten:
2321

24-
```js
22+
```jsx
2523
Modal.setAppElement(document.getElementById('root'));
2624
```
2725

@@ -32,7 +30,7 @@ to avoid getting a warning that your app element is not specified.
3230
Using `Modal.setAppElement` will not embed react-modal into your react app as
3331
a descendent component. It will just help boost up the app accessiblity.
3432

35-
### Keyboard navigation {#keyboard}
33+
### [Keyboard navigation](#keyboard)
3634

3735
When the modal is opened, it restricts keyboard navigation using the tab key to
3836
elements within the modal content. This ensures that elements outside the
@@ -47,7 +45,7 @@ The modal can be closed using the escape key, unless the
4745
`shouldCloseOnEsc={false}` prop is passed. Disabling this behavior may cause
4846
accessibility issues for keyboard users, however, so it is not recommended.
4947

50-
### ARIA attributes {#aria}
48+
### [ARIA attributes](#aria)
5149

5250
Besides the `aria-hidden` attribute which is applied to the app element when
5351
the modal is shown, there are many other ARIA attributes which you can use to

Diff for: docs/contributing/development.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
### Development setup
2-
31
`react-modal` uses `make` to build and publish new versions and documentation.
42

53
It works as a checklist for the future releases to keep everything updated such as
64
`CHANGELOG.md`, `package.json` and `bower.json` and so on.
75

8-
The minimun works as a normal `npm script`.
6+
The minimun works as a normal `npm` scripts.
97

10-
#### Usage
8+
#### [Usage](#usage)
119

1210
Once you clone `react-modal`, you can run `sh bootstrap.sh` to check
1311
and download dependencies not managed by `react-modal` such as `gitbook-cli`.
1412

1513
It will also show information about the current versions of `node`, `npm`,
1614
`yarn` and `jq` available.
1715

18-
#### List of `npm` commands:
16+
#### [List of `npm` or `yarn` commands](#npm-yarn-commands)
1917

20-
$ npm start -s or yarn start # to run examples
18+
$ npm start
2119
$ npm run tests
2220
$ npm run lint
2321

24-
#### List of `make` commands:
22+
#### [List of `make` commands](#make-commands)
2523

2624
$ make help # show all make commands available
27-
$ make deps # npm install, gitbook plugins...
28-
$ make serve # to run examples
25+
$ make deps # npm install
26+
$ make serve # start a examples' web server
2927
$ make tests # use when developing
3028
$ make tests-ci # single run
31-
$ make lint # pass lint
29+
$ make lint # execute lint
3230
$ make publish # execute the entire pipeline to publish
3331
$ make publish-docs # execute the pipeline for docs

0 commit comments

Comments
 (0)