Skip to content

Commit 23762b8

Browse files
committed
Exclude import-only files from Sassdoc
v6.2.0 adds import only files in GOV.UK Frontend, some of which have duplicate the Sass documentation from their corresponding Sass module. To avoid duplicating entries in the Sass API, we use a `sassdoc.config.json` file to exclude the `.import.scss` file. Unfortunately, there's [no flag for Sassdoc's CLI to exclude files](http://sassdoc.com/getting-started/#options) and working out a glob pattern would make things a little cryptic.
1 parent 674ce9e commit 23762b8

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"scripts": {
66
"start": "bundle exec middleman server",
77
"postinstall": "npm run build:sassdoc && npm run build:sassdocv5 && npm run build:sassdocv4",
8-
"build:sassdoc": "sassdoc --no-update-notifier --parse node_modules/govuk-frontend/dist/govuk/ > data/sassdoc.json",
9-
"build:sassdocv5": "sassdoc --no-update-notifier --parse node_modules/govuk-frontend-v5/dist/govuk/ > data/sassdoc-v5.json",
10-
"build:sassdocv4": "sassdoc --no-update-notifier --parse node_modules/govuk-frontend-v4/govuk/ > data/sassdoc-v4.json",
8+
"build:sassdoc": "sassdoc -c sassdoc.config.json --parse node_modules/govuk-frontend/dist/govuk/ > data/sassdoc.json",
9+
"build:sassdocv5": "sassdoc -c sassdoc.config.json --parse node_modules/govuk-frontend-v5/dist/govuk/ > data/sassdoc-v5.json",
10+
"build:sassdocv4": "sassdoc -c sassdoc.config.json --parse node_modules/govuk-frontend-v4/govuk/ > data/sassdoc-v4.json",
1111
"lint": "standard",
1212
"check-links": "hyperlink --canonicalroot https://frontend.design-system.service.gov.uk --internal --recursive build/index.html --skip 'property=\"og:image\"' --skip 'application.js' | tee check-links.log | tap-mocha-reporter min"
1313
},

sassdoc.config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"exclude": ["**/*.import.scss"],
3+
"no-update-notifier": true
4+
}

0 commit comments

Comments
 (0)