Creating Diagrams
Context
Creating editable diagrams in open formats using open source tools is challenging. Here, we suggest Draw.io for creating diagrams and saving them directly in GitHub repository.
Creating new diagram
On Draw.io website choose Device as your storage.

Select the format of the diagram as XML
.drawio.

Create the diagram and save it on your local machine. Make sure you follow the file naming convention of lowercase with hyphens as word separations.
Fork
openg2p-documentationrepository to your Github account.Disable workflow in your repository fork:

On Github, upload/commit the
.drawiofile to your fork ofopeng2p-documentationrepository in the branch of choice to the following folder:.gitbook/assets.Send a Pull Request.
After the PR is merged on the upstream repo a Gitbook Action Workflow will get triggered to convert the same to PNG format with
*.pngextension. The PNG file will be available in the same folder as the.drawiofile. In this case, it will be the repository's.gitbook/assetsfolder.On Gitbook, insert the PNG image using the URL options shown by Gitbook. The URL to be given will be the GitHub URL e.g. https://github.com/OpenG2P/openg2p-documentation/raw/1.0.0/.gitbook/assets/add-deduplication-manager.png. Make sure you pick this URL in Raw format which will be available on the Download button on Github

Editing existing diagram
If a .drawio already exists in the .gitbook/assets folder then you must directly edit the repository version of the same by following the procedure given below.
Fork the
openg2p-documentationrepository to your local Github account. Disable workflow as shown above.On the Draw.io website choose Github as your storage.

Authorize the Draw.io app on Github (follow the steps prompted).
Select the diagram in
.drawioformat fromopeng2p-documentation--> your branch -->.gitbook/assestsfolder.

Make changes.
Save the diagram - it will get Git-committed to your repository.
Send a Pull Request to
OpenG2P/openg2p-documentationrepo.Upon acceptance of the Pull Request, a Github Action Workflow will trigger the conversion of the
.drawiofile to.png.If you have not added the URL of the PNG to your Gitbook pages follow step 6 of Creating New Diagram.
If the URL already exists in Gitbook, the updated image should appear after a page refresh.
Deleting a digram
Delete the diagram from Gitbook listing found here:

Delete the diagram from Github repository
openg2p-documentationfrom the corresponding branch
Last updated