Coder Social home page Coder Social logo

markhibberd / loom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haskell-mafia/loom

0.0 2.0 0.0 555 KB

Weaver of webs.

License: BSD 3-Clause "New" or "Revised" License

Shell 3.21% Haskell 74.80% Roff 18.82% CSS 1.68% JavaScript 1.28% PureScript 0.21%

loom's Introduction

Loom

Why it's an extraordinary adventure with an interface on magic... stunning, high-resolution, 3D landscapes... sophisticated score and musical effects. Not to mention the detailed animation and special effects, elegant point 'n' click control of characters, objects, and magic spells.

Beat the rush! Go out and buy Loom™ today!

  • Cobb, The Secret of Monkey Island

Loom is a project for developing, building and packaging web-based projects.

Command line

# Build and package the required resources
loom build

# Start a running process that serves up a "live" web version of this library
# and watches the filesystem for changes
loom watch

Configuration

Loom is configured via a single loom.toml file in the root of the project.

Other loom libraries can be referenced in the set of dependencies. This will include all their components/sass files as if they were directly referenced by this project, and will be visible in the generated site.

Javascript and Purescript files inside components will be automatically discovered and added to a main bundle. Users can also specify custom JS bundles. An example first bundle is provided below.

Javascript dependencies can be sourced from the NPM registry, but we require the SHA1 hash of each dependencys source tarball alongside its version tag. This will be validated on fetch to catch unexpected upstream changes. Dependency tarballs will be cached in $HOME/.loom.

Javascript and Purescript dependencies can also be sourced from Github using a repository identifier, a Git ref, and the source tarball's SHA1 hash.

[loom]
  # Mandatory
  version = 1

  # Mandatory
  name = "my_project"

  # Optional
  dependencies = ["lib/bikeshed"]

[components]
  # Optional
  paths = ["components/*"]

[sass]
  # Optional
  paths = ["scss/*"]

[js]
  # Optional
  paths = [
      "app/src/js/common/*"
    ]

[js.bundle.first]
  main = "app/src/js/first.js"
  # Optional
  paths = [
      "app/src/js/first/*"
    ]

[js.dependencies]
  # Optional
  npm = [
      ["d3", "4.7.4", "a2f40eb57decc51bc469010d48ae74a20e025772"]
    ]
  github = [
      ["isaacs/rimraf", "tags/v2.6.1", "813139ac3628ae0b47136de18939cbb623e21475"]
    ]

[purs]
  # Optional
  paths = [
      "app/src/purs"
    ]

[purs.dependencies]
  # Optional
  github = [
      ["purescript/purescript-newtype", "tags/v2.0.0", "2276bd44ff5b7440c455839833c69f40cc8d8616"]
    ]

[purs.test]
  main = "Test.Main"

  # Optional
  paths = [
      "app/test/purs"
    ]

[purs.test.dependencies]
  # Optional
  github = [
      ["bodil/purescript-test-unit", "tags/v9.1.0", "e1c16b5a0277f2d017c2279ba1dc2f42be36fc33"]
    ]

Environment variables

  • LOOM_SITE_PREFIX

    The prefix root to use for all links rendered on the generated site. This can be used if the site is being hosted under a sub-prefix.

    An example of this might be publishing the site for the current commit to s3 to be reviewed as part of a pull request.

    Defaults to "/".

Setting up a new Haskell project with Loom

Where $PROJECT is the name of your project.

  1. git submodule add [email protected]:ambiata/loom.git lib/loom

  2. cp lib/loom/scripts/loom .

  3. echo .loom >> .gitignore

  4. printf "[loom]\n version = 1\n name = \"$PROJECT\"\n" > loom.toml

  5. Add $PROJECT-loom package to your cabal build-depends dependencies

  6. Import $PROJECT.Assets into your main and compose assetMiddleware with your existing Middleware

  7. Render the template html to the relevant format using hydrant:

    import qualified Hydrant as Hydrant
    import qualified $PROJECT.Assets as Assets
    import qualified $PROJECT.Modules.Template as Template
    ...
    html =
      Hydrant.to??? . Hydrant.doctype "html" . Template.frame Assets.css $
        Template.myTemplate
    

    In this case Assets.css is a generated function with all the relevant css files.

Prerequisites

  • sassc

    Currently sassc is required to be on the $PATH. It can be installed with one of the following options:

  • node

    Currently node is required to be on the $PATH. Node is required to post-process Javascript and Purescript, and to run Purescript test suites. It can be installed with one of the following options:

loom's People

Contributors

charleso avatar thumphries avatar damncabbage avatar jacobstanley avatar erikd-ambiata avatar nhibberd avatar russmaxdesign avatar markhibberd avatar etorreborre avatar michaelneale avatar sphvn avatar domdere avatar

Watchers

 avatar James Cloos 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.