question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add more Sassdoc annotations and generate Sass docs in markdown

See original GitHub issue

Summary

We’re currently using Sassdoc to mark public or private @access but beyond that, we’re inconsistent and documenting Sass hasn’t been a priority.

Once https://github.com/IBM/carbon-elements/pull/462 is merged and subsequently merged into carbon-components, we can modify our build to auto-generate our public Sass API.

Here’s an example from carbon-elements once all Sass functions, mixins, and variables have been annotated: https://github.com/IBM/carbon-elements/blob/0f6ffed16a7aa0b3074a665ea7b54184a5bec7b6/packages/elements/docs/sass.md

There would be three parts to completing this:

  1. Add complete, consistent, Sassdoc annotations to all Sass source originating from carbon-components
  2. Document Sassdoc annotation style in our contribution guidelines
  3. New build script to call in our built, e.g.:
"scripts": {
  "build": "gulp build && yarn docs",
  "docs": "bundler sassdoc 'scss' --output 'docs/api' && bundler sassdoc 'scss' --json --output 'docs/api/data'"
}

That example above generates sass.md in the /docs/api directory, and also sass.json in /docs/api/data directory. sass.json is the data dump generated by Sassdoc during the build.

Not in scope for this issue: Going forward, it would be great to have carbon-website consume the json object and render a more visually appealing way to understand and use our tokens.

Justification

Our Sass is minimally documented and even with the current comments, you have to crawl through source to find it.

By having one source of truth (/docs/api/sass.md), a developer can more easily find what’s available in our Sass API when using Carbon styling to extend Carbon through custom components or to theme Carbon.

Not in scope for this issue: Also, with /docs/api/data/sass.json, we’d be able to programmatically present token and theming information in carbon-website.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
asudohcommented, Apr 4, 2019

OK cool - Thank you @mattrosno for clarifying!

0reactions
mattrosnocommented, Apr 4, 2019

@asudoh regarding carbon-website, that works.

This issue focuses on /docs/api/sass.md that lives in this repo.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add more Sassdoc annotations and generate Sass docs in ...
Summary We're currently using Sassdoc to mark public or private ... Add more Sassdoc annotations and generate Sass docs in markdown #2266.
Read more >
SassDoc Annotations | Herman Documentation - OddBird
Herman supports all the core SassDoc annotations. This page includes samples of every ... You can actually put much more text in here,...
Read more >
Annotations - SassDoc
@group§ Groups define the way items are displayed in SassDoc's default theme. Groups can be aliased for friendly names from the configuration (more...
Read more >
An easy way to document your Sass code - Creative Bloq
Hugo Giraudel reveals how to use SassDoc to generate powerful documentation from inline comments.
Read more >
Document Your Sass Projects with SassDoc - Web Development
After this, your next build will be using the new theme. Convert Your SassDoc to Markdown. It can be handy, and it is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found