Skip to content

Commit

Permalink
deps and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kethinov committed Sep 26, 2020
1 parent b71e33c commit dd1b99f
Show file tree
Hide file tree
Showing 3 changed files with 385 additions and 150 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ Using Teddy with client-side JS
===

- Use Teddy in a script tag without a module bundler: Install Teddy with npm. You can then load the `node_modules/teddy/dist/teddy.js` file into a script tag which will create a global `teddy` variable you can use to gain access to its API.
- Use Teddy with a module bundler: Install Teddy with npm. You can then import the module from `node_modules/teddy/dist/teddy.js` to a module bundler like Browserify, Webpack, etc to gain access to its API.
- Use Teddy with a module bundler: Install Teddy with npm. You can then import the module from `node_modules/teddy/dist/teddy.js` to a module bundler like Browserify, Webpack, etc to gain access to its API.

You can then pass source code to Teddy's render method, like so: `teddy.render(sourceCode, yourModel)`. The render method will return a fully rendered template. See [API documentation](https://github.com/rooseveltframework/teddy#api-documentation) for more information about the Teddy API.

Expand All @@ -426,7 +426,8 @@ API documentation
- `teddy.compile(template)`: Compile a template by supplying either source code or a file name (in Node.js).
- Populates internal `templates` cache with the new template in the format of `templates[path]: compiledSource`.
- Can be accessed from `teddy.getTemplates()`
- `teddy.getTemplates()`: Get the internal cache of templates
- `teddy.getTemplates()`: Get the internal cache of templates.
- `teddy.setTemplate(name, template)`: Add a new template to the template cache.
- `teddy.render(template, model)`: Render a template by supplying either source code or a file name (in Node.js).
- Returns fully rendered HTML.
- Removes `{! teddy comments !}`
Expand Down
Loading

0 comments on commit dd1b99f

Please sign in to comment.