Code Monkey home page Code Monkey logo

rehype-attr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rivy-t

rehype-attr's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): update peaceiris/actions-gh-pages action to v4

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
  • peaceiris/actions-gh-pages v3
  • ncipollo/release-action v1
.github/workflows/pull_request.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • unified ~11.0.0
  • unist-util-visit ~5.0.0
  • rehype ~13.0.0
  • rehype-raw ~7.0.0
  • rehype-stringify ~10.0.0
  • remark-gfm ~4.0.0
  • remark-parse ~11.0.0
  • remark-rehype ~11.0.0
  • tsbb ^4.2.3
  • node >=16

  • Check this box to trigger a request for Renovate to run again on this repository

Parsing as className instead of class for React

First of all I'm sorry to open an issue in your GitHub repository! I really appreciate the tool you created and thank you for the work.

Main question

I was wondering if there is a way to parse markdown with this tool and give the attribute className instead of the regular class when using a comment like:

Some paragraph of my markdown file...
<!--rehype:className=regularText-->

The problem with this is that if I render things as .use(rehypeAttr, { properties: 'attr' }), this gives a translation that adds class to the resulting <p> instead of className. I'm asking this in the hope that something already exists, but if not I'd be happy to collaborate on some code for the implementation.

Another question

I was using ChatGPT to help me fix this, and it suggested a syntax similar to this:

.use(rehypeAttr, {
      p: { className: 'text-gray-700 my-10' },
      h1: { className: 'text-3xl font-bold' },
})

Is this valid? Because when I try to use it nothing happens.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.