Opening an HTML page in a browser from Common Lisp

My Common Lisp program writes an HTML file. Then I want to run this file in the default browser.

Is there a way to do this in Common Lisp? Also, is there an OS-independent way to do this?

+4
source share
4 answers

It depends on the implementation of Common Lisp and, possibly, on the platform on which it works (Windows, Mac, Linux, ...).

LispWorks provides the SYS: OPEN URL function. See http://www.lispworks.com/documentation/lw60/LW/html/lw-1369.htm#pgfId-1219832

(sys:open-url "http://www.foo.com/")

Of course, you can also use the file url.

+2
source

. , , , , !

+1

, , .

+1
source

This project is the answer of https://github.com/eudoxia0/trivial-open-browser .

TLDR

You can use uiop:run-programfor this. The argument will depend on the system that works, for example, on MacOS this "open http://www.example.com/"(see https://github.com/eudoxia0/trivial-open-browser/blob/master/src/trivial-open-browser.lisp )

0
source

Source: https://habr.com/ru/post/1767792/


All Articles