Created
August 12, 2020 05:09
-
-
Save kamisori/b76972f492eb3716dd90894440dd95fa to your computer and use it in GitHub Desktop.
I'm working on a webcomic framework for fun when I ran into the following problem:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import hypertext) | |
(import sqlite3 :as sql) | |
(import ./src/data-access :as da) | |
(import ./src/data-presentation :as dp) | |
(import ./src/debug :as dbg) | |
#goes to dp: | |
(defn render-contents--works [page-contents] | |
(defn make-html [content] | |
(let [image-url (string "/blob/" (content :blobid))] | |
(hypertext/from-data | |
~(img {:src ,image-url})))) | |
(def sorted-contents (sorted-by |($ :position) page-contents)) | |
(map make-html sorted-contents)) | |
(defn render-contents--doesnt [page-contents] | |
(def sorted-contents (sorted-by |($ :position) page-contents)) | |
(map |(let [image-url (string "/blob/" ($ :blobid))] | |
(hypertext/from-data | |
~(img {:src ,image-url}))) | |
sorted-contents)) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment