#codegen #web #website #static #generation #framework

macro parker_codegen

Code generation for the Parker web framework

1 unstable release

0.0.0 Nov 6, 2018
Download history 6/week @ 2018-11-06

2 downloads per month
Used in 1 crate

GPL-3.0-or-later

4KB

Parker

Build Status License:GPLv3

Parker is a Rust-based templated website framework based on an idea by Joshua Driesman. Its main use is serving server-side rendered HTML along with CSS and JS files.

Parker itself is a library that requires minimal work on top of it. See the example folder for an example of usage.

Development

Running Locally

  1. Clone the repo
  2. Install docker and docker-compose (Google it)
  3. docker-compose up

Setting up Rust environment

You don't need to do this if you're just running the server in docker-compose, but it's nice to have for development and allows for using a debugger.

  1. Install rustup (Google it)
  2. rustup default nightly && rustup update
  3. rustup component add clippy-preview rustfmt-preview
  4. cargo install cargo-watch

You should configure your IDE/editor for Rust development, including rustfmt.

Linting

cargo clippy --all-targets --all-features -- -D warnings

Note that this only runs when the project needs to be built.

Debugging (Linux)

If you need your fix of GDB so you can feel like a real developer:

  1. Set up your dev environment (see above)
  2. Install gdb (if it isn't already installed)
  3. In one terminal, run Mongo
    1. docker-compose run db
  4. In another terminal, run the server
    1. cd example
    2. cargo watch -w . -w ../lib -x run
  5. ps aux | grep parker/target to find the PID of the Parker instance
  6. gdb -p $(pgrep -f parker/target)

Dependencies

~1MB
~20K SLoC