code-hike / codehike

Marvellous code walkthroughs
https://codehike.org
MIT License
4.39k stars 135 forks source link

Change code height with `rows` #262

Closed pomber closed 1 year ago

pomber commented 1 year ago

Fix #258

Forcing 4 lines of height:

<CH.Code rows={4}>

```js
console.log(1)
console.log(2)
console.log(3)
console.log(4)
console.log(5)
console.log(6)
console.log(7)

</CH.Code>


Forcing the height to match the focused code:

````md
<CH.Code rows="focus">

```js focus=3:4,6
console.log(1)
console.log(2)
console.log(3)
console.log(4)
console.log(5)
console.log(6)
console.log(7)

</CH.Code>


<!-- GITHUB_RELEASE PR BODY: canary-version -->
<details>
  <summary>📦 Published PR as canary version: <code>0.7.3--canary.262.fb2e24d.0</code></summary>
  <br />

  :sparkles: Test out this PR locally via:

  ```bash
  npm install @code-hike/mdx@0.7.3--canary.262.fb2e24d.0
  # or 
  yarn add @code-hike/mdx@0.7.3--canary.262.fb2e24d.0

Version

Published prerelease version: v0.7.3-next.5

Changelog #### 🐛 Bug Fix - `@code-hike/mdx` - Change code height with `rows` [#262](https://github.com/code-hike/codehike/pull/262) ([@pomber](https://github.com/pomber)) - Change plugin type [#256](https://github.com/code-hike/codehike/pull/256) ([@pomber](https://github.com/pomber)) - feat(#217): CH.Slideshow autoPlay and autoPlayLoop [#250](https://github.com/code-hike/codehike/pull/250) ([@brianespinosa](https://github.com/brianespinosa) [@pomber](https://github.com/pomber)) - Add lang attribute [#253](https://github.com/code-hike/codehike/pull/253) ([@pomber](https://github.com/pomber)) - feat(#246): Add onChange and initialSlideIndex props to CH.Slideshow [#248](https://github.com/code-hike/codehike/pull/248) ([@brianespinosa](https://github.com/brianespinosa)) - Fix typescript module resolution [#249](https://github.com/code-hike/codehike/pull/249) ([@pomber](https://github.com/pomber)) - feat(244): Allow Slideshow controls to autoFocus [#245](https://github.com/code-hike/codehike/pull/245) ([@brianespinosa](https://github.com/brianespinosa) [@pomber](https://github.com/pomber)) #### ⚠️ Pushed to `next` - Docusaurus v2 ([@pomber](https://github.com/pomber)) - Delete test.yml ([@pomber](https://github.com/pomber)) - Update bundle_analysis.yml ([@pomber](https://github.com/pomber)) - Create test.yml ([@pomber](https://github.com/pomber)) #### Authors: 2 - Brian Espinosa ([@brianespinosa](https://github.com/brianespinosa)) - Rodrigo Pombo ([@pomber](https://github.com/pomber))
vercel[bot] commented 1 year ago

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

Name Status Preview Updated
chtest ✅ Ready (Inspect) Visit Preview Aug 8, 2022 at 9:47AM (UTC)
playground ✅ Ready (Inspect) Visit Preview Aug 8, 2022 at 9:47AM (UTC)
github-actions[bot] commented 1 year ago

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

Three Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/just-code 33.65 KB 105.47 KB 30.13% (🟡 +0.04%)
/scrollycoding-preview 36.9 KB 108.72 KB 31.06% (🟡 +0.04%)
/spotlight 34.26 KB 106.08 KB 30.31% (🟡 +0.03%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

github-actions[bot] commented 1 year ago

:rocket: PR was released in v0.7.3 :rocket: