Skip to content

Commit

Permalink
Add --exclude-script to respec2html
Browse files Browse the repository at this point in the history
  • Loading branch information
dontcallmedom committed Dec 17, 2015
1 parent e66acec commit 72ef6f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/respec2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var page = require("webpage").create()
, timer
, reportErrors = false
, reportWarnings = false
, ignoreScripts = false
, errors = []
, warnings = []
;
Expand All @@ -30,6 +31,13 @@ if (args.indexOf("-w") !== -1) {
reportWarnings = true;
}

if (args.indexOf("--exclude-script") !== -1) {
var idx = args.indexOf("--exclude-script");
var values = args.splice(idx, 2);
ignoreScripts = values[1];
}


// Reading other parameters
var source = args[1]
, output = args[2]
Expand All @@ -52,6 +60,8 @@ if (args.length < 2 || args.length > 4) {
page.onResourceRequested = function (requestData, networkRequest) {
if (requestData.url === "file://www.w3.org/Tools/respec/respec-w3c-common") {
networkRequest.changeUrl("https://www.w3.org/Tools/respec/respec-w3c-common");
} else if (ignoreScripts && requestData.url.indexOf(ignoreScripts) === 0) {
networkRequest.abort();
}
};

Expand Down

1 comment on commit 72ef6f5

@plehegar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add the documentation of the new parameter on the command line

Please sign in to comment.