Skip to content
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

Feature: create details summary element like vitepress #4

Open
talatkuyuk opened this issue Mar 11, 2024 · 1 comment
Open

Feature: create details summary element like vitepress #4

talatkuyuk opened this issue Mar 11, 2024 · 1 comment

Comments

@talatkuyuk
Copy link

I had received a request in the past like below from @RyanYANG52:

use details summary or div dynamically, like in vitepress

I wanted to open an issue about that.

@talatkuyuk
Copy link
Author

I figure out that the remark-flexible-containers can create details-summary HTML element easily with the below options:

import remarkFlexibleContainer from "remark-flexible-containers";

use(remarkFlexibleContainer, {
  containerTagName(type) {
    return type === "details" ? "details" : "div";
  },
  containerClassName(type) {
    return type === "details" ? ["remark-details"] : ["remark-container", type ?? ""];
  },
  titleTagName(type) {
    return type === "details" ? "summary" : "div";
  },
  titleClassName(type) {
    return type === "details" ? ["remark-summary"] : ["remark-container-title"];
  },
})

If community want me to include this opinionated "details" type in to the package, would nice to receive a PR (Pull Request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant