You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CONTRIBUTING.md 2.4 KiB

4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Contribution Guide
  2. You shouldn't edit the node class files (all files under `diagrams/` directory) by
  3. yourself.
  4. ## Set up your environment
  5. * See [DEVELOPMENT][DEVELOPMENT.md]
  6. ## Resources
  7. ### Update nodes
  8. All node classes was auto-generated from image resource files. For example, the
  9. `diagram.aws.compute.EC2` class was auto-generated based on
  10. `resources/aws/compute/ec2.png` image resource file.
  11. So, if you want to add new node resources or update existing node resources, you
  12. can just add or update the image files in `resources/<provider>/<type>/<image>`.
  13. Images should be resized to fit a maximum of 256 pixels wide or high.
  14. ```shell
  15. # You can do that easily with ImageMagick
  16. convert -resize 256 my_big_image.jpg my_image.jpg
  17. # Or FFmpeg
  18. ffmpeg -i my_big_image.jpg -vf scale=w=256:h=256:force_original_aspect_ratio=decrease my_image.png
  19. ```
  20. Then just run the `./autogen.sh` to generate the added or updated node classes. (cf. [DEVELOPMENT][DEVELOPMENT.md])
  21. > IMPORTANT NOTE: To run `autogen.sh`, you need [round][round] and
  22. > [inkscape][inkscape] command lines that are used for cleaning the image
  23. > resource filenames.
  24. >
  25. > macOS users can download the inkscape via Homebrew.
  26. >
  27. > Or you should use the docker image.
  28. [DEVELOPMENT.md]: ./DEVELOPMENT.md
  29. [round]: https://github.com/mingrammer/round
  30. [inkscape]: https://inkscape.org/ko/release
  31. ### Update Aliases
  32. Some node classes have alias. For example, `aws.compute.ECS` class is an alias
  33. of `aws.compute.ElasticContainerService` class. Aliases also were auto-generated
  34. from `ALIASES` map in [config.py](config.py).
  35. So, if you want to add new aliases or update existing aliases, you can just add
  36. or update the `ALIASES` map in [config.py](config.py).
  37. Then just run the `./autogen.sh` to generate the added or updated aliases. (cf. [DEVELOPMENT][DEVELOPMENT.md])
  38. > IMPORTANT NOTE: To run `autogen.sh`, you need [round][round] and
  39. > [inkscape][inkscape] command lines that are used for clearning the image
  40. > resource filenames.
  41. >
  42. > Or you should use the docker image.
  43. ## Run Tests
  44. ```shell
  45. python -m unittest tests/*.py -v
  46. ```
  47. ## Testing changes to the website
  48. The [Docusaurus](https://docusaurus.io/)-based documentation website can be run by installing dependencies, then simply running `npm run start`.
  49. ```bash
  50. cd website/
  51. npm i
  52. npm run start
  53. ```
  54. The website will be available on [http://localhost:3000](http://localhost:3000).
  55. Edit files in `website/` and `docs/` respectively to edit documentation.