Created by: MartijnCuppens
Fixes #25977 (closed).
All mixins are generated by the mixins_documentation
jekyll plugin under the _plugins
folder. This plugins executes the npm run mixins-documentation --silent
command. The --silent
parameter prevents the filename to be outputted.
npm run mixins-documentation --silent
runs build/mixins-documentation.js
. This script reads all the .scss
files in the scss/mixins
folder and returns a list of the mixin names, the file location and the mixin itself in code block.
It's also possible to add a description to a mixin. Therefore you can add a comment block just above the mixin (no blank lines between the mixin and the comment block). Markdown is supported in these blocks. Stylelint comments are ignored.
Demo: https://deploy-preview-26500--twbs-bootstrap4.netlify.com/docs/4.2/extend/mixins/
TODO:
-
fix stylelint comments detection -
switch to shell.js's find -
link to the actual mixin file -
automatically convert links -
move Mixins
page underExtend
nav -
enable stylelint rule to check for newlines between mixins, and no newlines before mixins when there's a comment -
maybe sort mixins alphabetically; currently they are sorted by their filename and then alphabetically -
use smaller headers for mixins in the same file so that ToC detects them properly -
decouple task from Jekyll maybe (remove the Jekyll plugin) -
show a callout for deprecated mixins -
fix link to file line bug -
Check if https://github.com/twbs/bootstrap/issues/25977#issuecomment-455917335 could be useful to build the docs