{"id":26870886,"url":"https://github.com/btbytes/prlink","last_synced_at":"2025-08-25T16:19:16.946Z","repository":{"id":66399868,"uuid":"42574585","full_name":"btbytes/prlink","owner":"btbytes","description":"A rust program to generate play.rust-lang.org links from .rs source files.","archived":false,"fork":false,"pushed_at":"2018-03-04T19:20:25.000Z","size":11,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T22:44:03.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/carols10cents/rustlings","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/btbytes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-09-16T08:25:09.000Z","updated_at":"2022-08-20T21:08:24.000Z","dependencies_parsed_at":"2023-02-21T02:31:00.996Z","dependency_job_id":null,"html_url":"https://github.com/btbytes/prlink","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/btbytes/prlink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Fprlink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Fprlink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Fprlink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Fprlink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btbytes","download_url":"https://codeload.github.com/btbytes/prlink/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btbytes%2Fprlink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272094050,"owners_count":24872282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-31T07:17:39.813Z","updated_at":"2025-08-25T16:19:16.938Z","avatar_url":"https://github.com/btbytes.png","language":"Rust","readme":"# PRLink\n\nRead all the Rust files in a directory and create\n[play.rust-lang.org](http://play.rust-lang.org) links in Markdown\nformat.\n\nThat is, if a directory has a file `hello.rs` with the following\ncontent:\n\n```rust\nfn main() {\n    println!(\"Hello, world!\");\n}\n```\n\nRunning `prlink` should result in :\n\n```\n- [\"hello.rs\"](http://play.rust-lang.org/?code=fn+main%28%29+%7B%0A++++println%21%28%22Hello%2C+world%21%22%29%3B%0A%7D%0A)\n```\n\nClick on the link below to see the source code of this console program\nin rust playground.\n\n\n- [\"main.rs\"](http://play.rust-lang.org/?code=%2F%2F+%23%21%5Bfeature%28plugin%29%5D%0A%2F%2F+%23%21%5Bplugin%28clippy%29%5D%0A%0A%0Aextern+crate+clap%3B%0Aextern+crate+glob%3B%0Aextern+crate+url%3B%0A%0Ause+clap%3A%3A%7BApp%2C+Arg%7D%3B%0Ause+std%3A%3Aerror%3A%3AError%3B%0Ause+std%3A%3Afs%3A%3AFile%3B%0Ause+std%3A%3Aio%3A%3Aprelude%3A%3A*%3B%0Ause+url%3A%3Aform_urlencoded%3A%3A%7Bserialize%7D%3B%0Ause+glob%3A%3Aglob%3B%0Ause+std%3A%3Apath%3A%3APathBuf%3B%0A%0A%0Afn+read_file%28path%3A+String%29+-%3E+String+%7B%0A++++let+mut+file+%3D+match+File%3A%3Aopen%28%26path%29+%7B%0A++++++++Err%28why%29+%3D%3E+panic%21%28%22couldn%27t+open+%7B%7D%3A+%7B%7D%22%2C+path%2C+Error%3A%3Adescription%28%26why%29%29%2C%0A++++++++Ok%28file%29+%3D%3E+file%2C%0A++++%7D%3B%0A++++let+mut+s+%3D+String%3A%3Anew%28%29%3B%0A++++match+file.read_to_string%28%26mut+s%29+%7B%0A++++++++Err%28why%29+%3D%3E+panic%21%28%22couldn%27t+read+%7B%7D%3A+%7B%7D%22%2C+path%2C+Error%3A%3Adescription%28%26why%29%29%2C%0A++++++++Ok%28_%29+%3D%3E+s%2C%0A++++%7D%0A%7D%0A%0A%0Afn+main%28%29+%7B%0A++++let+matches+%3D+App%3A%3Anew%28%22prlink%22%29%0A++++++++.version%28%221.0%22%29%0A++++++++.author%28%22Pradeep+Gowda+%3Cpradeep%40btbytes.com%3E%22%29%0A++++++++.about%28%22Print+Rust+playground+links%22%29%0A++++++++.arg%28Arg%3A%3Awith_name%28%22INPUT%22%29%0A+++++++++++++.help%28%22Sets+the+input+path+to+use%22%29%0A+++++++++++++.required%28true%29%0A+++++++++++++.index%281%29%29%0A++++++++.get_matches%28%29%3B%0A++++let+dirpath+%3D+matches.value_of%28%22INPUT%22%29.unwrap%28%29%3B%0A++++let+relative_path+%3D+PathBuf%3A%3Afrom%28dirpath%29%3B%0A++++let+mut+absolute_path+%3D+std%3A%3Aenv%3A%3Acurrent_dir%28%29.unwrap%28%29%3B%0A++++absolute_path.push%28relative_path%29%3B%0A++++absolute_path.push%28%22*.rs%22%29%3B%0A%0A++++for+entry+in+glob%28absolute_path.to_str%28%29.unwrap%28%29%29.unwrap%28%29+%7B%0A++++++++match+entry+%7B%0A++++++++++++Ok%28path%29+%3D%3E+%7B%0A++++++++++++++++let+data+%3D+%26%5B%28%22code%22.to_string%28%29%2C+read_file%28path.to_str%28%29.unwrap%28%29.to_string%28%29%29%29%5D%3B%0A++++++++++++++++let+s+%3D+serialize%28data%29%3B%0A++++++++++++++++let+fname+%3D+path.to_str%28%29.unwrap%28%29.to_string%28%29.split%28%27%2F%27%29.last%28%29.unwrap%28%29.to_string%28%29%3B%0A++++++++++++++++println%21%28%22-+%5B%7B%3A%3F%7D%5D%28http%3A%2F%2Fplay.rust-lang.org%2F%3F%7B%7D%29%22%2C+fname%2C+s%29%3B%0A++++++++++++%7D%2C%0A++++++++++++Err%28e%29+%3D%3E+println%21%28%22%7B%3A%3F%7D%22%2C+e%29%2C%0A++++++++%7D%0A++++%7D%0A%7D%0A)\n\n\nThe above link was generated by running:\n\n```shell\n./target/debug/prlink ./src\n```\n\n**Update 2015/9/17**: I wrote this program essentially to make it easy for [https://github.com/carols10cents/rustlings](https://github.com/carols10cents/rustlings) to create links to the Rust Playground.  And [Carol](https://github.com/carols10cents) is using it. Yay!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtbytes%2Fprlink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtbytes%2Fprlink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtbytes%2Fprlink/lists"}