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

Upgrade code blocks #62

Open
11 of 12 tasks
meganesu opened this issue Jun 24, 2022 · 0 comments
Open
11 of 12 tasks

Upgrade code blocks #62

meganesu opened this issue Jun 24, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@meganesu
Copy link
Owner

meganesu commented Jun 24, 2022

I want to have a better custom code block component.

Features

  • Add file title using code block meta string (```js tile=~/zshrc/teach.sh)
  • Add line highlighting using comments
    • // highlight-line
    • // highlight-start && // highlight-end

To Do

Resources

@meganesu meganesu added the enhancement New feature or request label Jun 24, 2022
meganesu added a commit that referenced this issue Jun 24, 2022
meganesu added a commit that referenced this issue Jul 4, 2022
meganesu added a commit that referenced this issue Jun 19, 2024
- Needed to be able to access <code/> elements by role (see: testing-library/dom-testing-library#1100)
meganesu added a commit that referenced this issue Jun 19, 2024
meganesu added a commit that referenced this issue Jun 19, 2024
… the token-line class from prism-react-renderer
meganesu added a commit that referenced this issue Jun 19, 2024
- use figure/figcaption instead of div
- use only one code element (vs one per line)
meganesu added a commit that referenced this issue Jun 19, 2024
- Needed to be able to access <code/> elements by role (see: testing-library/dom-testing-library#1100)
meganesu added a commit that referenced this issue Jun 19, 2024
meganesu added a commit that referenced this issue Jun 19, 2024
… the token-line class from prism-react-renderer
meganesu added a commit that referenced this issue Jun 19, 2024
- use figure/figcaption instead of div
- use only one code element (vs one per line)
meganesu added a commit that referenced this issue Jul 4, 2024
* feat(#62): adjust code block styles to accomodate line highlighting

* chore(#62): bump versions @testing-library/* versions

- Needed to be able to access <code/> elements by role (see: testing-library/dom-testing-library#1100)

* chore(#62): major version update for prism-react-renderer

* refactor(#62): improve code readability

* feat(#62): add support for highlight-line comments

* fix(#62): lint

* feat(#62): add support for highlight-start / highlight-end comments

* feat(#62): add support for highlight-next-line comments

* refactor(#62): group initial shouldHighlightLine values

* fix(#62): move codeClassNames into getLineProps, to avoid overwriting the token-line class from prism-react-renderer

* fix(#62): update line highlight color to match Night Owl theme

* refactor(#62): clean up semantic HTML structure
- use figure/figcaption instead of div
- use only one code element (vs one per line)

* fix(#62): fix padding on pre element when no language tag or file tag

* feat(#62): update semantics for highlighted lines to use <mark>

* content(#62): refactor code blocks to use line highlights instead of comments

* fix(#62): make font size consistent on iOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant