Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.33 KB

developer-notes.md

File metadata and controls

29 lines (21 loc) · 1.33 KB

Developer notes

If you want to dig into the nitty gritty underbelly, this is the place.

Dragon works on stages:

  1. Synchronize — Scan files from root folder, copying plain files into build folder as necessary.
  2. PreEval — A stage plugins can be injected to do something before evaluation.
  3. Evaluation — Process all identified dragon/eex templates and Scss files, saving the result into the build folder.
  4. PostEval — After evaluation of each file plugins may be run to do additional work. Current plugins:
    • Markdown -> Html — convert Markdown content to HTML
    • Redirect links — generate redirecting files
  5. Postprocess — [WIP] Scan all files in build folder and validate/cleanup/minify as appropriate based on content type.
  6. Deploy — [Future] integration with deployment. First: S3 for CDN's

Escript

Dragon was initially build as an Escript application. However, Escript apps do not support NIFs (native compiled code), which is used by the Scss library, meaning we had to find another solution.

Plugins

More detail on this eventually. But at a high level, just implement the Dragon.Plugin behavior (see the code) and reference your plugin in the dragon config.

For plugins beyond the standard included with Dragon, you'll need to run in a "Mix Project" mode rather than "Standalone" mode.