Community documentation for Janet http://janetdocs.org
  • Janet 78.8%
  • JavaScript 14.5%
  • CSS 3.5%
  • Shell 1.6%
  • Dockerfile 1.4%
  • Other 0.2%
Find a file
2026-01-08 13:49:18 -07:00
db Update to Janet 1.40.0 (not incl. playground) 2025-11-15 23:57:28 -08:00
public Fix preview button 2025-12-30 22:22:16 -07:00
routes Randomize example display 2026-01-08 13:49:18 -07:00
test Add favicons, clean up main 2020-05-15 10:08:16 -06:00
tutorials Randomize example display 2026-01-08 13:49:18 -07:00
.env.sample Add a readme and .env.sample 2021-01-20 12:54:05 -07:00
.gitignore Add packages to URLs and denormalize data model 2025-08-02 00:50:51 -04:00
backup.json Randomize example display 2026-01-08 13:49:18 -07:00
console.janet Get off of dokku 2020-11-06 11:52:32 -07:00
coverage.md Add 53 more packages 2025-08-09 21:17:57 -04:00
docker-compose.yml misc. 2025-11-28 19:34:54 -07:00
Dockerfile misc. 2025-11-28 19:34:54 -07:00
helpers.janet Treeshake alpine.js via llm 2025-12-29 01:49:40 -07:00
importer.janet Fix duplicate account and editing issue 2025-10-18 00:16:58 -04:00
LICENSE Create LICENSE 2020-12-09 10:16:03 -07:00
main.janet Add tutorial pages 2025-11-12 03:04:10 -08:00
nginx.conf Get off of dokku 2020-11-06 11:52:32 -07:00
post-receive-hook Get off of dokku 2020-11-06 11:52:32 -07:00
Procfile Add seed to procfile 2020-07-01 09:29:42 -06:00
project.janet Fix supported module text 2025-11-16 03:08:20 -08:00
README.md misc. 2025-11-28 19:34:54 -07:00
seed.janet Fix supported module text 2025-11-16 03:08:20 -08:00
ssl-fetcher.janet Fix ssl cert. updating 2025-12-30 22:24:41 -07:00

Janetdocs

Community documentation for Janet, forked from janetdocs made with Joy.

Get Started

  1. Clone this repo and install Janet. May need curl: apt-get install libcurl4-openssl-dev.

  2. Make and fill out .env like .env.sample

  3. Make github oauth app to enable signing in. The callback url looks like: https://example.com/github-auth You can use an IP address or localhost for the of url.

  4. Enter the this project's directory then:

  • Install deps: jpm deps
  • Migrate DB: joy migrate
  • Import "blessed packages" (the [final section](# import-blessed-packages) has a dangerous script)
  • Seed DB: janet seed.janet
  • Fill DB: janet importer.janet
  1. That's it, just run: janet main.janet and visit localhost:9001! Poke around the code and learn what's going on!

Issues

  • many blessed packages don't build, import, have name collisions or require certain OS...
    • I can save some, maybe
  • users can't
    • add examples without github account
    • add new bindings
    • add "see-also"
    • add / choose packages
  • have not updated dockerization since Swlkr
  • users search all packages, would be interesting to search without package prefix, to surface available bindings

Ideas

  • replace uri/escape and uri/unescape with own escaper, or upstream some changes
    • but confirm it incorrectly handles turning /% into /%25 and that wasn't my error
    • modify relevant sections marked via # note jdocs-escape https://github.com/janet-lang/janet-lang.org/blob/master/content/api/gen-docs.janet
  • display binding docs above examples in the playground
  • go to binding source button
  • iterate through the DB (example bodies) parsing with janet-peg/rewrite/par to find which err (and could thus use some # to comment things out)

Notes

  • run ssl-fetcher.janet with a cronjob weekly for https
  • ao-dark.css and ao-light.css determine example colors (my modified atom-one-dark and light had hljs which I removed, maybe that standard is better though and I'll return to them circa commit 4cf36bba62)
  • the playground is a separate project. I upstream what improvements I can and made mode-janet.js. It uses ace.js and styling comes from custom.js assigned in jdocs_playground.js.
  • I removed depricated functions' examples: thread/receive, thread/send, tarray/new

To Update/Build the Playground

  1. Install emscripten and download the playground repo.

  2. cd to the playground repo and run:

  • jpm deps
  • ./playground update-janet latest
  • ./playground build
  • ./playground install
  1. Move janet.js and .janet.wasm from its public/js to this public/playground

Import Blessed Packages

This is reduced from the official pkgs list. To import their bindings, we must install them with jpm, which is raher dangerous as they may contain arbitrary c code, so if a single maintainer is pwned... For this reason, I did not automate seeding, but the list is a moving target, so maybe I should.

Install libprimesieve-dev libpq-dev libhiredis-dev for some of these, then:

sudo jpm install \
https://github.com/janet-lang/sqlite3.git \
https://github.com/cosmictoast/jurl.git \
https://github.com/Techcable/janet-msgpack.git \
https://git.sr.ht/~pepe/eleanor \
https://github.com/andrewchambers/janet-rlrepl.git \
https://git.sr.ht/~pepe/marble \
https://git.sr.ht/~pepe/manisha \
https://git.sr.ht/~nullevoid/args \
https://git.sr.ht/~nullevoid/gapbuffer \
https://github.com/levitanong/jdn-loader.git \
https://github.com/andrewchambers/janet-pq.git \
https://git.sr.ht/~pepe/shawn \
https://github.com/MikeBeller/janet-set.git \
https://github.com/andrewchambers/janet-process.git \
https://github.com/andrewchambers/janet-uri.git \
https://git.sr.ht/~subsetpark/fugue \
https://github.com/bakpakin/mendoza.git \
https://github.com/yumaikas/janet-stringx.git \
https://git.sr.ht/~pepe/trevor \
https://git.sr.ht/~pepe/trolley \
https://github.com/janet-lang/jpm.git \
https://git.sr.ht/~bakpakin/temple \
https://github.com/andrewchambers/janet-redis.git \
https://github.com/janet-lang/jhydro.git \
https://git.sr.ht/~pepe/bonzer \
https://git.sr.ht/~pepe/chidi \
https://codeberg.org/amano.kenji/j3blocks.git \
https://github.com/ianthehenry/judge.git \
https://github.com/joy-framework/tester.git \
https://github.com/andrewchambers/janet-base16.git \
https://github.com/andrewchambers/janet-flock.git \
https://github.com/wooosh/janet-openssl-hash \
https://github.com/pyrmont/testament.git \
https://github.com/janet-lang/circlet.git \
https://github.com/jeannekamikaze/janet-filesystem.git \
https://github.com/janet-lang/jaylib.git \
https://github.com/janet-lang/argparse.git \
https://github.com/Jakski/janet-base64.git \
https://git.sr.ht/~statianzo/janet-nanoid \
https://github.com/janet-lang/pkgs.git \
https://github.com/janet-lang/spork.git \
https://github.com/joy-framework/joy.git \
https://github.com/bakpakin/janet-miniz.git \
https://codeberg.org/amano.kenji/janet-utf8.git \
https://git.sr.ht/~pepe/michael \
https://codeberg.org/amano.kenji/janet-repl-tools.git \
https://git.sr.ht/~pepe/bearimy \
https://github.com/cosmictoast/janet-date.git \
https://git.sr.ht/~pepe/kamilah \
https://git.sr.ht/~pepe/hemple \
https://github.com/ianthehenry/cmd.git \
https://github.com/andrewchambers/janet-sh.git

# fine, but too many (undocumented) functions
# https://git.sr.ht/~p/jermbox \
# https://gitlab.com/jeannekamikaze/janet-glfw.git \

# these don't install: jlzf glyph shriek
# https://git.sr.ht/~nullevoid/jlzf \
# https://github.com/tionis/glyph.janet.git \
# https://git.sr.ht/~pepe/shriek \

# these won't import although build was fine:
# 'bigint 'freja 'x43bot 'html 'openbsd 'juv 
# https://github.com/andrewchambers/janet-big.git \
# https://github.com/sepisoad/jtbox.git \
# https://github.com/saikyun/freja.git \
# https://github.com/bakpakin/x43bot.git \
# https://github.com/swlkr/janet-html.git \
# https://git.sr.ht/~les/janet-openbsd \
# https://github.com/janet-lang/juv.git \

# msgpack has name colision with spork
# error: cannot register abstract type ta/buffer, a type with the same name exists
#   in native [src/core/corelib.c] on line 288
#   in native-loader [boot.janet] on line 3068, column 40
#   in require-1 [boot.janet] on line 3096, column 18
#   in import* [boot.janet] on line 3129, column 15
#   in thunk [/usr/local/lib/janet/spork/init.janet] (tail call) on line 45, column 1
#   in dofile [boot.janet] (tail call) on line 3060, column 7
#   in source-loader [boot.janet] on line 3072, column 15
#   in require-1 [boot.janet] on line 3096, column 18
#   in import* [boot.janet] on line 3129, column 15
#   in thunk [repl] (tail call) on line 33, column 11
#   
#   tarray colision with spork
#   error: cannot register abstract type ta/buffer, a type with the same name exists
  # in native [src/core/corelib.c] on line 288
  # in native-loader [boot.janet] on line 3068, column 40
  # in require-1 [boot.janet] on line 3096, column 18
  # in import* [boot.janet] on line 3129, column 15
  # in thunk [repl] (tail call) on line 19, column 11