You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.0 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. ## Contributing
  2. * Pull requests are welcome
  3. * Please `don't include dist/* files` on your commits.
  4. ## Coding convention
  5. * eslint: https://eslint.org
  6. * eslint rule: https://github.com/summernote/summernote/blob/master/.eslintrc
  7. ## Build summernote
  8. ```bash
  9. npm install
  10. # build full version of summernote: dist/summernote.js
  11. npm run build
  12. # generate minified copy: dist/summernote.min.js, dist/summernote.css
  13. npm run dist
  14. ```
  15. At this point, you should now have a `build/` directory populated with everything you need to use summernote.
  16. ## Start local server for developing summernote.
  17. run local server with connect and watch.
  18. ```bash
  19. npm run start
  20. # Open a browser on http://localhost:3000.
  21. # If you change source code, automatically reload your page.
  22. ```
  23. ## Test summernote
  24. run tests with Karma and PhantomJS
  25. ```bash
  26. npm run test
  27. ```
  28. If you want run tests on other browser,
  29. change the values for `broswers` properties in `karma.conf.js`.
  30. ```
  31. karma: {
  32. all: {
  33. browsers: ['PhantomJS'],
  34. reporters: ['progress']
  35. }
  36. }
  37. ```
  38. You can use `Chrome`, `ChromeCanary`, `Firefox`, `Opera`, `Safari`, `PhantomJS` and `IE` beside `PhantomJS`.
  39. Once you run `npm test`, it will watch all javascript file. Therefore karma run tests every time you change code.
  40. ## Prepush Hooks
  41. As part of this repo, we use the NPM package husky to implement git hooks. We leverage the prepush hook to prevent bad commits.
  42. ## Document structure
  43. ```
  44. - body container: <div class="note-editable">, <td>, <blockquote>, <ul>
  45. - block node: <div>, <p>, <li>, <h1>, <table>
  46. - void block node: <hr>
  47. - inline node: <span>, <b>, <font>, <a>, ...
  48. - void inline node: <img>
  49. - text node: #text
  50. ```
  51. 1. A body container has block node, but `<ul>` has only `<li>` nodes.
  52. 2. A body container also has inline nodes sometimes. This inline nodes will be wrapped with `<p>` when enter key pressed.
  53. 4. A block node only has inline nodes.
  54. 5. A inline nodes has another inline nodes
  55. 6. `#text` and void inline node doesn't have children.