code-hike / codehike

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

Use lighter annotations #398

Closed pomber closed 11 months ago

pomber commented 12 months ago

Support all comment syntaxes for annotations. (fix #109)


```html hello.html
<!-- mark[6:14] -->
<div>Code Hike</div>
{
  // mark[12:20]
  "name": "Code Hike"
}
-- mark[8:16]
print("Code Hike")
% mark[7:15]
disp('Code Hike')
; mark[9:17]
(print "Code Hike")

Also, support inline annotations.

````mdx
```css
body {
  margin: 12px; /* mark[11:14] */
}
<!-- GITHUB_RELEASE PR BODY: canary-version -->
<details>
  <summary>📦 Published PR as canary version: <code>0.10.0--canary.398.4667c0f.0</code></summary>
  <br />

  :sparkles: Test out this PR locally via:

  ```bash
  npm install @code-hike/mdx@0.10.0--canary.398.4667c0f.0
  # or 
  yarn add @code-hike/mdx@0.10.0--canary.398.4667c0f.0

Version

Published prerelease version: v0.10.0-next.0

Changelog #### 🚀 Enhancement - `@code-hike/mdx` - Use lighter annotations [#398](https://github.com/code-hike/codehike/pull/398) ([@pomber](https://github.com/pomber)) #### 🐛 Bug Fix - Add new release message [#383](https://github.com/code-hike/codehike/pull/383) ([@pomber](https://github.com/pomber)) - `@code-hike/mdx` - Stable dimensions [#397](https://github.com/code-hike/codehike/pull/397) ([@pomber](https://github.com/pomber)) - Add expand button to codeblocks [#396](https://github.com/code-hike/codehike/pull/396) ([@pomber](https://github.com/pomber)) - Add static toggle [#395](https://github.com/code-hike/codehike/pull/395) ([@pomber](https://github.com/pomber)) #### ⚠️ Pushed to `next` - Remove examples from workspace ([@pomber](https://github.com/pomber)) - Add backticks to release message ([@pomber](https://github.com/pomber)) #### Authors: 2 - [@dphuang2](https://github.com/dphuang2) - Rodrigo Pombo ([@pomber](https://github.com/pomber))
vercel[bot] commented 12 months ago

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

Name Status Preview Comments Updated (UTC)
chtest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2023 8:46am
playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2023 8:46am
github-actions[bot] commented 11 months ago

Released in v0.10.0-next.0 :rocket:

Thanks for using Code Hike! Become a sponsor and help us keep innovating.