Git Product home page Git Product logo

forest-server's Introduction

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
        ];
      };
    };
}

Why Rust?

forester is written in ocaml, so why rust? See this discussion. Additionally, I have found compiling ffi code really challenging on nixos.

I am open to deprecating this program if a good ocaml solution is possible. However, I suspect that forest-server is runnable on windows, so It would be nice that when forester becomes windows-compatible, the native ocaml file watching solution also works.

TODO

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

Contributing

Contributions are welcome! Feel free to open a PR.

forest-server's People

Contributors

dannypsnl avatar elena-rigbee avatar kentookura avatar nickhu avatar offlinehacker avatar

Watchers

 avatar

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.