-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grunt W3C Validation #470
Merged
Merged
Grunt W3C Validation #470
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2a66569
Add W3C Validation Dependency to package.json
nvasileiadis ebbad57
Add Error Keeping Directory & Error Output Template
nvasileiadis 2836afd
Update gitignore for Validation related files
nvasileiadis c559ea6
Update Gruntfile to run with W3C Validation
nvasileiadis d1b69d4
Relocate File to /tests/validation
nvasileiadis 40f354a
Update gitignore to bypass tests/validation
nvasileiadis ec65bb1
Add directories to gitattributes
nvasileiadis cf1e835
Update Gruntfile for W3C Validation
nvasileiadis b426b6e
Update ignore to include only newly generated folders
nvasileiadis cf08416
Remove Email Related Folders from Validate Task
nvasileiadis a735d0a
Merge branch 'develop' into grunt-w3c-validation
nvasileiadis 9fc1d78
Add Casper JS File
nvasileiadis 6ab3c56
Add CasperJS Dependency to the Project
nvasileiadis 713c2a3
Add New Folder Structure to gitignore
nvasileiadis 9e8b909
Add CasperJS to Gruntfile
nvasileiadis d094ad7
Add CasperJS Browsing Steps
nvasileiadis 56583e9
Fix For Loop to Iterate Every Link in Primary Nav
nvasileiadis 0658792
Resolve Duplicate HTML Outputs Issue
nvasileiadis 07e3581
Add Filter of URL Names for Use in Output Files
nvasileiadis 1719aa0
Fix Output File Names to Match the URLs
nvasileiadis 9357087
Merge branch 'develop' into grunt-w3c-validation
nvasileiadis 9b1f768
Improve Report File Name Title Readability
nvasileiadis c38c0fd
Merge branch 'grunt-w3c-validation' of https://github.com/jadu/pulsar…
nvasileiadis 81e8e44
Refactoring Based on Peer Review and Hound
nvasileiadis eb9e212
Improve Index Output Naming
nvasileiadis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
var fs = require('fs'); | ||
var links; | ||
|
||
function getLinks() { | ||
var links = document.querySelectorAll('.nav-link.t-nav-link'); | ||
return Array.prototype.map.call(links, function (e) { | ||
return e.getAttribute('href'); | ||
}); | ||
} | ||
|
||
casper.start('http://192.168.13.37/index.php', function() { | ||
"use strict"; | ||
fs.write('tests/validation/html_output/_index.html', this.getPageContent(), 'w'); | ||
}); | ||
|
||
casper.then(function () { | ||
var links = this.evaluate(getLinks); | ||
var current = 0; | ||
var end = links.length; | ||
// Get the word before .html.twig, the word before the last '/' and the word in urls like '/lexicon' | ||
var regex = /((\w*)(\/|.html.twig)$)|(\/\w*$)/gm; | ||
var match = []; | ||
var newlinks = []; | ||
|
||
// Remove links within the same page | ||
for (var i = 0; i < links.length; i++) { | ||
if (links[i].indexOf('#') === -1) { | ||
newlinks.push(links[i]); | ||
} | ||
} | ||
|
||
// Get Page Name from URL | ||
for (i = 0; i < newlinks.length; i++) { | ||
if (newlinks[i].match(regex)) { // Remove null items that didn't pass the regex | ||
var link = newlinks[i].match(regex); | ||
var filtered = link[0]; // Get just the name from the results array | ||
var splited = filtered.split('.'); // Split dots to remove .html.twig part | ||
var replaced = splited[0].replace('/', ''); // Remove '/' | ||
match.push(replaced); // Keep just the names in a separata array | ||
}; | ||
}; | ||
|
||
for (;current < end;) { | ||
(function(cntr) { | ||
casper.thenOpen('http://192.168.13.37' + newlinks[cntr] + '', function() { | ||
fs.write('tests/validation/html_output/_' + match[cntr] + '_.html', this.getPageContent(), 'w'); | ||
}); | ||
})(current); | ||
current++; | ||
} | ||
}); | ||
|
||
casper.run(function() { | ||
"use strict"; | ||
this.exit(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>W3C Error Report for {{filename}}</title> | ||
</head> | ||
<body> | ||
<table border='0' align='center' cellpadding='5' cellspacing='0' style='border-collapse:collapse;background-color:Wheat;color:black;font-family:arial,helvetica,sans-serif; width:100%'> | ||
<tbody> | ||
<tr> | ||
<td colspan='6' style='padding:5px;background-color:SteelBlue;color:Wheat;font-size:200%;border:2px solid SteelBlue;text-align:center;'>W3C Validation Report | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan='6' style='padding:5px;background-color:SteelBlue;color:Wheat;font-size:125%;border:2px solid SteelBlue;text-align:center;'>{{filename}} | Error Count : {{error.length}} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style='text-align:center;font-size:125%;border:2px solid SteelBlue;white-space:nowrap;'>Error Number | ||
</td> | ||
<td style='text-align:center;font-size:125%;border:2px solid SteelBlue;white-space:nowrap;'>Error Type | ||
</td> | ||
<td style='text-align:center;font-size:125%;border:2px solid SteelBlue;white-space:nowrap;'>Line Number | ||
</td> | ||
<td style='text-align:center;font-size:125%;border:2px solid SteelBlue;white-space:nowrap;' >Error Message | ||
</td> | ||
<td style='text-align:center;font-size:125%;border:2px solid SteelBlue;white-space:nowrap;' >Error Source Code Reference | ||
</td> | ||
<td style='text-align:center;font-size:125%;border:2px solid SteelBlue;white-space:nowrap;' >Error Explanation | ||
</td> | ||
</tr> | ||
{{#each error}} | ||
<tr> | ||
<td style='text-align:center;font-size:100%;border:2px solid SteelBlue;'>{{@index}} </td> | ||
<td style='text-align:center;font-size:100%;border:2px solid SteelBlue;'>{{type}} </td> | ||
<td style='text-align:center;font-size:100%;border:2px solid SteelBlue;'>{{lastLine}} </td> | ||
<td style='text-align:center;font-size:100%;border:2px solid SteelBlue;'>{{message}} </td> | ||
<td style='text-align:center;font-size:100%;border:2px solid SteelBlue;'><code>{{errSrcFirstPart}}{{{errSrcToHighlight}}}{{errSrcSecondPart}}</code> </td> | ||
<td style='text-align:center;font-size:100%;border:2px solid SteelBlue;'>{{{explanation}}} </td> | ||
</tr> | ||
{{/each}} | ||
</tbody> | ||
</table> | ||
</body> | ||
</html> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files will also need adding to the
.gitattributes
file asexport-ignore
rules so that Continuum products can ignore themThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added