Fork me on GitHub
#reagent
<
2015-12-31
>
virmundi03:12:42

is it possible to use reagent within a static html?

virmundi03:12:56

I'm trying to make a databaseless, serverless wiki.

amonks04:12:18

@virmundi “is it possible to use reagent on a static page?” -> yeah, totally. Many websites/apps are static pages that get dynamic content from servers/APIs “will other wiki visitors see the articles I write?” -> not unless those articles are saved to some server that can tell the other visitors about it.

amonks04:12:10

or maybe I’m misunderstanding your question. “databaseless, serverless” seems like a red flag, but maybe you mean that you’ll use someone else’s database/server, something like Google Firebase

amonks04:12:27

or maybe you’re planning some kind of peer-to-peer meshy thing over webRTC

virmundi04:12:58

No *-less is my goal. I'm going to use HTML5 API to read files from a relatives paths to the index.html

virmundi04:12:37

I tried to use the secretary API, but it keeps failing to find the paths. The base URL is <file://Users/something/something/index.html>

amonks04:12:31

@virmundi so this like a local wiki that (assuming I’m a user) exists on my computer’s filesystem?

amonks04:12:38

(rather than the public internet?)

virmundi04:12:47

Yep, or a local NFS.

virmundi04:12:41

When I use secretary, I get an error that it can't render nil.

virmundi04:12:05

The URL is file:///Users/jdavenpo/Documents/Code/stawiki/resources/public/index.html#/

virmundi04:12:03

For example, (secretary/defroute "#" [] (session/put! :current-page #'home-page))

virmundi04:12:32

I guess the question is really can I use secretary in a static file.

amonks04:12:49

I’ve never used secretary, but that seems like the kind of thing it would do

virmundi04:12:04

I know, right? I know that Angular is fine with such URLs.

amonks04:12:04

you could spin up a little local static webserver to get a proper http:// url

virmundi04:12:19

I know. I don't want the battery drain.

amonks04:12:24

something like https://www.npmjs.com/package/local-web-server , (maybe the clojure world has its own equivalent)

amonks04:12:46

yeah, if you want to just keep it around and editable long-term I can see how that would be annoying

virmundi04:12:04

I've looked to see if anyone else has this. Nope.

virmundi04:12:12

Everyone uses a server. It does make things easier.

virmundi04:12:38

But I got to do it the hard way. On the plus side I get the to know CLJS and CL.

amonks04:12:56

OSX used to come with a running Apache instance, but it doesn’t anymore so you can’t use that

amonks04:12:18

(you can still start apache but that doesn’t meet your criteria)

virmundi04:12:48

I know how to make a compojure server. I'm trying something different.

amonks04:12:31

maybe poke around in the secretary source, or file an issue over there about file:/// urls

amonks04:12:20

in any case this isn’t really a #C0620C0C8 issue

virmundi04:12:36

I agree. Thanks for the time

amonks04:12:49

good luck! simple_smile maybe someone more experienced will know more than I do 😛