File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -109,15 +109,24 @@ cargo add codesnap
109109Use ` CodeSnap ` builder to generate code snapshot:
110110
111111``` rust
112- CodeSnap :: default ()
113- . code (" fn main() { println!(\ " Hello, world!\ " ); }" )
114- . watermark (WatermarkBuilder :: default (). content (" CodeSnap" ). build ()? )
115- . build ()?
116- . create_snapshot ()? . raw_data ()? . copy ()? ;
112+ let code_content = Content :: Code (
113+ CodeBuilder :: default ()
114+ . content (r # " print "Hello, World!"" # )
115+ . language (" python" )
116+ . build ()? ,
117+ );
118+
119+ let snapshot = CodeSnap :: default ()
120+ . content (code_content )
121+ . build ()?
122+ . create_snapshot ()? ;
123+
124+ // Copy the snapshot data to the clipboard
125+ snapshot . raw_data ()? . copy ()
117126```
118127
119128## 🌰 Examples
120- All examples can be found in [ examples] ( https://github.com/mistricky/CodeSnap/tree/main/examples ) .
129+ All examples can be found in [ examples] ( https://github.com/mistricky/CodeSnap/tree/main/cli/ examples ) .
121130
122131![ hello] ( https://github.com/user-attachments/assets/99df51ff-0957-40bd-91d0-facbd46a0bec )
123132
You can’t perform that action at this time.
0 commit comments