-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Mixins documentation page #26500
Mixins documentation page #26500
Conversation
Wow I totally missed this patch :/ From a quick look I like it. But I still see stylelint comments in the output. Also, I wouldn't enforce Markdown in the comments. We could just use a lib maybe? EDIT: and I think it would be better to sort them alphabetically. |
@XhmikosR, should'nt we leave the stylelint comments? And do you have any suggestions for a lib we can use to transform the links in clickable links? |
I think the Stylelint comments don't offer any help here where we just want the code and we shouldn't assume everyone is using Stylelint. For libs there are plenty, not sure which one to use, maybe check them out with https://packagephobia.now.sh/
and probably even more :) EDIT: So basically the only gain in using a lib is so that we don't reinvent the wheel that's all. Although your solution seems to already work good enough, I'm just trying to future-proof this. |
ebdf6f1
to
848f7cd
Compare
I rebased this and squashed it. Not sure about the plugin which runs the npm script though. I don't like mixing the two environments a lot. |
848f7cd
to
aaa66ea
Compare
This comment has been minimized.
This comment has been minimized.
@@ -3,9 +3,11 @@ | |||
@mixin float-left { | |||
float: left !important; | |||
} | |||
|
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.
BTW this reminds me, we should have stylelint check for this newline.
0386b1d
to
a11d1d3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4cd2af3
to
5840a58
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5840a58
to
43cff74
Compare
@MartijnCuppens: I pushed a couple of patches, feel free to squash everything or we do it when we merge. I also added a couple more TODOs. |
62c5def
to
3606219
Compare
Don't think there is a stylelint rule for this at the moment
I tried to store the output in an array, but the streams happen async, so I cant just sort all mixins after the
Can you give an example of what you mean?
Any other suggestions here? |
…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.
Not so robust, for example fails if the comment ends with `,` after the link, but seems to cover our cases.
378b702
to
69bab91
Compare
The line counter seems wrong, most noticeable in mixins that are not the only ones in a file. |
@mdo, we're going to postpone this to |
Thoughts on the status of this @MartijnCuppens? |
I think we now better use |
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.
file:///private/var/mobile/Containers/Shared/AppGroup/CF621F42-9601-44F7-8BFF-C5990641C86D/File%20Provider%20Storage/88219381/1IzQCUzzb1E84lB6JR47zMDg5wAFb9ZGa/memories_history.html
Fixes #25977.
All mixins are generated by the
mixins_documentation
jekyll plugin under the_plugins
folder. This plugins executes thenpm run mixins-documentation --silent
command. The--silent
parameter prevents the filename to be outputted.npm run mixins-documentation --silent
runsbuild/mixins-documentation.js
. This script reads all the.scss
files in thescss/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:
Mixins
page underExtend
nav