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

Fix: code blocks in mdx + issues/868 #1422

Merged

Conversation

muditjuneja
Copy link
Contributor

@muditjuneja muditjuneja commented Feb 20, 2024

This PR fixes the following -

  • Show more button in Code blocks
  • Added a prop to enable/disable Show more button in Code blocls
  • Added text wrap to avoid horizontal scroll
  • Added a new package that is traversing hast and adding a new property named metaData which is being passed as a prop

Should close - #868

Copy link

vercel bot commented Feb 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gatsby-theme-carbon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 2, 2024 10:36pm

@muditjuneja
Copy link
Contributor Author

Hi @eng618 can you review this PR?

Copy link

netlify bot commented Feb 20, 2024

Deploy Preview for gatsby-theme-carbon ready!

Name Link
🔨 Latest commit 9ce6a1e
🔍 Latest deploy log https://app.netlify.com/sites/gatsby-theme-carbon/deploys/65e3a93a0e4b5e0009a7cc93
😎 Deploy Preview https://deploy-preview-1422--gatsby-theme-carbon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@eng618 eng618 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look really good, the only thing I would like to see is the examples updated to reflect this change. Especially adding an example for the Show More prop. This would be in the packages/example/src/pages/components/code-blocks.mdx file.

@eng618
Copy link
Collaborator

eng618 commented Feb 21, 2024

Also take a look at https://gatsby.carbondesignsystem.com/components/code-blocks this is the behavior we should see. Seems like instead of have horizontal scrolling we are automatically wrapping the lines.

Then for the folding one we should have the example of non folding and folding vertically.

@eng618
Copy link
Collaborator

eng618 commented Mar 3, 2024

Lets add some padding to the show more button so it doesn’t overlap the content.

image

Copy link
Collaborator

@eng618 eng618 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving now, but would be good to add the padding to the show more button before we merge this in.

@muditjuneja
Copy link
Contributor Author

Lets add some padding to the show more button so it doesn’t overlap the content.

image

I will do that in another follow up PR. Merging this one now.

@muditjuneja
Copy link
Contributor Author

Lets add some padding to the show more button so it doesn’t overlap the content.
image

I will do that in another follow up PR. Merging this one now.

I guess I can't merge. I will make that small change.

@eng618 eng618 merged commit 7aa23ec into carbon-design-system:next Mar 3, 2024
6 of 7 checks passed
@alisonjoseph alisonjoseph mentioned this pull request Mar 8, 2024
3 tasks
eng618 added a commit that referenced this pull request May 23, 2024
* feat(deps): update node to 18 (#1278)

* build(deps): update node to 18

Also update all other dependencies

- update all minor dependencies

#1277

* chore: bump everything to node 18

* chore: update gatsby-plugin-sass

* chore: update readme with status badge

* docs: typo correction

* docs: update structure

* ci: update .github/workflows/manual-release.yml

Co-authored-by: Scott Strubberg <sstrubberg@protonmail.com>

* ci: update commitlint version and docs

Co-authored-by: Scott Strubberg <sstrubberg@protonmail.com>

* chore: release 4.0.0-next.0

* chore: release 4.0.0-next.1

* build: bump deps

* chore: release 4.0.0-next.2

* build: update node version

* build: update deps

* build: gatsby v5

* fix: run gatsby codemods

npx gatsby-codemods@latest sort-and-aggr-graphql .

* build: define trailingSlash

* build: bump dependencies

* refactor: apply formatting

* refactor(eslint): comment out unused imorts

* refactor: apply formatting

* start update mdx

* build(deps): bump minor and below versions

* build: update lerna

* formatting...

* feat: update release-it

* feat: update @commitlint

* ci: add github actions updater

* build: move some deps down to devDependencies

* build: update all things

* formatting...

* build: dep updates

* fix: remove extraLayouts

This is not longer supported as you can define your own layouts as components,
following this guide: https://www.gatsbyjs.com/docs/how-to/routing/layout-components/

* build: bump dependencies

* chore: update sass resources loader to compatible version

* build: bump deps

* docs: start migration doc

* chore: rebuild yarn lock

* build(deps): update minor and below

* build(deps): update minor and below

* feat(layouts): start converting to use layouts

* build: rebuild lock file

* build: cleanup unknown property

* build(deps): update minor and below

* build(deps): bump minor and below

* fix(path): update layout path

* linter fixes

* chore: update changelog settings

* build(deps): bump minor and below

And other minor adjustments.

* chore: add recommended plugins

* fix(scss): import + other minor fixes (#1410)

* Fixing scss import + other minor fixes

* Fixing useMetadata in Default Layout

* lint fixing

* bring back defaultProps

* Fixing inline code blocks

* Minor info comment

* More suggested changes

* remove white space

* testing vercel again

* Fixing yarn

* fixing yarn

* chore(deps): bump minor and below

* fix(format): run prettier

* fix(lint): update wesbos

* fix: linting,imports in code (#1414)

* build(deps): update release-it workspaces

* docs: update code block

* chore: release 4.0.0-next.4 [skip ci],

* chore: update lock file

* Fix : mdx tables  + port to esm v2 (#1418)

* fix: mdx tables + port gatsby core to ESM

* chore: bring back js files via using type

* updating the order of remarkGfm

Co-authored-by: Eric Garcia <engarcia618@gmail.com>

* fix: updatng remarkGfm order

Co-authored-by: Eric Garcia <engarcia618@gmail.com>

* chore: add a space

* fix: mdx-tables

---------

Co-authored-by: Eric Garcia <engarcia618@gmail.com>

* fix(yarn): revert lock file changes

* fix: v5 issues (#1431)

* fix: image spacing

* fix: blockquote styles

* fix: prop table display

* fix: image gallery display

* fix: markdown link with title

* docs: update migration guide

* build: maintian dependencies

* build: rebuild lock file

* Fix: code blocks in mdx + issues/868 (#1422)

* fix: heading spacing

* build: bump yarn

* fix: nested list styling for v5 (#1438)

Co-authored-by: Eric Garcia <eng618@garciaericn.com>

* style: apply formatting

* chore: release 4.0.0-next.5.0 [skip ci],

* build(deps): bump minor

* fix: copy button color token (#1441)

* fix: copy button color token

* chore: remove extra file changes

* fix: regression in code blocks - default prop (#1442)

* docs: code blocks docs page (#1443)

* docs: code snippet docs page

* fix: hidecode prop check

* fix formatting

* fix: release

* chore: release 4.0.0-next.7 [skip ci],

* refactor: change hideCode prop to showAll prop (#1445)

* refactor: change hideCode prop to showAll prop

* fix: yan lock file

* fix: feedback form button style

* fix: warnings (#1450)

* fix: warnings

* fix: swap back to mjs file

* fix: caption styles (#1451)

* fix formatting

* chore: release 4.0.0-next.8 [skip ci],

* feat(next): add gatsby-plugin-local-search  (#1464)

* feat(next): add gatsby-plugin-local-search remove gatsby-plugin-lunr

* feat(next): add gatsby-plugin-local-search remove gatsby-plugin-lunr

* feat: add path

* chore: remove old code

* chore: clean up code

* chore: cleanup

* feat: fix tabs

* feat: create search config file

* chore: release 4.0.0-next.9 [skip ci],

* feat: add max results to search (#1466)

* chore: release 4.0.0-next.10 [skip ci],

* build(deps): bump minor and below

* chore: release 4.0.0-next.11 [skip ci],

* build(yarn): update lock file

* docs: update migration guide

* fix(deps): add missing preset

* docs: update migration guide

* chore: cleanup

* fix: update homepage link to v4 migration

---------

Co-authored-by: Scott Strubberg <sstrubberg@protonmail.com>
Co-authored-by: Mudit Juneja <muditjuneja@outlook.com>
Co-authored-by: Alison Joseph <alisonejoseph@Gmail.com>
Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants