* 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
    <> <>
    <