Environment setup: requiring cljc source files and possibility of using cljs

Open
#568 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
clojure

Research direction

Start by reproducing the setup with deps.edn, separate notebooks and src directories, lib.{name} namespaces, and the proposed :watch-paths configuration. Check the existing Clerk workflow and clj commands for requiring source files, then determine whether notebook execution via ClojureScript is supported; done means documenting the required setup or defining the implementation scope.

Written by the indexing model from the issue text.

Description

Hello all I'm having some issues with getting my clerk workflow setup and I would appreciate anyone's input on making this happen.

  1. I have my project directory managed with deps.edn. This works perfectly fine when everything (aside from external dependencies) is defined within the notebook itself, but I have not had luck :require'ing source files from elsewhere in the directory. Ideally I would import it just as I would an external dependency or perhaps just use the same namespace and all of the definitions are loaded in, but another possibility might be to define the source files as another notebook directory via :watch-paths and use some clerk-specific mechanism to execute and run. Just want to get unblocked here.

    The specifics of my case don't matter, but for generality let's say I have notebooks and src directories, where the files under src are written using the lib.{name} namespace. What additional configuration, clj commands, or clerk code do I need to execute in order use the code from src in a notebook? Bonus points if where is a demo or example repo that already demonstrates this.

  2. Is it possible to execute notebooks via ClojureScript instead of Clojure? I suspect the answer is no, but if it's a reasonable lift I can certainly help in making this happen.

Thanks!

Dominant language
Clojure
Stars
2.1k
Forks
87
Avg merge
3m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextjournal/clerk

All issues in nextjournal/clerk

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.