Skip to content

Commit

Permalink
Asset Auto Discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel committed Aug 2, 2019
1 parent 15665d1 commit 158918d
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 56 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ You need to create a `compile.json` file first (or look at the [example file](ex
| generate | an array of files to generate. The index of the array will be passed in the generation process and is available in the \$nr variable |
| placeholders | (object) - You can use placeholders which will be replaced with the values in this file. |
| output_dir | Where should be the generated files be stored? eg. "../dist". If not specified, the source directory will be used as target directory. |
| zip | (object) settings for the ZIP file generation. Key "filename" is used for the output filename. Key "files" is an array of which files should be stored in the ZIP file. |
| zip | (object) settings for the ZIP file generation. Key "filename" is used for the output filename. Key "files" is an array of which additional files should be stored in the ZIP file. Local image assets will be automatically stored in the zip file|

## Parameters

Expand All @@ -63,7 +63,7 @@ You want to extend it? project is open for pull requests :)

Open Source License.
Developed by MilMike // 29.11.2017 (https://www.milmike.com)
Last Update: 01.01.2018 (Happy New Year!)
Last Update: 02.08.2019

## Further Reading

Expand Down
34 changes: 17 additions & 17 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified example/dist/compiled_templates.zip
Binary file not shown.
Binary file modified example/dist/img/htmlmailcompiler-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions example/dist/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This is a sample readme file.
This file will be added to the zip file because it was added in the compile.json file:


"zip": {
"filename": "compiled_templates.zip",
"files": [
"readme.txt"
]
}
23 changes: 15 additions & 8 deletions example/dist/template_awesome.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=1000, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<title>Example</title>

<!-- Developed by Your Company --> <!-- Last update: 2019-01-01 20:26 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=1000, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">

<title>Example</title>


<!-- Developed by Your Company -->
<!-- Last update: 2019-08-02 15:53 -->

</head>
<body style="font-family: Arial;">

<img src="img/htmlmailcompiler-logo.png" alt=""><h1 style="color: green;">I am a simple html email</h1>
<img src="img/htmlmailcompiler-logo.png" alt="">

<h1 style="color: green;">I am a simple html email</h1>

<div class="foo" style="background: #f5f5f5; padding: 10px; border: 1px solid gray;">
<p style="font-weight: bold;">What can the compiler do for you?</p>
<ul>
<li style="font-size: 18px;">
<li style="font-size: 18px;">
You can work with CSS selectors and create your styles in a CSS file. The compiler will generate a html file with inline CSS.
</li>

Expand All @@ -32,6 +38,7 @@
</li>

</ul>

</div>

<div class="included" style="background-color: silver; padding: 10px;">
Expand Down
23 changes: 15 additions & 8 deletions example/dist/template_cool.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=1000, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<title>Example</title>

<!-- Developed by Your Company --> <!-- Last update: 2019-01-01 20:26 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=1000, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">

<title>Example</title>


<!-- Developed by Your Company -->
<!-- Last update: 2019-08-02 15:53 -->

</head>
<body style="font-family: Arial;">

<img src="img/htmlmailcompiler-logo.png" alt=""><h1 style="color: green;">I am a simple html email</h1>
<img src="img/htmlmailcompiler-logo.png" alt="">

<h1 style="color: green;">I am a simple html email</h1>

<div class="foo" style="background: #f5f5f5; padding: 10px; border: 1px solid gray;">
<p style="font-weight: bold;">What can the compiler do for you?</p>
<ul>
<li style="font-size: 18px;">
<li style="font-size: 18px;">
You can work with CSS selectors and create your styles in a CSS file. The compiler will generate a html file with inline CSS.
</li>

Expand All @@ -32,6 +38,7 @@
</li>

</ul>

</div>

<div class="included" style="background-color: silver; padding: 10px;">
Expand Down
23 changes: 15 additions & 8 deletions example/dist/template_yeah.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=1000, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<title>Example</title>

<!-- Developed by Your Company --> <!-- Last update: 2019-01-01 20:26 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=1000, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">

<title>Example</title>


<!-- Developed by Your Company -->
<!-- Last update: 2019-08-02 15:53 -->

</head>
<body style="font-family: Arial;">

<img src="img/htmlmailcompiler-logo.png" alt=""><h1 style="color: green;">I am a simple html email</h1>
<img src="img/htmlmailcompiler-logo.png" alt="">

<h1 style="color: green;">I am a simple html email</h1>

<div class="foo" style="background: #f5f5f5; padding: 10px; border: 1px solid gray;">
<p style="font-weight: bold;">What can the compiler do for you?</p>
<ul>
<li style="font-size: 18px;">
<li style="font-size: 18px;">
You can work with CSS selectors and create your styles in a CSS file. The compiler will generate a html file with inline CSS.
</li>

Expand All @@ -32,6 +38,7 @@
</li>

</ul>

</div>

<div class="included" style="background-color: silver; padding: 10px;">
Expand Down
5 changes: 1 addition & 4 deletions example/src/compile.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
"zip": {
"filename": "compiled_templates.zip",
"files": [
"template_cool.html",
"template_awesome.html",
"template_yeah.html",
"img/htmlmailcompiler-logo.png"
"readme.txt"
]
}
}
Binary file modified example/src/img/htmlmailcompiler-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions example/src/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This is a sample readme file.
This file will be added to the zip file because it was added in the compile.json file:


"zip": {
"filename": "compiled_templates.zip",
"files": [
"readme.txt"
]
}
1 change: 1 addition & 0 deletions example/src/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<body>

<img src="img/htmlmailcompiler-logo.png" alt="">

<h1>I am a simple html email</h1>

<div class="foo">
Expand Down
Loading

0 comments on commit 158918d

Please sign in to comment.