twbs/bootstrap

Reusable Sass utilities API documentation section

Open

#38,434 建立於 2023年4月10日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)MDX (174,240 star) (78,904 fork)batch import
docsenhancementhelp wanted

描述

Enhancement suggested in https://github.com/twbs/bootstrap/pull/38219#discussion_r1148250058.

Our "Sass utilities API" sections are always written the same way.

We would need a shortcode or partial or anything else with two params:

  • First part of the sentence (e.g. "Background" or "Object fit")
  • The param (the key) used for scss-docs (e.g. "utils-bg-color")

We would like to call it like this:

{{< sass-utilities-api-section "Background" "utils-bg-color" >}}

And it would contain something like:

### Sass utilities API

{{ firstParam }} utilities are declared in our utilities API in `scss/_utilities.scss`. [Learn how to use the utilities API.]({{< docsref "/utilities/api#using-the-api" >}})

{{< scss-docs name="{{ secondParam }}" file="scss/_utilities.scss" >}}

We would need some help to do it. On my side, I don't exactly how to build it with Hugo. I tried a few things but haven't managed to succeed by calling scss-docs and docsref within another shortcode or from a partial.

貢獻者指南