您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CONTRIBUTING.md 1.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Contribution Guide
  2. You shouldn't edit the node class files (all files under `diagram` directory) by
  3. yourself.
  4. ## Resources
  5. ### Update nodes
  6. All node classes was auto-generated from image resource files. For example, the
  7. `diagram.aws.compute.EC2` class was auto-generated based on
  8. `resources/aws/compute/ec2.png` image resource file.
  9. So, if you want to add new node resources or update existing node resources, you
  10. can just add or update the image files in `resources/<provider>/<type>/<image>`.
  11. Images should be resized to fit a maximum of 256 pixels wide or high.
  12. ```shell
  13. # You can do that easily with ImageMagick
  14. convert -resize 256 my_big_image.jpg my_image.jpg
  15. # Or FFmpeg
  16. ffmpeg -i my_big_image.jpg -vf scale=w=256:h=256:force_original_aspect_ratio=decrease my_image.png
  17. ```
  18. Then just run the `./autogen.sh` to generate the added or updated node classes.
  19. > IMPORTANT NOTE: To run `autogen.sh`, you need [round][round] and
  20. > [inkscape][inkscape] command lines that are used for clearning the image
  21. > resource filenames.
  22. >
  23. > macOS users can download the inkscape via Homebrew.
  24. [round]: https://github.com/mingrammer/round
  25. [inkscape]: https://inkscape.org/ko/release
  26. ### Update Aliases
  27. Some node classes have alias. For example, `aws.compute.ECS` class is an alias
  28. of `aws.compute.ElasticContainerService` class. Aliases also were auto-generated
  29. from `ALIASES` map in [config.py](config.py).
  30. So, if you want to add new aliases or update existing aliases, you can just add
  31. or update the `ALIASES` map in [config.py](config.py).
  32. Then just run the `./autogen.sh` to generate the added or updated aliases.
  33. > IMPORTANT NOTE: To run `autogen.sh`, you need [round][round] and
  34. > [inkscape][inkscape] command lines that are used for clearning the image
  35. > resource filenames.
  36. ## Run Tests
  37. ```shell
  38. python -m unittest tests/*.py -v
  39. ```