Skip to content

Browserify plugin to automatically include Raptor Template files referenced inside a module

Notifications You must be signed in to change notification settings

jasonmacdonald/markoify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markoify

This Browserify transform results in any referenced Marko templates to automatically be compiled and bundled up so that the templates can be rendered in the browser.

Installation

npm install markoify --save

Usage:

browserify -t markoify main.js > browser.js

Example

my-project/template.marko:

Hello ${data.name}!

my-project/main.js:

var template = require('./template.marko');
template.render({
        name: 'World'
    },
    function(err, output) {
        console.log('Output: ', output)
    });
browserify -t markoify main.js > browser.js

Page HTML:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Marko+Browserify Test</title>
    </head>
    <body>
        <script src="browser.js"></script>
    </body>
</html>

Browser output:

Output: Hello World!

Further Reading

Discuss

If you have any questions or run into any problems, please reach out to us in the Marko Gitter chat room or open a Github issue.

Contributors

Contribute

Pull Requests welcome. Please submit Github issues for any feature enhancements, bugs or documentation problems.

License

Apache License v2.0

About

Browserify plugin to automatically include Raptor Template files referenced inside a module

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%