ModellingWebLab / WebLab

Django-based front-end for the modelling Web Lab v2
Other
3 stars 2 forks source link

add javascript markdown editor #377

Closed MauriceHendrix closed 2 years ago

MauriceHendrix commented 2 years ago

This PR just installs the SimpleMDE markdown editor, I thought I'd pull this out in a seperate PR as most files probably do not need reviewing. The only thing I changed slightly is simplemde.js (see comments on top as to what's changed)

codecov[bot] commented 2 years ago

Codecov Report

Merging #377 (261e8ae) into master (55f7870) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #377   +/-   ##
=======================================
  Coverage   95.22%   95.22%           
=======================================
  Files          68       68           
  Lines        3770     3770           
  Branches      388      388           
=======================================
  Hits         3590     3590           
  Misses        131      131           
  Partials       49       49           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1b211b4...261e8ae. Read the comment docs.

jonc125 commented 2 years ago

I'm missing here anything about how this is incorporated into the gulp build for use by HTML pages. Also, is there a reason npm can't be used to install this dependency, or libraries it in turn depends on?

MauriceHendrix commented 2 years ago

I'm missing here anything about how this is incorporated into the gulp build for use by HTML pages. Also, is there a reason npm can't be used to install this dependency, or libraries it in turn depends on?

I forgot to include the require statement (now included) Of course it's not used here, but that stuff is in the other PR.

Including source instead of installing via NPM, mostly because I wanted to change the way the library works with images. The default is that if you highlight a text say my image then it replaces that by ![](myimagehttp://) which is clearly inadequate. I instead added a dialog asking for url or file. Otherwise it was the closest I could find, to what I wanted.

A secondary reason for not using npm is that when I did try it before it didn't actually work, as in I still had to move the files to the correct folders manually anyway.

MauriceHendrix commented 2 years ago

Fine by me as long as it's OK with @jonc125 . Do we need to include any license info for these packages on the site somewhere?

good point the license does say that it needs to be included in modified or partial copies, so I included it inside the main js file.