From de7cf9ff4791bd2ba471bf8d35b4995d972506d1 Mon Sep 17 00:00:00 2001 From: shoshin Date: Sun, 28 Aug 2022 20:41:06 -0500 Subject: Add: new repo for refactored bard-bivoumacs --- bard-bivoumacs.org | 745 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 745 insertions(+) create mode 100644 bard-bivoumacs.org diff --git a/bard-bivoumacs.org b/bard-bivoumacs.org new file mode 100644 index 0000000..0ed4204 --- /dev/null +++ b/bard-bivoumacs.org @@ -0,0 +1,745 @@ +* Bard Bivou(m)acs +** Notes + - =M-x html-html5-template= maybe? + - [[file:~/new-emacs/snippets/html-mode/audio::# -*- mode: snippet -*-][audio tag snippet]] + - [[file:~/new-emacs/straight/repos/emms/emms-info-opusinfo.el::(defun emms-info-opusinfo (track)][emms-info-opusinfo]] +*** full emms integration path +realizing a lot of the heavy lifting might be doable by +leveraging the emms playlist buffer / functionality. + +#+name: track-list +#+begin_src emacs-lisp :var dir="" + (let ((buf (emms-playlist-new)) + (buf2 (get-buffer-create "*foo*")) + (html)) + (emms-playlist-set-playlist-buffer buf) + (with-current-buffer buf + (emms-playlist-clear) + (emms-add-directory dir) + (emms-walk-tracks + (let* ((track (emms-playlist-track-at (point))) + (file (file-name-nondirectory (cdr (assoc 'name (cdr track))))) + (title (cdr (assoc 'info-title (cdr track)))) + (number (cdr (assoc 'info-tracknumber (cdr track))))) + (with-current-buffer buf2 + (insert "
  • ") (newline) + (insert (concat "" number ". " title)) (newline) + (insert (concat "")) + (goto-char (point-max)) + (newline) + (insert "
  • ") + (newline))))) + (with-current-buffer buf2 + (html-mode) + (indent-region (point-min) (point-max)) + (setq html (buffer-string))) + (kill-buffer "*foo*") + html) +#+end_src + +#+RESULTS: +#+begin_example +
  • + 1. akane + +
  • +
  • + 2. merculite missle + +
  • +... and so on +#+end_example + +** Structure +*** version 1 + - [X] move html tags out of code as much as posible and put them here + - [ ] break up templates to fill them in easier with functions + - [X] add m3u or pls file link + - [ ] torrent? + +This defines two "halves" dividing the page. I'm envisioning a horizontal +alignment on browser and vertical on mobile. It will display the cover art, +artist and album title, the tracklist, and whatever player controls I come +up with. This will be used as a format string in emacs-lisp code where we +will fill in the %s characters with the desired values. +#+name: structure +#+begin_export html + + + + + + + %s + + + + +
    +
    +
    + + + +
    +
    + %s +
    +
    +
    +
    +

    %s

    +
    +
    + album cover art +
    +
    +
    + + + + +#+end_export + +I imagine with a package, you might have a custom variable that +could be used as a template file, or perhaps it could be a literal +template file given in the directory or as an argument. Or... I +have found [[https://github.com/Kinneyzhang/pp-html]] which is an elisp +library for generating HTML directly. However, in the effort to Keep +It Simple, Silly, plain HTML with %s's is fine for me. + +Anyhow, this dynamic variable will allow the functions defined below +to use it assuming its assigned a proper format string form. + +#+name: set-template +#+begin_src emacs-lisp :var templ=structure + (setq bard-bivoumacs-template templ) +#+end_src + +#+RESULTS: set-template +#+begin_example + + + + + + + %s + + + + +
    +
    +
    + + + +
    +
    + %s +
    +
    +
    +
    +

    %s

    +
    +
    + album cover art +
    +
    +
    + + + + +#+end_example + +*** version 2 + +#+name: page-title +#+begin_src html + casiopeia basement days +#+end_src + +#+name: album-title +#+begin_src emacs-lisp + "Basement Days" +#+end_src + +#+name: html-index +#+begin_src html :noweb yes :tangle index.html + + + <> + + <> + + +#+end_src + +#+name: head +#+begin_src html :noweb yes + + + + <<page-title>> + +#+end_src + +#+name: bard-bivoumacs +#+begin_src html :noweb yes +
    + <> + <> +
    + <