Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

CONTRIBUTING.md 2.2 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Contribution Guide
  2. You shouldn't edit the node class files (all files under `diagrams/` 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 cleaning 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. ```
  40. ## Testing changes to the website
  41. The [Docusaurus](https://docusaurus.io/)-based documentation website can be run by installing dependencies, then simply running `npm run start`.
  42. ```bash
  43. cd website/
  44. npm i
  45. npm run start
  46. ```
  47. The website will be available on [http://localhost:3000](http://localhost:3000).
  48. Edit files in `website/` and `docs/` respectively to edit documentation.