2

I would like to know if a tool existed to generate a one HTML file from a set of HTML, CSS and Javascript files. It should parse the HTML and replace any include with the contents of the file.

An example:

<!DOCTYPE html>

<html>
<head>
    <title>My example</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="test.css" />
    <script src="test.js" ></script>
</head>

<body>
    <input class="test" type="button" value='Test' onclick="testThat()"></input>
</body>

</html>

Should output:

<!DOCTYPE html>

<html>
<head>
    <title>My example</title>
    <meta charset="utf-8" />
    <style>
    .test {
        color: red;
    }
    </style>
    <script>
    function testThat() {
        alert('itWorks');
    }
    </script>
</head>

<body>
    <input class="test" type="button" value='Test' onclick="testThat()"></input>
</body>

</html>

I am sure such a tool exists but I can't find it yet!

It should run on Windows, and being free is better (with a donation button if you liked the tool).

3
  • 1
    This sounds like a task to be automated. Is a command line tool ok? Jan 27, 2016 at 20:13
  • 1
    So you need a tool that will (recursively) parse an HTML file, find file references, and include those files (and anything they contain) in your one file? What's the use case?
    – Ira Baxter
    Jan 28, 2016 at 5:16
  • 1
    The use case is : confluence.atlassian.com/doc/html-macro-38273085.html
    – Thomas
    Jan 28, 2016 at 10:35

1 Answer 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.