Arc Lisp and HN-like web app. Fork of Anarki.

Pelle Hjek ffd7fa7fda Unmaintained. 7 months ago
lib 60ee05d401 Always display flag link on stories (like HN) 8 months ago
setup 506b6a65d8 Add option to run News non-interactively 9 months ago
static 23f825eef8 Small HTML tweak 8 months ago
.gitignore 23d948f273 Write Scribble documentation for the `anarki` Racket module. 1 year ago
COPYING e206bca5d3 Relicense to AGPL 9 months ago
README.md ffd7fa7fda Unmaintained. 7 months ago
ac.rkt 76ee5c2cf1 Cleanup 9 months ago
arc 47446c6b61 Remove colour and spacing tags 8 months ago
arc.arc 7a1fba03b6 Add a package dependency on the `sha` package. This should fix the Travis CI tests against Racket 6.12, as well as making it simpler to use `raco pkg install anarki`. 10 months ago
boot.rkt 4e0cd7fecf Add expr parameter to `arc` script, and simplify it a bit. 9 months ago
brackets.rkt a0d2040d76 In the `anarki` Racket module, stop setting the readtable permanently, and instead offer an `anarki-readtable` export that can be used at will. 1 year ago
knark.png 1135eb1ccc Add votelinks and comment color in external JS and CSS. Fix unvoting. 8 months ago
libs.arc 7c21062c3f Fix CSS 8 months ago
news 9e8c56d035 Ensure user votes are loaded when checking if they can vote 8 months ago

README.md

Unmaintained. Working on a rewrite in plain Racket due to limitations of Arc.

Knark

Knark is a version of Arc forked from Anarki and relicensed under Affero GPL . It comes with News, a Hacker News style app, which is extremely easy to set up as it comes with it's own built-in web server and database.

What's new in Knark?

Installation

First install a recent version of Racket, then:

$ git clone https://notabug.org/hjek/knark # fetch knark
$ cd knark   # enter the knark directory
$ ./news     # run news server

To assign a user as admin, use the make-admin function on the repl:

(make-admin 'alice 'bob) ; make alice and bob admins

Then go to your News site, click on login, and create the account with the username you set as admin. You should now be logged in as an admin!

To customize News, use the customize function:

(customize "News"                     ; name
           "https://site.example.com" ; url
           "https://example.com"      ; parent url
           "What this site is about." ; description
           "hn.css"                   ; theme
           "arc.png")                 ; logo url

If you'd like users to be able to reset their passwords if they forget them, you need to set up an email address to send out password recovery emails:

(set-appemail "alice@example.com"    ; from
              "smtp.example.com"     ; smtp server
              "1234")                ; password

Production-ready setup

Please follow these instructions for a production-ready News setup using Nginx and SystemD.

Windows support

Although this fork does aim to eliminate non-portable code, it doesn't maintain any separate batch scripts for the non-free Windows operating system. Victims may however be able to start Knark with Bash for Windows.

Development

Documentation

If you're new to Arc, or Lisp in general, a good starting point is the Tutorial and Paul Graham's writings about Arc.

If you run into trouble, check:

Racket interop

Racket expressions can be evaluated with the ($ ...) syntax:

($ (string-append "foo" "bar" "baz"))
"foobarbaz"

Racket has a well-documented standard library, which is well worth exploring if you haven't already.

Arc doesn't have a keyword type, so use kw-apply for calling Racket functions that take keyword arguments.

Tests

Q: What happened to every bug out there? A: it passed the type checker, and it passed all tests.

Todo