views:

96

answers:

0

I'd like to create a macro which moves all my page specific style and javascript to named files.

For example:

default.aspx contains


<html>
<head>
<title>Weeee</title>
<link type="text/css" rel="stylesheet" href="../content/style.css"/>
<style type="text/css">
/*page specific style*/
</style>
<script type="text/javascript" src="../content/jquery.js"></script>
<script type="text/javascript">
 $(function() { /* page specific javascript */ });
</script>
</head>
<body>
<h1>Omg Weeee!</h1>
</body>
</html>

I'd like to create a macro which moves the page specific javascript and css to another file name default.js and default.css.

After running the macro I'd have three files.

default.aspx:


<html>
<head>
<title>Weeee</title>
<link type="text/css" rel="stylesheet" href="../content/style.css"/>
<link type="text/css" rel="stylesheet" href="default.css"/>
<script type="text/javascript" src="../content/jquery.js"></script>
<script type="text/javascript" src="default.js"></script>
</head>
<body>
<h1>Omg Weeee!</h1>
</body>
</html>

default.css:

/*page specific style*/

default.js:

 $(function() { /* page specific javascript */ });

Before I do the work myself. I was wondering if anyone knew of anything that does this already?

Thanks