mirror of
				https://github.com/KevinMidboe/inline-html.git
				synced 2025-10-29 17:40:29 +00:00 
			
		
		
		
	Updated README.
This commit is contained in:
		
							
								
								
									
										10
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								README.md
									
									
									
									
									
								
							| @@ -16,22 +16,27 @@ Inline local assets referenced in an HTML document. | |||||||
|  |  | ||||||
| This: | This: | ||||||
|  |  | ||||||
|  | ```js | ||||||
| var inlineHtml = require('inline-html'); | var inlineHtml = require('inline-html'); | ||||||
| inlineHtml('path/to/file.html').then(function (html) { | inlineHtml('path/to/file.html').then(function (html) { | ||||||
| 	... | 	... | ||||||
| }); | }); | ||||||
|  | ``` | ||||||
|  |  | ||||||
| Turns this: | Turns this: | ||||||
|  |  | ||||||
|  | ```html | ||||||
| <link rel="stylesheet/less" href="main.less"/> | <link rel="stylesheet/less" href="main.less"/> | ||||||
| <style> | <style> | ||||||
| 	div { background-image: url('path/to/file'); } | 	div { background-image: url('path/to/file'); } | ||||||
| </style> | </style> | ||||||
| <div style="background-image: url('path/to/file');"></div> | <div style="background-image: url('path/to/file');"></div> | ||||||
| <img src="path/to/file"/> | <img src="path/to/file"/> | ||||||
|  | ``` | ||||||
|  |  | ||||||
| Into this: | Into this: | ||||||
|  |  | ||||||
|  | ```html | ||||||
| <style> | <style> | ||||||
| 	@font-face { src: url('data:...'); } | 	@font-face { src: url('data:...'); } | ||||||
| 	div { background-image: url('data:...'); } | 	div { background-image: url('data:...'); } | ||||||
| @@ -41,17 +46,22 @@ Into this: | |||||||
| </style> | </style> | ||||||
| <div style="background-image: url('data:...');"></div> | <div style="background-image: url('data:...');"></div> | ||||||
| <img src="data:..."/> | <img src="data:..."/> | ||||||
|  | ``` | ||||||
|  |  | ||||||
| Where: | Where: | ||||||
|  |  | ||||||
| - `main.less` | - `main.less` | ||||||
|  |  | ||||||
|  | ```css | ||||||
| @import (inline) 'main.css'; | @import (inline) 'main.css'; | ||||||
| div { background-image: url('path/to/file'); } | div { background-image: url('path/to/file'); } | ||||||
|  | ``` | ||||||
|  |  | ||||||
| - `main.css` | - `main.css` | ||||||
|  |  | ||||||
|  | ```css | ||||||
| @font-face { src: url('path/to/file'); } | @font-face { src: url('path/to/file'); } | ||||||
|  | ``` | ||||||
|  |  | ||||||
| ## API | ## API | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user