Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draw.io integration #632

Merged
merged 11 commits into from
Jan 28, 2018
Merged

draw.io integration #632

merged 11 commits into from
Jan 28, 2018

Conversation

ssddanbrown
Copy link
Member

@ssddanbrown ssddanbrown commented Dec 24, 2017

Relates to #619.

Very much a WIP at time of creating pull request.

TODO

  • Add updating of existing images.
  • Implement within markdown editor.
  • Add some basic testing to new endpoints.

@Abijeet
Copy link
Member

Abijeet commented Dec 26, 2017

This looks good to me, I'll test this on my end once you are done.

@@ -220,6 +220,124 @@ function codePlugin() {
}
codePlugin();

function drawIoPlugin() {

const drawIoUrl = 'https://www.draw.io/?embed=1&ui=atlas&spin=1&proto=json';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be user configurable in case a self-hosted version is preferred.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first it will not be as I don't really know how/if self-hosted instances provide the same level & ease of integration via a public url such as this. I doubt they would otherwise it could be used by anybody.

Copy link

@Kdecherf Kdecherf Jan 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default self-hosted instance is a static one (check https://github.com/jgraph/drawio#running) which does not provide any integration (Google Drive, Dropbox, …). Also you must specify https=0 in query string if your own instance does not support TLS.

This lack of integration is not really important if files are saved as attachments inside Bookstack.

@ssddanbrown
Copy link
Member Author

Okay, This is now complete with some basic tests to cover so will merge into master for next release.
Feel free to raise any issues for problems and bugs found, I'm sure there'll be a few I've not found.

There's a couple of limitations with the current implementation:

  • For the markdown editor HTML is used to standardise the format used to recognise drawings. Think this is okay, Better than ignoring the markdown editor, but some may not like HTML in their markdown.
  • Updating an drawing will update the drawing file/upload straight away, Not upon saving of the page. In the future it will probably be best to flesh this out with an image-manager-like implementation which will version drawing changes and retain old copies but what we have now is a good start.

@ssddanbrown ssddanbrown merged commit 1d1cc19 into master Jan 28, 2018
@ssddanbrown ssddanbrown deleted the draw.io branch January 28, 2018 13:39
This was referenced Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants