Coder Social home page Coder Social logo

Comments (3)

mk avatar mk commented on June 13, 2024 1

Also worth mentioning: Clerk should is useable standalone using clj -X:

I'm working on some smaller fixes and improvements for this in https://github.com/nextjournal/clerk/compare/standalone-fixes

$ clj -Sdeps '{:deps {io.github.nextjournal/clerk {:git/sha "e5484675ad21a4d79ff1cbc699324b742a25e986"}}}}' -X nextjournal.clerk/serve! :paths '["Hello.md"]' :browse true

Clerk also ships with metadata to be https://github.com/babashka/cli compatible:

clj -Sdeps '{:deps {org.babashka/cli {:mvn/version "0.7.53"} io.github.nextjournal/clerk {:git/sha "e5484675ad21a4d79ff1cbc699324b742a25e986"}}}}' -M -m babashka.cli.exec nextjournal.clerk/serve! --browse

Need to add the missing :paths in the serve for it, though. Have a busy week so I can't promise I'll get to it very soon. PR welcome in the meantime.

from clerk.

mk avatar mk commented on June 13, 2024

Hi Attila,

I think you're running into an issue where the browser request triggered by {:browse? true} causes Clerk to show the homepage (which happens on requests to /). I do see the right thing when navigating to http://localhost:7777/src/clerk_viewer in the browser.

Note that we've recently added the ability to disable the welcome page in #561 by passing a :paths option. I'd recommend trying that with the lastet main e8f275b. Please let me know if that helps!

from clerk.

mk avatar mk commented on June 13, 2024

I've documented the missing options and exposed them to babashka.cli in 333727a. I'm considering to add a dependency on babashka.cli and expose a main function directly (please let me know if you'd find that helpful!). For now it works by declaring an extra dep like so:

$ clojure -Sdeps '{:deps {io.github.nextjournal/clerk {:git/sha "333727ad3aa6b5c7d8244bb0b7703b757e9904c4"} org.babashka/cli {:mvn/version "0.7.53"}}}' -M -m babashka.cli.exec nextjournal.clerk/serve! --help
Start the Clerk webserver with an optional a file watcher.

Options: 
  --host           Host or ip for the webserver to listen on, defaults to "locahost".
  --port           Port number for the webserver to listen on, defaults to 7777.
  --browse         Opens the browser on boot when set.
  --watch-paths    Paths on which to watch for changes and show a changed document.
  --show-filter-fn Symbol resolving to a fn to restrict when to show a notebook as a result of file system event.
  --paths          Restricts serving to the given paths, supports glob patterns. Will disable Clerk's homepage when set.
  --paths-fn       Symbol resolving to a 0-arity function returning computed paths.
  --index          Override the name of the index file (default "index.clj|md", will be added to paths.

from clerk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.