Skip to content
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

XML Pretty-print should be an editorial concern not enforced during the build #637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 30 additions & 18 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,28 @@ var lintScripts = function(done) {
done()
}

// pretty print all xml listings
// articles not yet decided
var prettyXml = function(done) {
src(paths.xml.listings, { base: "./" })
.pipe(muxml({
stripComments: false,
stripCdata: false,
stripInstruction: false,
saxOptions: {
trim: true,
normalize: true
}
}))
.pipe(dest("./"))
// Signal completion
done()
function prettyPrintXml(xmlSrcPath, xmlTargetPath, done) {
src(xmlSrcPath, { base: "./" })
.pipe(muxml({
stripComments: false,
stripCdata: false,
stripInstruction: false,
saxOptions: {
trim: true,
normalize: true
}
}))
.pipe(dest(xmlTargetPath))
// Signal completion
done()
}

var prettyPrintListingsXml = function(done) {
line-o marked this conversation as resolved.
Show resolved Hide resolved
prettyPrintXml(paths.xml.listings, "./", done)
}

var prettyPrintArticlesXml = function(done) {
prettyPrintXml(paths.xml.articles, "./", done)
}

// Process, lint, and minify Sass files
Expand Down Expand Up @@ -351,7 +357,13 @@ exports.default = series(
buildStyles,
buildSVGs,
copyFiles,
buildPack,
prettyXml
buildPack
)
)

// Pretty Print XML task
// gulp
exports.prettyPrintXml = parallel(
prettyPrintArticlesXml,
prettyPrintListingsXml
)