https://github.com/kyleburton/om-razor
Helper for converting markup to Om components.
https://github.com/kyleburton/om-razor
Last synced: 10 months ago
JSON representation
Helper for converting markup to Om components.
- Host: GitHub
- URL: https://github.com/kyleburton/om-razor
- Owner: kyleburton
- Created: 2014-09-02T16:57:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-27T12:49:03.000Z (over 11 years ago)
- Last Synced: 2025-01-29T06:48:57.121Z (12 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OM Razor
Cut, slice, transform, parts of a web page into [OM](https://github.com/swannodette/om) DOM builders.
In found the process of converting [Bootstrap Themes](http://getbootstrap.com/) (like [SB Admin](http://startbootstrap.com/template-overviews/sb-admin/)) into OM DOM builders to be tedious.
Given the example markup, the process of conversion is largely rote. This is quick hack to automate the process.
To run the code-generator, place the following script tags into your page:
```html
```
Then open the javascript console and run `OmRazor.domToOm` pasing at a minimum the jQuery selector:
```javascript
OmRazor.domToOm({selector: '.breadcrumb', name: 'breadcrumb'})
```
When run for the SB Admin Theme, that produces:
```clojure
(defn breadcrumb [data owner]
(d/ol
#js {:className "breadcrumb"}
" "
(d/li
#js {:className "active"}
" Dashboard "
(d/i
#js {:className "fa fa-dashboard"}))))
```