aboutsummaryrefslogtreecommitdiff
#+title: bom.el
#+author: Yuchen Pei <id@ypei.org>

* Introduction
  :PROPERTIES:
  :UPDATED:  [2023-10-24 Tue 23:31]
  :END:

This is a PoC experiment, demonstrating the power of emacs-web-server.

The goal is not to implement something fancy, but:

1. Banish Javascript
2. Write an emacs package, get a webapp for free

The first item is quite achievable. Regarding the second, it would be
ideal to have a package that transforms emacs packages to webapps.
This package showcases a prototype of such a transformer, which needs
to separated.

* Usage
  :PROPERTIES:
  :UPDATED:  [2023-10-08 Sun 15:35]
  :END:

** As an emacs package
   :PROPERTIES:
   :UPDATED:  [2023-10-24 Tue 23:35]
   :END:
There are two entry points:

- ~M-x bom~: opens a "landing page" as an org buffer
- ~M-x bom-state~: prompt for a state, then displays the weather
  forecast for that state in an org buffer

** Serve web pages from current emacs instance
   :PROPERTIES:
   :UPDATED:  [2023-10-24 Tue 23:37]
   :END:
Make sure =emacs-web-server= is available. It can be installed from
the GNU ELPA:

#+begin_src emacs-lisp
(package-install 'web-server)
#+end_src

Require and start the server:

#+begin_src emacs-lisp
(require 'bom)
(bom-start)
#+end_src

The weather forecast is available at <http://localhost:9000>.

** Serve web pages from the command line
   :PROPERTIES:
   :UPDATED:  [2023-10-24 Tue 23:37]
   :END:

Run ~make serve~.

* Contact and Copyright
  :PROPERTIES:
  :UPDATED:  [2023-10-08 Sun 15:42]
  :END:

=bom.el= is maintained by Yuchen Pei <id@ypei.org> and covered by [[https://www.gnu.org/licenses/agpl-3.0.en.html][GNU
AGPLv3+]]. You may find the license text in a file named COPYING.agpl3
in the project tree.