diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..929e1ca --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,73 @@ +# Contributing + +When contributing to this repository, please first discuss the change you wish to make via issue, +email, or any other method with the owners of this repository before making a change. + +Please note we have a code of conduct, please follow it in all your interactions with the project. + +## Pull Request Process + +Pull requests are always welcome. + +1. Fork this repository +2. Create branch: `git checkout -b my-new-feature` +3. Test `docx-core`: `make test && make lint` +4. Update snapshot test result (If needed): `cargo-insta review` +5. Test `docx-wasm`: `cd docx-wasm && yarn install && yarn test` +6. Update snapshot test result (If needed): `cd docx-wasm & yarn test -- --updateSnapshot` +7. Push: `git push origin my-new-feature` +8. Send PR :) + +## Code of Conduct + +### Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +### Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +### Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. diff --git a/README.md b/README.md index 7f7f01d..120d9e0 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ docx-rs = "0.2" ### Browser/Node.js ``` -yarn add docx-wasm +$ yarn add docx-wasm ``` ## Example @@ -84,6 +84,69 @@ writeFileSync("hello.docx", buffer); - [Image](https://github.com/bokuweb/docx-rs/blob/master/docx-core/examples/image_inline.rs) - [History](https://github.com/bokuweb/docx-rs/blob/master/docx-core/examples/history.rs) +## Development + +### Requirements + +- Node.js 16+ +- yarn 1+ +- wasm-pack (https://rustwasm.github.io/wasm-pack/) +- insta (https://github.com/mitsuhiko/insta) + +### Examples + +You can run example with following code. +Please see `examples` directory. + +``` sh +$ cargo run --example [EXAMPLE_NAME] +``` + +For Example if you want to run `hello` example. +Please run following command. + +``` sh +$ cargo run --example hello +``` + +So you can see output file in output directory. + +### Testing + +#### Rust + +Please run following command. + +``` +make lint && make test +``` + +If snapshot testing is failed, fix code or update snapshot files. (See https://insta.rs/). + +``` +$ cargo-insta review +``` + +Then re run test. + +``` +$ make test +``` + +#### Wasm + +Please run following command. + +``` +$ cd docx-wasm && yarn install && yarn test +``` + +If snapshot testing is failed, fix code or update snapshot files. (See https://jestjs.io/docs/snapshot-testing). + +``` +$ yarn test -- --updateSnapshot +``` + ## Features - [x] Paragraph