Browse Source

chore: release version v0.2.0

main v0.2.0
Inhji Y. 9 months ago
parent
commit
b7ab53e5e1
  1. 11
      CHANGELOG.md
  2. 17
      assets/css/app.scss
  3. 7
      assets/js/app.js
  4. 345
      assets/package-lock.json
  5. 5
      assets/package.json
  6. 41
      config/dev.exs
  7. 2
      lib/mirage/notes/note.ex
  8. 6
      lib/mirage/settings.ex
  9. 3
      lib/mirage/settings/setting.ex
  10. 4
      lib/mirage_web/templates/note/form.html.eex
  11. 2
      lib/mirage_web/templates/note/index.html.eex
  12. 2
      lib/mirage_web/templates/note/show.html.eex
  13. 4
      lib/mirage_web/templates/setting/form.html.eex
  14. 2
      lib/mirage_web/templates/setting/show.html.eex
  15. 5
      mix.exs
  16. 5
      mix.lock

11
CHANGELOG.md

@ -0,0 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](Https://conventionalcommits.org) for commit guidelines.
<!-- changelog -->
## [v0.2.0](https://git.inhji.de/inhji/mirage/compare/v0.2.0...v0.2.0) (2021-02-05)

17
assets/css/app.scss

@ -2,7 +2,6 @@
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans&family=Playfair+Display&display=swap');
@import "~minireset.css/minireset.css";
@import "~trix/dist/trix.css";
@import "./phoenix";
@import "./nprogress";
@ -155,19 +154,9 @@ button[type=submit], a.button {
}
}
trix-toolbar {
.trix-button {
background: white;
}
.trix-button-group {
border-radius: 0;
}
}
trix-editor {
border-radius: 0;
margin-bottom: 1rem;
#editor {
border: 1px solid white;
margin-bottom: 2rem;
}
/* === Content === */

7
assets/js/app.js

@ -12,11 +12,11 @@ import "../css/app.scss"
// import {Socket} from "phoenix"
// import socket from "./socket"
//
import "trix"
import "phoenix_html"
import {Socket} from "phoenix"
import NProgress from "nprogress"
import {LiveSocket} from "phoenix_live_view"
import initEditor from "./editor.js"
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
@ -34,3 +34,8 @@ liveSocket.connect()
// >> liveSocket.disableLatencySim()
window.liveSocket = liveSocket
const element = "#editor"
if (document.querySelector(element)) {
initEditor(element)
}

345
assets/package-lock.json

@ -995,6 +995,285 @@
"to-fast-properties": "^2.0.0"
}
},
"@codemirror/autocomplete": {
"version": "0.17.4",
"resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-0.17.4.tgz",
"integrity": "sha512-fni2OJC1aStMeQaQQE9lMSJAntWoDeGucLMGbf8XZrTNxZR1IoWKLXBy9YoA0CQfJX/VNnJljNG7WRvwxHmBiQ==",
"requires": {
"@codemirror/language": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/text": "^0.17.0",
"@codemirror/tooltip": "^0.17.0",
"@codemirror/view": "^0.17.0",
"lezer-tree": "^0.13.0"
}
},
"@codemirror/basic-setup": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/basic-setup/-/basic-setup-0.17.1.tgz",
"integrity": "sha512-d17H3bcseOia/YxT4Zfqn455wBRfbs3aKFAg9+FoP11BeQLFAqxiDIXtbwtfFbNx4rUvtmHkzeaMUZHNEp5ZSQ==",
"requires": {
"@codemirror/autocomplete": "^0.17.0",
"@codemirror/closebrackets": "^0.17.0",
"@codemirror/commands": "^0.17.0",
"@codemirror/comment": "^0.17.0",
"@codemirror/fold": "^0.17.0",
"@codemirror/gutter": "^0.17.0",
"@codemirror/highlight": "^0.17.0",
"@codemirror/history": "^0.17.0",
"@codemirror/language": "^0.17.0",
"@codemirror/lint": "^0.17.0",
"@codemirror/matchbrackets": "^0.17.0",
"@codemirror/rectangular-selection": "^0.17.0",
"@codemirror/search": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/closebrackets": {
"version": "0.17.2",
"resolved": "https://registry.npmjs.org/@codemirror/closebrackets/-/closebrackets-0.17.2.tgz",
"integrity": "sha512-0ljN56AW9Iu3uATSZESPt2MuPXpZwB9PKCK0liO9Ei1MXba//SDkzDaYeoIjlVLTxUaGbVo77fsh7+rrY28hLg==",
"requires": {
"@codemirror/language": "^0.17.0",
"@codemirror/rangeset": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/text": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/commands": {
"version": "0.17.2",
"resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-0.17.2.tgz",
"integrity": "sha512-FT2wMrf6Jtrbmb0WqXaAO0B7BvjmzEmsJwZSS46UiC8S5/asXA7hjaFdB9hZUDxtuZ/bsVScvKUVoq7vzXxT7g==",
"requires": {
"@codemirror/language": "^0.17.0",
"@codemirror/matchbrackets": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/text": "^0.17.0",
"@codemirror/view": "^0.17.0",
"lezer-tree": "^0.13.0"
}
},
"@codemirror/comment": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/comment/-/comment-0.17.1.tgz",
"integrity": "sha512-dRYCRMU8NEe4mbL00AU4Zr8DYqYC5kL2bg28wBSURKYYKtTv3c7KsvdwU/Ggj8pDFcW0TIaKt1DfSKH6RDfaQw==",
"requires": {
"@codemirror/state": "^0.17.0",
"@codemirror/text": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/fold": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/fold/-/fold-0.17.1.tgz",
"integrity": "sha512-G0j7AyZtcDQy/Vh7MQgIZIYcTJX6BuSa8NcxE82sDtpEDdogavBkjZxEE/lRZyZnHDmmaVgVSp53fzOo9TS6Hw==",
"requires": {
"@codemirror/gutter": "^0.17.0",
"@codemirror/language": "^0.17.0",
"@codemirror/rangeset": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/gutter": {
"version": "0.17.2",
"resolved": "https://registry.npmjs.org/@codemirror/gutter/-/gutter-0.17.2.tgz",
"integrity": "sha512-kyfuNVg3B+yS9U3aNMK/AQ0NyOswOep8lrbldBL4BWXZ8mFzSifT3WNK887WYrEIhqeLjq5qjcsJgFyGrFR0Lg==",
"requires": {
"@codemirror/rangeset": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/highlight": {
"version": "0.17.2",
"resolved": "https://registry.npmjs.org/@codemirror/highlight/-/highlight-0.17.2.tgz",
"integrity": "sha512-KmSOCHjPv7yO9NAtQnqCNwjLHVwFh9InMwul0+JSsor1qLfBR1ljlmqLr7KUe9WWRnM7oD/eSuwF5uNpGtuaNw==",
"requires": {
"@codemirror/language": "^0.17.0",
"@codemirror/rangeset": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0",
"lezer-tree": "^0.13.0",
"style-mod": "^3.2.0"
}
},
"@codemirror/history": {
"version": "0.17.2",
"resolved": "https://registry.npmjs.org/@codemirror/history/-/history-0.17.2.tgz",
"integrity": "sha512-ML/FA6VJMMwsQrx7HFXaOAg/LqrLxUktE5pu230UOn0u5bxIPxbX0lLGs34994s9HPruqbCqIikSc+IfjLkFcA==",
"requires": {
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/lang-css": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-0.17.1.tgz",
"integrity": "sha512-IwH22Fu7oW3o9jtZsQV9aNZ4w2S4xktlVoJ08Z8VmnXe2Nlb7okQWPibtpryIfe4LGcmdN/n6YTpGjkveC8BEA==",
"requires": {
"@codemirror/autocomplete": "^0.17.0",
"@codemirror/highlight": "^0.17.0",
"@codemirror/language": "^0.17.0",
"@codemirror/state": "^0.17.0",
"lezer-css": "^0.13.0",
"lezer-tree": "^0.13.0"
}
},
"@codemirror/lang-html": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-0.17.1.tgz",
"integrity": "sha512-7c1jXtN4cwT7LyW4bdNuinP/xx/J94P2Xkrm1LSyuR4cJk/4iYYlQcxsClJapyJCqP+rmAk8BEcDc49w2Kh46A==",
"requires": {
"@codemirror/autocomplete": "^0.17.0",
"@codemirror/highlight": "^0.17.0",
"@codemirror/lang-css": "^0.17.0",
"@codemirror/lang-javascript": "^0.17.0",
"@codemirror/language": "^0.17.0",
"@codemirror/state": "^0.17.0",
"lezer-html": "^0.13.0",
"lezer-tree": "^0.13.0"
}
},
"@codemirror/lang-javascript": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-0.17.1.tgz",
"integrity": "sha512-+48Yl+1WHvTnPqIjaKw5Yvif6v0lJLcvcIrgDjKt7An50gWPhZa18J0V4En4gFHybYbmIp9lsd1omvwh5EDcPg==",
"requires": {
"@codemirror/autocomplete": "^0.17.0",
"@codemirror/highlight": "^0.17.0",
"@codemirror/language": "^0.17.0",
"@codemirror/lint": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0",
"lezer-javascript": "^0.13.0"
}
},
"@codemirror/lang-markdown": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/lang-markdown/-/lang-markdown-0.17.1.tgz",
"integrity": "sha512-i48Fl3AWvwc7AhGIwCBAZuzia2CRzibKl3VLujk2S10F7q3L43jYXuIDNzXEHvLXrCmlFOXAaCr4w9xcRlL6Lg==",
"requires": {
"@codemirror/highlight": "^0.17.0",
"@codemirror/lang-html": "^0.17.0",
"@codemirror/language": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0",
"lezer-markdown": "^0.13.0",
"lezer-tree": "^0.13.0"
}
},
"@codemirror/language": {
"version": "0.17.4",
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-0.17.4.tgz",
"integrity": "sha512-PAYrnmc1GaUcWjnxydbrhrMUYl/biIv4/fCJdInwHdox7f3WOdOhYwST/B803xVBzlse8spJo2M1+syMxJPM5w==",
"requires": {
"@codemirror/state": "^0.17.0",
"@codemirror/text": "^0.17.0",
"@codemirror/view": "^0.17.0",
"lezer": "^0.13.0",
"lezer-tree": "^0.13.0"
}
},
"@codemirror/lint": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-0.17.1.tgz",
"integrity": "sha512-Jzhf3g+hIr8frQaLsRSYJgM3BFVt7qQ59J0l/oqkjx8LsqYn0zbCM6zHnKMC0lOUdZXf7O8D24jTmVJb/8n4YQ==",
"requires": {
"@codemirror/panel": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/tooltip": "^0.17.0",
"@codemirror/view": "^0.17.0",
"crelt": "^1.0.5"
}
},
"@codemirror/matchbrackets": {
"version": "0.17.2",
"resolved": "https://registry.npmjs.org/@codemirror/matchbrackets/-/matchbrackets-0.17.2.tgz",
"integrity": "sha512-E4TP7lNXk7VtmvvKYH59yNx0lf5ubv7iv0Ok0uWCjxm+RIPnXiOdRoNI7rxITJcgNROOyKnuKsd6AAnmuXxDEQ==",
"requires": {
"@codemirror/language": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0",
"lezer-tree": "^0.13.0"
}
},
"@codemirror/panel": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/panel/-/panel-0.17.1.tgz",
"integrity": "sha512-2it2Sk02eF4WFwPVoRLhr9lPGq9lwwwHZFyb4olqI6tOyTPwk6leZ4ntabYrhvjRc7gD6S6vM14KhOtjm4hjqg==",
"requires": {
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/rangeset": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/rangeset/-/rangeset-0.17.1.tgz",
"integrity": "sha512-Qv8a8C5CZiUdXGvxniWdULJzXDiz5uSP5ddHFEmekGa9nNVCgdr05nH7R+h3NgJ2P40UEEOPykqXZyy8EHGggw==",
"requires": {
"@codemirror/state": "^0.17.0"
}
},
"@codemirror/rectangular-selection": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/rectangular-selection/-/rectangular-selection-0.17.1.tgz",
"integrity": "sha512-mM6LjEiwcnj/NArVMTfMATuO35FDF9B1xCrqMlXTB/KxCXwFcGO/r8AccBV+ehR2Y+k7zlvfNvEVNi1SjP1Hfg==",
"requires": {
"@codemirror/state": "^0.17.0",
"@codemirror/text": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/search": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/search/-/search-0.17.1.tgz",
"integrity": "sha512-wY0KP9my/0uKQk9AU39EqmkY6zMVv2Erej5b1rRBksM78JZXzjNUl4gyhtx1/0om84IZ1ocmW8MRElkAY6r1rw==",
"requires": {
"@codemirror/panel": "^0.17.0",
"@codemirror/rangeset": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/text": "^0.17.0",
"@codemirror/view": "^0.17.0",
"crelt": "^1.0.5"
}
},
"@codemirror/state": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@codemirror/state/-/state-0.17.1.tgz",
"integrity": "sha512-ELgxzackFVC+wBWpGJGFN6OJ+uIdHrgj4BEh6qooju7U5Mdd1bM594QPGzNMRu3uXjfGj7ANHTATRPc0nnQRfA==",
"requires": {
"@codemirror/text": "^0.17.0"
}
},
"@codemirror/text": {
"version": "0.17.2",
"resolved": "https://registry.npmjs.org/@codemirror/text/-/text-0.17.2.tgz",
"integrity": "sha512-KL+cM+uJPW5skyuTRoW43lOaSQq3YDNEPx5z0V/9Wsz9R9dK4kVP5NIRMUFgl9MUCQ9UxIotvgPDpz65j9wjuA=="
},
"@codemirror/tooltip": {
"version": "0.17.2",
"resolved": "https://registry.npmjs.org/@codemirror/tooltip/-/tooltip-0.17.2.tgz",
"integrity": "sha512-Ux2lKYzTUCiAluu3PJj78e58eGQeCRaFWpzn8pg4KQIFxSVyZoCv5VWcIp/1i4bLGyrUWDWwP0CAxGq759AwaQ==",
"requires": {
"@codemirror/state": "^0.17.0",
"@codemirror/view": "^0.17.0"
}
},
"@codemirror/view": {
"version": "0.17.7",
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-0.17.7.tgz",
"integrity": "sha512-OK+eNbcNXdlam7epFG5p5caH+3OoOlcRHy5S954VDUjOlUEMFUtwWjHa9WqaKEGvFwIgsG3AQQVstRQtyexRuQ==",
"requires": {
"@codemirror/rangeset": "^0.17.0",
"@codemirror/state": "^0.17.0",
"@codemirror/text": "^0.17.0",
"style-mod": "^3.2.0",
"w3c-keyname": "^2.2.4"
}
},
"@types/json-schema": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz",
@ -2431,6 +2710,11 @@
"sha.js": "^2.4.8"
}
},
"crelt": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz",
"integrity": "sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA=="
},
"cross-spawn": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz",
@ -4474,6 +4758,52 @@
"webpack-sources": "^1.1.0"
}
},
"lezer": {
"version": "0.13.1",
"resolved": "https://registry.npmjs.org/lezer/-/lezer-0.13.1.tgz",
"integrity": "sha512-aDX9OHYWQFt3s7C0IEil//Lckxbr02dCRyxB/uTxVuZjBsNHnUJ8Y83OgDi+uNFwRsexhdoMF0/PSvmky/Fg/g==",
"requires": {
"lezer-tree": "^0.13.0"
}
},
"lezer-css": {
"version": "0.13.1",
"resolved": "https://registry.npmjs.org/lezer-css/-/lezer-css-0.13.1.tgz",
"integrity": "sha512-ke56tjG17IZ+EFiY50P2WinjhgZQB7OecRVZmYQbVuwv5iUdLemA4vLjaFsAbgoSg+4pfOms7Ns9nItoJcmFpg==",
"requires": {
"lezer": "^0.13.0"
}
},
"lezer-html": {
"version": "0.13.2",
"resolved": "https://registry.npmjs.org/lezer-html/-/lezer-html-0.13.2.tgz",
"integrity": "sha512-etP3qxtEyjCoF2Y4hm5ISA/uWmm4cya5MGsZnddYCwO0Rnkjn8L3xJjhijAiGbehxU7thRD72RVs9ISW7r8Jeg==",
"requires": {
"lezer": "^0.13.0"
}
},
"lezer-javascript": {
"version": "0.13.2",
"resolved": "https://registry.npmjs.org/lezer-javascript/-/lezer-javascript-0.13.2.tgz",
"integrity": "sha512-88NBkJLeohyyvGVRh8LtvTwoh5V88XoK9plFNnJnByIu7UQD4zmgvX631Sw0XDuwK1C1ePhn3inRa0xAM0eujA==",
"requires": {
"lezer": "^0.13.0"
}
},
"lezer-markdown": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/lezer-markdown/-/lezer-markdown-0.13.0.tgz",
"integrity": "sha512-NrWO7skcqqWAr1ui8x1Sh1vMIYlE8re4bpMcno+8/V0zsjPSKgfFqNb9NB9tUK4PJpObJab7+VG1WmCncQrLUg==",
"requires": {
"lezer-html": "^0.13.0",
"lezer-tree": "^0.13.0"
}
},
"lezer-tree": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/lezer-tree/-/lezer-tree-0.13.0.tgz",
"integrity": "sha512-YqGD22WxQmT6np2JEX5Z+zhdBSfPEcQ8B6ct+39oLzSAHecUPUd/maN5PKNtnUZbSzd81mEx1ZqzMDA1eRSRcg=="
},
"load-json-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
@ -7169,6 +7499,11 @@
"get-stdin": "^4.0.1"
}
},
"style-mod": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/style-mod/-/style-mod-3.2.1.tgz",
"integrity": "sha512-cQerrMLHjR/fxC4DWC2dRrXc11hvsM7lJ2vtuMOHWU5IG7Deu5RfTbttjbY4xiRAWs3gFIZZFf694jzNPW1Ehw=="
},
"stylehacks": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz",
@ -7415,11 +7750,6 @@
"integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=",
"dev": true
},
"trix": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/trix/-/trix-1.3.1.tgz",
"integrity": "sha512-BbH6mb6gk+AV4f2as38mP6Ucc1LE3OD6XxkZnAgPIduWXYtvg2mI3cZhIZSLqmMh9OITEpOBCCk88IVmyjU7bA=="
},
"true-case-path": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz",
@ -7725,6 +8055,11 @@
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
"dev": true
},
"w3c-keyname": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.4.tgz",
"integrity": "sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw=="
},
"watchpack": {
"version": "1.7.5",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz",

5
assets/package.json

@ -7,12 +7,13 @@
"watch": "webpack --mode development --watch"
},
"dependencies": {
"@codemirror/basic-setup": "^0.17.1",
"@codemirror/lang-markdown": "^0.17.1",
"minireset.css": "0.0.6",
"nprogress": "^0.2.0",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html",
"phoenix_live_view": "file:../deps/phoenix_live_view",
"trix": "^1.3.1"
"phoenix_live_view": "file:../deps/phoenix_live_view"
},
"devDependencies": {
"@babel/core": "^7.0.0",

41
config/dev.exs

@ -30,29 +30,24 @@ config :mirage, MirageWeb.Endpoint,
]
]
# ## SSL Support
#
# In order to use HTTPS in development, a self-signed
# certificate can be generated by running the following
# Mix task:
#
# mix phx.gen.cert
#
# Note that this task requires Erlang/OTP 20 or later.
# Run `mix help phx.gen.cert` for more information.
#
# The `http:` config above can be replaced with:
#
# https: [
# port: 4001,
# cipher_suite: :strong,
# keyfile: "priv/cert/selfsigned_key.pem",
# certfile: "priv/cert/selfsigned.pem"
# ],
#
# If desired, both `http:` and `https:` keys can be
# configured to run both http and https servers on
# different ports.
config :git_ops,
mix_project: Mix.Project.get!(),
changelog_file: "CHANGELOG.md",
repository_url: "https://git.inhji.de/inhji/mirage",
types: [
# Makes an allowed commit type called `important` that gets
# a section in the changelog with the header "Important Changes"
ref: [
header: "Refactors"
]
],
# Instructs the tool to manage your mix version in your `mix.exs` file
# See below for more information
manage_mix_version?: true,
# Instructs the tool to manage the version in your README.md
# Pass in `true` to use `"README.md"` or a string to customize
manage_readme_version: "README.md",
version_tag_prefix: "v"
# Watch static and templates for browser reloading.
config :mirage, MirageWeb.Endpoint,

2
lib/mirage/notes/note.ex

@ -5,6 +5,7 @@ defmodule Mirage.Notes.Note do
schema "notes" do
field :title, :string
field :content, :string
field :content_html, :string
has_many :links, Mirage.Notes.Link
@ -16,5 +17,6 @@ defmodule Mirage.Notes.Note do
note
|> cast(attrs, [:content, :title])
|> validate_required([:content, :title])
|> Mirage.Markdown.maybe_render_markdown(:content, :content_html)
end
end

6
lib/mirage/settings.ex

@ -22,8 +22,10 @@ defmodule Mirage.Settings do
end
def list_settings_as_map do
Repo.all(Setting)
|> Enum.map(fn s -> {String.to_atom(s.name), s.value} end)
list_settings()
|> Enum.map(fn s ->
{String.to_atom(s.name), s.value_html}
end)
|> Map.new()
end

3
lib/mirage/settings/setting.ex

@ -5,6 +5,7 @@ defmodule Mirage.Settings.Setting do
schema "settings" do
field :name, :string
field :value, :string
field :value_html, :string
timestamps()
end
@ -14,7 +15,7 @@ defmodule Mirage.Settings.Setting do
setting
|> cast(attrs, [:name, :value])
|> validate_required([:name, :value])
|> validate_length(:value, max: 255)
|> unique_constraint(:name)
|> Mirage.Markdown.maybe_render_markdown(:value, :value_html)
end
end

4
lib/mirage_web/templates/note/form.html.eex

@ -8,8 +8,8 @@
<%= text_input f, :title %>
<%= error_tag f, :title %>
<%= hidden_input f, :content %>
<trix-editor input="note_content" class="content html"></trix-editor>
<%= hidden_input f, :content, class: "editor-content" %>
<div id="editor"></div>
<%= error_tag f, :content %>
<div>

2
lib/mirage_web/templates/note/index.html.eex

@ -7,7 +7,7 @@
<h2><%= note.title %></h2>
<div class="content html">
<%= raw note.content %>
<%= Earmark.as_html!(note.content) |> raw %>
</div>
<%= render "_note_meta.html", conn: @conn, note: note %>

2
lib/mirage_web/templates/note/show.html.eex

@ -5,7 +5,7 @@
<article>
<div class="content html">
<%= raw @note.content %>
<%= Earmark.as_html!(@note.content) |> raw %>
</div>
</article>

4
lib/mirage_web/templates/setting/form.html.eex

@ -7,8 +7,8 @@
<%= hidden_input f, :name, readonly: true %>
<%= hidden_input f, :value %>
<trix-editor input="setting_value"></trix-editor>
<%= hidden_input f, :value, class: "editor-content" %>
<div id="editor"></div>
<%= error_tag f, :value %>
<div>

2
lib/mirage_web/templates/setting/show.html.eex

@ -3,7 +3,7 @@
</div>
<div class="content html">
<%= raw @setting.value %>
<%= raw @setting.value_html %>
</div>
<%= link "Edit", to: Routes.setting_path(@conn, :edit, @setting), class: "button" %>

5
mix.exs

@ -4,7 +4,7 @@ defmodule Mirage.MixProject do
def project do
[
app: :mirage,
version: "0.1.0",
version: "0.2.0",
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
@ -34,9 +34,11 @@ defmodule Mirage.MixProject do
defp deps do
[
{:bcrypt_elixir, "~> 2.0"},
{:earmark, "~> 1.4"},
{:ecto_sql, "~> 3.4"},
{:floki, ">= 0.27.0", only: :test},
{:gettext, "~> 0.11"},
{:git_ops, "~> 2.4.2", only: [:dev]},
{:jason, "~> 1.0"},
{:phoenix, "~> 1.5.6"},
{:phoenix_ecto, "~> 4.1"},
@ -61,6 +63,7 @@ defmodule Mirage.MixProject do
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
rel: ["git_ops.release"],
setup: ["deps.get", "ecto.setup", "cmd npm install --prefix assets"],
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],

5
mix.lock

@ -9,12 +9,16 @@
"cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"},
"db_connection": {:hex, :db_connection, "2.3.1", "4c9f3ed1ef37471cbdd2762d6655be11e38193904d9c5c1c9389f1b891a3088e", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm", "abaab61780dde30301d840417890bd9f74131041afd02174cf4e10635b3a63f5"},
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"earmark": {:hex, :earmark, "1.4.13", "2c6ce9768fc9fdbf4046f457e207df6360ee6c91ee1ecb8e9a139f96a4289d91", [:mix], [{:earmark_parser, ">= 1.4.12", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "a0cf3ed88ef2b1964df408889b5ecb886d1a048edde53497fc935ccd15af3403"},
"earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"},
"ecto": {:hex, :ecto, "3.5.5", "48219a991bb86daba6e38a1e64f8cea540cded58950ff38fbc8163e062281a07", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "98dd0e5e1de7f45beca6130d13116eae675db59adfa055fb79612406acf6f6f1"},
"ecto_sql": {:hex, :ecto_sql, "3.5.3", "1964df0305538364b97cc4661a2bd2b6c89d803e66e5655e4e55ff1571943efd", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.5.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2f53592432ce17d3978feb8f43e8dc0705e288b0890caf06d449785f018061c"},
"elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"floki": {:hex, :floki, "0.29.0", "b1710d8c93a2f860dc2d7adc390dd808dc2fb8f78ee562304457b75f4c640881", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "008585ce64b9f74c07d32958ec9866f4b8a124bf4da1e2941b28e41384edaaad"},
"gettext": {:hex, :gettext, "0.18.2", "7df3ea191bb56c0309c00a783334b288d08a879f53a7014341284635850a6e55", [:mix], [], "hexpm", "f9f537b13d4fdd30f3039d33cb80144c3aa1f8d9698e47d7bcbcc8df93b1f5c5"},
"git_cli": {:hex, :git_cli, "0.3.0", "a5422f9b95c99483385b976f5d43f7e8233283a47cda13533d7c16131cb14df5", [:mix], [], "hexpm", "78cb952f4c86a41f4d3511f1d3ecb28edb268e3a7df278de2faa1bd4672eaf9b"},
"git_ops": {:hex, :git_ops, "2.4.2", "291a4f105dfa3d34cffa56cf8faf0e8c2699b49d3316270aa4881e75c62b1832", [:mix], [{:git_cli, "~> 0.2", [hex: :git_cli, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "bd9051c49e17d0dc2e0ae9306292f9f5f671d402227f5dda12e69a702198dec4"},
"hackney": {:hex, :hackney, "1.17.0", "717ea195fd2f898d9fe9f1ce0afcc2621a41ecfe137fae57e7fe6e9484b9aa99", [:rebar3], [{:certifi, "~>2.5", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "64c22225f1ea8855f584720c0e5b3cd14095703af1c9fbc845ba042811dc671c"},
"html_entities": {:hex, :html_entities, "0.5.1", "1c9715058b42c35a2ab65edc5b36d0ea66dd083767bef6e3edb57870ef556549", [:mix], [], "hexpm", "30efab070904eb897ff05cd52fa61c1025d7f8ef3a9ca250bc4e6513d16c32de"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
@ -22,6 +26,7 @@
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "1.5.0", "203ef35ef3389aae6d361918bf3f952fa17a09e8e43b5aa592b93eba05d0fb8d", [:mix], [], "hexpm", "55a94c0f552249fc1a3dd9cd2d3ab9de9d3c89b559c2bd01121f824834f24746"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"phoenix": {:hex, :phoenix, "1.5.7", "2923bb3af924f184459fe4fa4b100bd25fa6468e69b2803dfae82698269aa5e0", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "774cd64417c5a3788414fdbb2be2eb9bcd0c048d9e6ad11a0c1fd67b7c0d0978"},
"phoenix_ecto": {:hex, :phoenix_ecto, "4.2.1", "13f124cf0a3ce0f1948cf24654c7b9f2347169ff75c1123f44674afee6af3b03", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 2.15", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "478a1bae899cac0a6e02be1deec7e2944b7754c04e7d4107fc5a517f877743c0"},

Loading…
Cancel
Save