PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.2
Code Block Pro – Beautiful Syntax Highlighting v1.27.2
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / samples / astro.sample

astro.sample in Code Block Pro – Beautiful Syntax Highlighting 1.27.2, at build/shiki/samples/astro.sample

29 lines 916 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 ---
2 // Your component script here!
3 import Banner from '../components/Banner.astro';
4 import ReactPokemonComponent from '../components/ReactPokemonComponent.jsx';
5 const myFavoritePokemon = [/* ... */];
6 const { title } = Astro.props;
7 ---
8 <!-- HTML comments supported! -->
9 {/* JS comment syntax is also valid! */}
10
11 <Banner />
12 <h1>Hello, world!</h1>
13
14 <!-- Use props and other variables from the component script: -->
15 <p>{title}</p>
16
17 <!-- Include other UI framework components with a `client:` directive to hydrate: -->
18 <ReactPokemonComponent client:visible />
19
20 <!-- Mix HTML with JavaScript expressions, similar to JSX: -->
21 <ul>
22 {myFavoritePokemon.map((data) => <li>{data.name}</li>)}
23 </ul>
24
25 <!-- Use a template directive to build class names from multiple strings or even objects! -->
26 <p class:list={["add", "dynamic", {classNames: true}]} />
27
28 <!-- From https://docs.astro.build/en/core-concepts/astro-components/ -->
29