GithubHelp home page GithubHelp logo

emacs-web-ui's Introduction

emacs-web-ui

What it is

It is my attempt to provide WebUI to some of Emacs feature while I am away from keyboard. Typical use-cases: org-mode agenda (to do some shopping for example over the list of items in TODO or Agenda). I will try to start from some common org-mode tasks and extend it to other areas of my Emacs life.

Emacs side - literate programming

When product will be ready I will publish it in Melpa. Until then, lets use some literate snippets.

start httpd

(require 'simple-httpd)
(setq httpd-root "/home/oleksii/dev/emacs-web-ui/public")
(httpd-start)

servlet: webui-orgmode-settings

(defun webui-org-agenda-files-list ()
  (coerce (org-agenda-files) 'vector))

(setq org-agenda-commands-hash (make-hash-table))
(puthash "a" "Agenda for current week or day" org-agenda-commands-hash)
(puthash "/" "Multi-occur" org-agenda-commands-hash)
(puthash "t" "List of all TODO entries" org-agenda-commands-hash)
(puthash "m" "Matchy a TAGS/PROP/TODO query" org-agenda-commands-hash)
(puthash "s" "Search for keywords" org-agenda-commands-hash)
(puthash "?" "Find :FLAGGED: entries" org-agenda-commands-hash)
(puthash "*" "Toggle sticky agenda views" org-agenda-commands-hash)
(puthash "<" "Buffer, subtree/region restriction" org-agenda-commands-hash)
(puthash ">" "Remove restriction" org-agenda-commands-hash)
(puthash "e" "Export agenda views" org-agenda-commands-hash)
(puthash "T" "Entries with special TODO kwd" org-agenda-commands-hash)
(puthash "M" "Like m, but only TODO entries" org-agenda-commands-hash)
(puthash "S" "Like s, but only TODO entries" org-agenda-commands-hash)
(puthash "#" "List stuck projects" org-agenda-commands-hash)

(setq webui-orgmode-settings-hash (make-hash-table))
(puthash "org-agenda-files" (webui-org-agenda-files-list) webui-orgmode-settings-hash)
(puthash "org-agenda-commands" org-agenda-commands-hash webui-orgmode-settings-hash)

(defservlet webui-config application/json (path)
  (json-insert webui-orgmode-settings-hash))
curl -X GET -k -i 'http://localhost:8080/webui-config/' 2> /dev/null

test it

get http://localhost:8080/webui-orgmode-settings/

How it is expected to expose the UI

Because handling authentication in Emacs web server might be an issue, I decided to use simple trick - using commercial ngrok subscription you can get your localhost interface exposed via secure endpoint:

ngrok http 8080 --domain=ok-emacs.ngrok.app --oauth google --oauth-allow-email [email protected]

Status

In early stages of development. Nothing useful here yet :-( But since I am doing it mostly for myself, I will publish update as soon as anything is ready in Alpha stage.

Development

yarn install # install NPM deps
yarn dev # run dev build in watch mode with CLJS REPL

## Production

yarn release # build production bundle

emacs-web-ui's People

Contributors

avkoval avatar

Watchers

Lucian avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.