{"id":22119989,"url":"https://github.com/maxpleaner/slim-lang-loader","last_synced_at":"2025-07-05T05:33:20.769Z","repository":{"id":57363204,"uuid":"84257017","full_name":"MaxPleaner/slim-lang-loader","owner":"MaxPleaner","description":"Webpack loader: slim =\u003e html =\u003e javascript","archived":false,"fork":false,"pushed_at":"2019-10-27T20:16:59.000Z","size":10,"stargazers_count":19,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-14T15:49:23.695Z","etag":null,"topics":["webpack","webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaxPleaner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-07T23:36:30.000Z","updated_at":"2024-01-09T19:36:44.000Z","dependencies_parsed_at":"2022-09-06T12:40:54.570Z","dependency_job_id":null,"html_url":"https://github.com/MaxPleaner/slim-lang-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxPleaner%2Fslim-lang-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxPleaner%2Fslim-lang-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxPleaner%2Fslim-lang-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxPleaner%2Fslim-lang-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxPleaner","download_url":"https://codeload.github.com/MaxPleaner/slim-lang-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227574393,"owners_count":17788182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["webpack","webpack-loader"],"created_at":"2024-12-01T14:19:42.608Z","updated_at":"2024-12-01T14:19:43.077Z","avatar_url":"https://github.com/MaxPleaner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slim-lang-loader\r\n\r\nThis is a webpack loader to transform [slim](http://slimlang.org) files\r\ninto HTML, and then load that HTML into Javascript. This is \"true blue\"\r\nslim, using the ruby program's CLI executable.\r\n\r\nThe resulting HTML does not have any boiler added - it can be full\r\nHTML documents or just partials / fragments.\r\n\r\nThe code here is a modified version of\r\n[coffee-loader](https://github.com/webpack-contrib/coffee-loader).\r\n\r\n## howto\r\n\r\n1. Make sure the `slim` gem is installed and there is a `slimrb`\r\nexecutable available.\r\n\r\n2. Install this into your project: `npm install --save slim-lang-loader` (or `yarn add -D slim-lang-loader`)\r\n\r\n3. Add hook to `webpack.config.js` (_make sure to put this above any loader\r\nthat expects javascript or coffeescript input_):\r\n\r\n    ```js\r\n    {test: /\\.slim$/, loader: ['slim-lang-loader']},\r\n    ```    \r\n\r\n    Also, add `.slim` to the list of extensions:\r\n  \r\n    ```jsP\r\n    resolve: {\r\n      extensions: ['.js\", \u003cetc\u003e, \".slim\"]\r\n    },\r\n    ```\r\n\r\n4. load templates from javascript:\r\n\r\n    ```js\r\n     var file = require(\"html-loader!./test.slim\");\r\n     alert(file); // this will be a html string that auto-reloads \r\n    ```\r\n\r\n## slim options\r\n\r\nYou can pass [Slim options](http://www.rubydoc.info/gems/slim/frames#Configuring_Slim) to slimrb using following syntax:\r\n\r\n```js\r\nloader: [\r\n  {\r\n    loader: 'slim-lang-loader',\r\n    options: {\r\n      slimOptions: {\r\n        'disable_escape': true\r\n      }\r\n    }\r\n  }\r\n]\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpleaner%2Fslim-lang-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxpleaner%2Fslim-lang-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpleaner%2Fslim-lang-loader/lists"}