-2

I am having a (lot) too large html file with more than 1500 lines. I'd like to split it into serveral file and merge them. It would be more maintainable et readable.

For example.

Page1:

<h1> Title 1 <h2>
<div> my div </div>

Page2:

<h1> Title 2 <h2>
<div> my div </div>

Then merge and display:

Page.html

<h1> Title 1 <h2>
<div> my div </div>
<h1> Title 2 <h2>
<div> my div </div>

That way, I can change one module and find it easily.

Is there a pure html or JS library? In .Net, it would be partial view. I am working with Bootstrap, tabs and modal. So Iframe is not the solution. Thanks,

Stéphane.

Stefdelec
  • 2,711
  • 3
  • 33
  • 40

1 Answers1

0

If your only concern is concating the files and you are using a UNIX based system (Linux, iOS), you can just type the command cat * > output.html into the shell and get all your files in one output.html.

If you are planning to create a website, where not only concat HTML files, but also various of other steps (minifying, CSS prefixing, SASS->CSS conversion etc.), you could use a Grunt or Gulp build process. There's e.g. a grunt-contrib-concat plugin which can be used for your exact use case.

ssc-hrep3
  • 15,024
  • 7
  • 48
  • 87
  • This would result in an invalid html out file with one file appearing after the other, any browser would reject it. – SPlatten May 26 '16 at 08:37
  • Hi, my aim is not production, but for templating. After the website will be dynamic and made with MVC .Net. For example tables will be generated serverside. But for now I having these 50 rows tables that takes hips of lines. So yes, what I want is to organise my code not my rendering. – Stefdelec May 26 '16 at 08:39