metalsmith / metalsmith/markdown

Provide scoped option to help with CSS styling

Open
#71 0 comments 0 reactions 0 assignees View on GitHub
pr-welcome
Dominant language
JavaScript
Stars
62
Forks
65
PR merge metrics
No merged PRs in 30d

Description

*Please thumbs up :+1: this comment if you would like to use this feature, or thumbs down :-1: if you don't think it should be added . Your feedback is valued*

---

`scoped` option wraps the `contents` in a `

${contents}
` when `true`, but defaults to `false`. `scoped` also accepts a string that will be used as the class for the wrapping div (`rich-text` by default).
This can already be accomplished by using a `@metalsmith/layouts` layout but it's a nice extra to have it as a built-in plugin option. CSS rules can be easily scoped to `.rich-text * { ... }`

Usage example:
```js
metalsmith.use(markdown({ scoped: true }))
metalsmith.use(markdown({ scoped: 'rich-text' }))

// both render a file '*Hello _world_*' as '

Hello world
'
```
Readme must be updated, test added

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the existing README and test suite for the markdown plugin. Use the supplied scoped option examples as acceptance criteria: update the README, add tests for true and string values, and confirm the rendered contents are wrapped with the expected class while the default remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.