On 13 Apr 2016, at 04:18, 'Lee' via Clojure <clojure@googlegroups.com> wrote:
> Thanks again to Alan, Pedro, and Colin for the input on this. > > I found the modern-cljs tutorial most helpful, and was able to put the > compiled Hello World example on a server and then run it from my browser. > Victory! > > It seems like I am very close to doing what I want, which is to put an > existing pure Clojure program (with no GUI or networking or database etc.) > online so that the small group of users of this program (mathematicians > interested in a specific set of questions about finite algebras) can run some > computations in their browsers, without having to install anything on their > own machines. As I mentioned before, I'd like to do this, for now, without > having to learn a lot about Javascript or web programming. > > I am still facing what I think are some small hurdles, however. I'll bet can > be overcome easily, but all of the tutorials I see require one to learn a lot > more to do this than I have time to learn right now. > > Specifically: 1) I need my code to get some input (just parameters to the one > function that I will run), and 2) ideally the output would go to the browser > window rather than to the Javascript console. > > Ignoring 2 for the moment, I see that the Javascript console provides a > Javascript REPL. If I can call a Clojurescript function there, and especially > if the Clojurescript read function read from this REPL, then I could have my > users work in the Javascript console. Not ideal, but it could work in a pinch. > > Ideally, though, I would have either a single text field Clojurescript REPL > on the web page itself, or two text fields, one for input and one for output, > and a "Run" button to trigger the computation. > > I don't much care what this all looks like. I just want some way to get text > input and print text output, preferably in the browser window. > > I assume that the modern-cljs tutorials would get me there, but only after > substantial detours through several other topics. I'm sure this is all > important and useful stuff, which I'd love to study if I ever want to do more > substantial web programming. But for now I just want to make this existing > program available to my users in their browsers. > > So: Can anyone point me to a minimal way to get text I/O and trigger a > function call (presumably with a button) in Clojurescript in the browser, > without relying on knowledge of Javascript or web programming? Alternatively, > if anyone can point me to a description of how to call Clojurescript > functions in the Javascript console, and also to read input from the console, > that would also help. I think your easiest option might be to use Reagent: http://reagent-project.github.io. You would have to know some html, CSS and Javascript. I doubt there is any way around having some basic knowledge of them. Code Academy have some courses that cover the basics: https://www.codecademy.com/learn/web https://www.codecademy.com/learn/javascript. There is a video on how to set up and use Reagent here: https://www.youtube.com/watch?v=wq6ctyZBb0A. Alan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.