forest-server

Crates.ioforest-server
lib.rsforest-server
version0.2.2
sourcesrc
created_at2023-11-29 21:54:17.252355
updated_at2023-12-11 09:06:32.94997
descriptionA development server for ocaml-forester
homepage
repository
max_upload_size
id1053606
size88,622
Kento Okura (kentookura)

documentation

README

Forest Server

A live-updating development server for forester.

Usage

To make use of the live-reload feature, you will need to add the following javascript snippet to the root template in forest.xsl:

...
<script type="module" src="forester.js"></script>
<script src="reload.js"></script>

Run forest watch -- "$args", where $args are the arguments you want to pass to forester. For example:

forest wach -- "build --dev --root index trees/"

Installation and Setup

cargo install forest-server

Requires forester to be available in $PATH.

To install using Nix:

{
  inputs = {
    forester.url = "sourcehut:~jonsterling/ocaml-forester";
    forest-server.url = "github:kentookura/forest-server";
    forester.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = inputs@{ self, forester, forest-server, nixpkgs }:
    let
      system = "x86_64-linux"; # Only works on linux so far, PRs welcome!
      pkgs = import nixpkgs { inherit system inputs; };
    in
    {
      devShells.${system}.default = pkgs.mkShell {
        buildInputs = [
          forester.packages.${system}.default
          forest-server.packages.${system}.default
        ];
      };
    };
}

TODO

  • Add a nice overlay to the UI like in vite.

Contributing

Contributions are welcome! Feel free to open a PR.

Commit count: 0

cargo fmt