Skip to content

Commit

Permalink
[chore] moving documentation to mkdocs.
Browse files Browse the repository at this point in the history
  • Loading branch information
diasbruno committed Dec 10, 2019
1 parent 525c35c commit e5fe406
Show file tree
Hide file tree
Showing 20 changed files with 255 additions and 275 deletions.
40 changes: 19 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ REMOTE="git@github.com:reactjs/react-modal"
CURRENT_VERSION:=$(shell jq ".version" package.json)
COVERAGE?=true

BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
CURRENT_VERSION:=$(shell jq ".version" package.json)

VERSION:=$(if $(RELEASE),$(shell read -p "Release $(CURRENT_VERSION) -> " V && echo $$V),$(subst /,-,$(BRANCH)))

help: info
@echo
@echo "Current version: $(CURRENT_VERSION)"
Expand Down Expand Up @@ -38,10 +43,10 @@ info:
deps: deps-project deps-docs

deps-project:
@[[ ! -z "$(YARN)" ]] && $(YARN) install || $(NPM) install
@$(PKM) install

deps-docs:
@gitbook install
@pip install --user mkdocs mkdocs-material jsx-lexer

# Rules for development

Expand All @@ -64,47 +69,40 @@ lint:
@npm run lint

docs: build-docs
gitbook serve
mkdocs serve

# Rules for build and publish

check-working-tree:
@sh ./scripts/repo_status

version:
@echo "[Updating react-modal version]"
@sh ./scripts/version $(CURRENT_VERSION)
@$(JQ) '.version' package.json | cut -d\" -f2 > .version

branch:
@echo "[Release from branch]"
@git branch | grep '^*' | awk '{ print $$2 }' > .branch
@[[ "`cat .branch`" != "master\n" ]] && echo "Current branch: `cat .branch`" || (echo "Fail. Current branch is not master." && exit 1)
@[[ ! -z "`git status -s`" ]] && \
echo "Stopping publish. There are change to commit or discard." && \
exit 1

changelog:
@echo "[Updating CHANGELOG.md $(CURRENT_VERSION) > `cat .version`]"
@python3 ./scripts/changelog.py v$(CURRENT_VERSION) v`cat .version` > .changelog_update
@echo "[Updating CHANGELOG.md $(CURRENT_VERSION)]"
@python3 ./scripts/changelog.py v$(CURRENT_VERSION) v$(VERSION) > .changelog_update
@cat .changelog_update CHANGELOG.md > tmp && mv tmp CHANGELOG.md
@rm .changelog_update

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

build: compile
@echo "[Building dists]"
@./node_modules/.bin/webpack --config ./scripts/webpack.dist.config.js
@npx webpack --config ./scripts/webpack.dist.config.js

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

release-tag:
git tag "v`cat .version`"
git tag "v$(VERSION)"

publish-version: release-commit release-tag
@echo "[Publishing]"
git push $(REMOTE) "`cat .branch`" "v`cat .version`"
git push $(REMOTE) "$(BRANCH)" "v$(VERSION)"
npm publish

pre-publish: clean branch version changelog
Expand All @@ -122,7 +120,7 @@ init-docs-repo:
build-docs:
@echo "[Building documentation]"
@rm -rf _book
@gitbook build -g reactjs/react-modal
@mkdocs build

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

Expand Down
184 changes: 0 additions & 184 deletions docs/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions docs/SUMMARY.md

This file was deleted.

12 changes: 5 additions & 7 deletions docs/accessibility/README.md → docs/accessibility/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
## Accessibility

react-modal aims to be fully accessible, using the
[WAI-ARIA](https://www.w3.org/WAI/intro/aria) guidelines to support users of
assistive technologies. This page describes some of react-modal's
accessibility-oriented features, along with their configuration options.

### The app element {#app-element}
### [The app element](#app-element)

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

```js
```jsx
Modal.setAppElement('#root');
```

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

```js
```jsx
Modal.setAppElement(document.getElementById('root'));
```

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

### Keyboard navigation {#keyboard}
### [Keyboard navigation](#keyboard)

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

### ARIA attributes {#aria}
### [ARIA attributes](#aria)

Besides the `aria-hidden` attribute which is applied to the app element when
the modal is shown, there are many other ARIA attributes which you can use to
Expand Down
18 changes: 8 additions & 10 deletions docs/contributing/development.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
### Development setup

`react-modal` uses `make` to build and publish new versions and documentation.

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

The minimun works as a normal `npm script`.
The minimun works as a normal `npm` scripts.

#### Usage
#### [Usage](#usage)

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

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

#### List of `npm` commands:
#### [List of `npm` or `yarn` commands](#npm-yarn-commands)

$ npm start -s or yarn start # to run examples
$ npm start
$ npm run tests
$ npm run lint

#### List of `make` commands:
#### [List of `make` commands](#make-commands)

$ make help # show all make commands available
$ make deps # npm install, gitbook plugins...
$ make serve # to run examples
$ make deps # npm install
$ make serve # start a examples' web server
$ make tests # use when developing
$ make tests-ci # single run
$ make lint # pass lint
$ make lint # execute lint
$ make publish # execute the entire pipeline to publish
$ make publish-docs # execute the pipeline for docs
Loading

0 comments on commit e5fe406

Please sign in to comment.