diff --git a/finito-buffer.el b/finito-buffer.el index 73a6f00..f86c46c 100644 --- a/finito-buffer.el +++ b/finito-buffer.el @@ -53,6 +53,20 @@ "Face for book descriptions." :group 'finito) +(defface finito-book-reviews + '((t :foreground "grey" + :inherit default)) + "Face for book reviews." + :group 'finito) + +(defface finito-book-review-header + '((t :foreground "grey" + :weight bold + :underline t + :inherit default)) + "Face for book review headers." + :group 'finito) + (defface finito-rating '((t :foreground "gold" :weight bold)) @@ -183,7 +197,7 @@ Its nodes should be alists of the form returned by (defclass finito-book-writer () ((insert-order :initarg :books-offset - :initform '(title image author rating started-reading last-read description) + :initform '(title image author rating started-reading last-read description review) :type list :custom '(repeat symbol) :documentation "The order of which to insert books attributes")) @@ -209,7 +223,7 @@ BOOK-ALIST is an alist of the format returned by `finito--create-book-alist'" ((eq it 'last-read) (when .last-read (finito-insert-last-read writer .last-read))) ((eq it 'description) (finito-insert-description writer .description)) - ((eq it 'review) (finito-insert-description writer .review)))))) + ((eq it 'review) (finito-insert-review writer .review)))))) (cl-defmethod finito-insert-title ((_ finito-book-writer) title) "Insert TITLE into the current buffer." @@ -278,10 +292,16 @@ BOOK-ALIST is an alist of the format returned by `finito--create-book-alist'" nil 'equal)) (bound-and-true-p finito--show-reviews)) - (insert review "\n") - (overlay-put (make-overlay (- (point) 2) (- (point) (length review) 2)) - 'face - 'finito-book-reviews))) + (when review + (let ((review-header "Review:")) + (insert review-header) + (overlay-put (make-overlay (point) (- (point) (length review-header))) + 'face + 'finito-book-review-header) + (insert " " review "\n") + (overlay-put (make-overlay (- (point) 1) (- (point) (length review) 1)) + 'face + 'finito-book-reviews))))) (cl-defmethod finito-use-pagination ((_ finito-book-writer)) "Return non-nil if pagination should be used alongside this writer." diff --git a/finito-graphql.el b/finito-graphql.el index b23608a..371f2c0 100644 --- a/finito-graphql.el +++ b/finito-graphql.el @@ -44,7 +44,7 @@ (maxResults . ($ maxResults)) (langRestrict . ($ langRestrict))) title authors description isbn thumbnailUri - rating startedReading lastRead)))) + rating review startedReading lastRead)))) ;; We don't add quotes around %s since null is a value that could potentially ;; be used, and we shouldn't quote that @@ -63,7 +63,7 @@ (book :arguments ((isbn . ($ isbn))) title authors description isbn thumbnailUri - rating startedReading lastRead)))) + rating review startedReading lastRead)))) (defconst finito--isbn-query-variables "{\"isbn\": \"%s\"}") @@ -76,7 +76,7 @@ :arguments ((name . ($ name)) (booksPagination . ($ booksPagination))) (books title authors description isbn thumbnailUri - rating startedReading lastRead) + rating review startedReading lastRead) (pageInfo totalBooks))))) (defconst finito--collection-query-variables @@ -174,7 +174,7 @@ :arguments ((rating . ($ rating)) (book . ($ book))) title authors description isbn thumbnailUri - rating startedReading lastRead)))) + rating review startedReading lastRead)))) (defconst finito--rate-book-mutation-variables "{ @@ -197,7 +197,7 @@ :arguments ((review . ($ review)) (book . ($ book))) title authors description isbn thumbnailUri - review startedReading lastRead)))) + rating review startedReading lastRead)))) (defconst finito--review-book-mutation-variables "{ @@ -220,7 +220,7 @@ :arguments ((date . ($ date)) (book . ($ book))) title authors description isbn thumbnailUri - rating startedReading lastRead)))) + rating review startedReading lastRead)))) (defconst finito--start-reading-mutation-variables "{ @@ -243,7 +243,7 @@ :arguments ((date . ($ date)) (book . ($ book))) title authors description isbn thumbnailUri - rating startedReading lastRead)))) + rating review startedReading lastRead)))) (defconst finito--finish-reading-mutation-variables "{ @@ -292,7 +292,7 @@ (series :arguments ((book . ($ book))) title authors description isbn thumbnailUri - rating startedReading lastRead)))) + rating review startedReading lastRead)))) (defconst finito--series-query-variables "{ diff --git a/finito.el b/finito.el index a0dd622..a88c8da 100644 --- a/finito.el +++ b/finito.el @@ -288,6 +288,7 @@ isbn img-uri image-file-name rating +review started-reading last-read" (let-alist book-response @@ -302,6 +303,7 @@ last-read" (cons 'img-uri .thumbnailUri) (cons 'image-file-name image-file-name) (cons 'rating .rating) + (cons 'review .review) (cons 'started-reading .startedReading) (cons 'last-read .lastRead)))))