Comments (6)
I am not sure what's the best way to tackle this one.
Could @requires
need a type argument (mixin/function/variable)?
// @requires {mixin} base
// @requires {function} thing
// @requires {var} some-global-variable
Any input, @valeriangalliat?
from sassdoc.
I'm not sure - I mean, on one hand - its probably not a good idea to have mixins and functions sharing names in your code base, but as a documentation tool - I'm not sure if its valid to be opinionated about best practices - so maybe the type
argument would be optional @hugogiraudel ?
My comment assumes, @danielguillan, that what you're having an issue with is that in addition to the Sass you posted in your comment, you also have a function named base?
Eg.
@mixin base {
@content;
}
@function base() {
@return foo;
}
// Requires base
// ---
// @requires base
@mixin requires-base {
@content;
}
Is this a complete demonstration of what our Sass contains that is causing the bug?
from sassdoc.
I was about to say the exact same thing as @alademann - make the type
optional, and add a warning when there is no type and a name conflict between a function/mixin/var.
from sassdoc.
My comment assumes, @danielguillan, that what you're having an issue with is that in addition to the Sass you posted in your comment, you also have a function named base?
Nope, as of today, if you use @requires
on a mixin, it will try to fetch a function, and vice versa. Not sure why it works this way though.
from sassdoc.
Agreed on having optional type.
from sassdoc.
Okay, it should now be fixed in both master
and real-parser
branches.
Basically the idea is the following one: when parsing a @requires
flag, if there is a type given, we store it. Then once we're done parsing everything, the same way we deal with aliases, we post treat data to fill missing informations.
In this case, for each item with at least a require, and in the case where the type has not been given obviously, we find the type of the first item named after the value of the require flag, and store it.
from sassdoc.
Related Issues (20)
- Security vulnerability via update-notifier dependency HOT 2
- Support documentation for css custom properties HOT 1
- Maintenance Status HOT 1
- "verbose" and "strict" parameters are ignored if defined within configuration
- SASS files correctly parsed but the documentation is not generated HOT 4
- feature request (?): link to image HOT 2
- Screen overflow on mobile
- `@see` doesn't recognize sass module references
- Warning for Annotation `property` when it is not being used
- Allow more than one @output HOT 1
- [ERROR] Could not find any executable for "sass-convert". Operation Aborted. HOT 3
- Keywords feature
- [WARNING] Parser for annotation `flag` not found. Location: `linePoster.test.scss:5:8` HOT 1
- Interested in TypeScript definitions? HOT 2
- esm support
- Remove vulnerable `update-notifier` dependency
- Update the version of jQuery used in the built docs
- How to document @function that takes parameter a map key.
- Deprecation warning for core-js when installing sassdoc. Upgrade needed.
- Overrides the editor.definitionLinkOpensInPeek setting. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sassdoc.