package quickterface
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Quick-to-program app interfaces in OCaml for terminal and web
Install
dune-project
Dependency
Authors
Maintainers
Sources
quickterface-0.1.0.tbz
sha256=8261e3819564fb5d05f1f313e62b73382152591d7a4349ae5b1b08a4fc2469f3
sha512=e739a971bb0e696ab716c168419c59a3d195922d2d1e4963106a845e3442ffa085b05106f36cceeec9b806bf7d6ef2c31e98db04911fbf73c5ac0ce626449d0f
doc/README.html
Quickterface
Quick-to-program app interfaces in OCaml for terminal and web.
Overview
Quickterface is an OCaml library that lets you write interactive applications once and run them both as terminal UIs (TUIs) and web applications. Write your app logic using a simple IO interface, and Quickterface handles the rendering for both platforms.
Features
- Write Once, Run Anywhere: Same code runs in terminal and browser
- Easy Setup: Includes a setup script executable to quickly create a Quickterface app in an existing Dune projects
- Rich Terminal UI: Built on Notty with full TUI support
- Web Applications: Automatically generates web interfaces using js_of_ocaml
- Input Types: Text, integers, single/multi-selection
- Output Types: Text, titles, and mathematical notation (via KaTeX)
- Async Support: Built with Lwt for asynchronous operations
- HTTP Client: Integrated Cohttp support for network requests
Installation
opam install quickterfaceQuick Start
Create an app by defining a functor that takes an Io module:
module App : Quickterface.App.S =
functor (Io : Quickterface.Io.S) ->
struct
let main ~io () =
let%lwt () = Io.output_title io "My App" () in
let%lwt () = Io.output_text io "What is your name?" () in
let%lwt name = Io.input_text io () in
let%lwt () = Io.output_text io ("Hello, " ^ name ^ "!") () in
Lwt.return ()
endTerminal App
module Terminal = Quickterface.Terminal_app.Make(App)
let () = Terminal.command ~argv:Sys.argv ()Web App
module Web = Quickterface.Web_app.Make(App)
let () = Lwt_main.run (Web.run ())Examples
See the test/examples/ directory for complete working examples including:
- Simple text IO
- String concatenator
- Math rendering
- Multi-select inputs
- Weather app (with HTTP requests)
License
MIT
Author
Ofsouzap ofsouzap@gmail.com
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page