Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CONTRIBUTING.md 2.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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], [black][black] and
  22. > [inkscape][inkscape] command lines that are used for cleaning the image
  23. > resource filenames and formatting the generated python code.
  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. [black]: https://pypi.org/project/black
  31. [inkscape]: https://inkscape.org/ko/release
  32. ### Update Aliases
  33. Some node classes have alias. For example, `aws.compute.ECS` class is an alias
  34. of `aws.compute.ElasticContainerService` class. Aliases also were auto-generated
  35. from `ALIASES` map in [config.py](config.py).
  36. So, if you want to add new aliases or update existing aliases, you can just add
  37. or update the `ALIASES` map in [config.py](config.py).
  38. Then just run the `./autogen.sh` to generate the added or updated aliases. (cf. [DEVELOPMENT][DEVELOPMENT.md])
  39. > IMPORTANT NOTE: To run `autogen.sh`, you need [round][round] and
  40. > [inkscape][inkscape] command lines that are used for clearning the image
  41. > resource filenames.
  42. >
  43. > Or you should use the docker image.
  44. ## Run Tests
  45. ```shell
  46. python -m unittest tests/*.py -v
  47. ```
  48. ## Testing changes to the website
  49. The [Docusaurus](https://docusaurus.io/)-based documentation website can be run by installing dependencies, then simply running `npm run start`.
  50. ```bash
  51. cd website/
  52. npm i
  53. npm run start
  54. ```
  55. The website will be available on [http://localhost:3000](http://localhost:3000).
  56. Edit files in `website/` and `docs/` respectively to edit documentation.