{"id":30310392,"url":"https://github.com/coatless-rpkg/livelink","last_synced_at":"2026-02-11T15:32:15.457Z","repository":{"id":305035863,"uuid":"1021118762","full_name":"coatless-rpkg/livelink","owner":"coatless-rpkg","description":"Local code to WASM REPL Links","archived":false,"fork":false,"pushed_at":"2025-07-17T20:28:56.000Z","size":1,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-17T23:59:13.706Z","etag":null,"topics":["repl","rstats","webassembly","webr"],"latest_commit_sha":null,"homepage":"http://r-pkg.thecoatlessprofessor.com/livelink/","language":null,"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/coatless-rpkg.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},"funding":{"github":["coatless"],"patreon":"coatless","buy_me_a_coffee":"coatless","thanks_dev":"u/gh/coatless","custom":null}},"created_at":"2025-07-16T23:15:26.000Z","updated_at":"2025-07-17T20:28:59.000Z","dependencies_parsed_at":"2025-07-18T02:10:37.897Z","dependency_job_id":"52e3187f-3525-4280-b03d-9f96f5532838","html_url":"https://github.com/coatless-rpkg/livelink","commit_stats":null,"previous_names":["coatless-rpkg/livelink"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/coatless-rpkg/livelink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Flivelink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Flivelink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Flivelink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Flivelink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coatless-rpkg","download_url":"https://codeload.github.com/coatless-rpkg/livelink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Flivelink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29336868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T14:34:07.188Z","status":"ssl_error","status_checked_at":"2026-02-11T14:34:06.809Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["repl","rstats","webassembly","webr"],"created_at":"2025-08-17T14:54:39.700Z","updated_at":"2026-02-11T15:32:15.443Z","avatar_url":"https://github.com/coatless-rpkg.png","language":null,"funding_links":["https://github.com/sponsors/coatless","https://patreon.com/coatless","https://buymeacoffee.com/coatless","https://thanks.dev/u/gh/coatless"],"categories":[],"sub_categories":[],"readme":"\n\n\u003c!-- README.md is generated from README.Qmd. Please edit that file --\u003e\n\n# livelink \u003cimg src=\"man/figures/livelink-animated-logo.svg\" align=\"right\" width=\"139\" /\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![R-CMD-check](https://github.com/coatless-rpkg/livelink/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/coatless-rpkg/livelink/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nCreate shareable links for R code in WebAssembly (WASM) REPL\nenvironments like webR and for R and Python Shiny applications using\nShinylive.\n\n## Installation\n\nYou can install the development version of `livelink` from GitHub with:\n\n``` r\n# Install development version from GitHub\n# install.packages(\"remotes\")\nremotes::install_github(\"coatless-rpkg/livelink\")\n```\n\n### Requirements\n\n- R ≥ 4.0.0\n- Internet connection (links run in browser)\n- Modern web browser with WebAssembly support\n\n## Quick Start\n\nWe’ll cover how to create links and decode them for R code, R Shiny\napplications, and Python Shiny applications using `livelink`.\n\n### WebR Links\n\nShare R code that runs in the browser:\n\n``` r\nlibrary(livelink)\n\n# Some R code to share\ncode \u003c- \"1 + 1\"\n\n# Create shareable link that runs in webR\nlink \u003c- webr_repl_link(code)\nprint(link)\n#\u003e \n#\u003e ── WebR Link ──\n#\u003e \n#\u003e \u003chttps://webr.r-wasm.org/latest/#code=eJyLrlbKS8xNVbJSKk4uyiwo0QtS0lEqSCzJAIroZ%2BTnpuqXpybFlxanFukjKShJrSgBKjBU0FYwVKqNBQAccxXr\u0026jz\u003e\n#\u003e \n#\u003e File: 'script.R' → '/home/web_user/script.R'\n#\u003e Version: \"latest\"\n#\u003e Autorun: FALSE\n```\n\n### Shinylive Apps\n\nCreate shareable Shiny applications:\n\n``` r\n# Simple Shiny app\napp_code \u003c- '\nlibrary(shiny)\n\nui \u003c- fluidPage(\n  titlePanel(\"Hello Shinylive!\"),\n  sidebarLayout(\n    sidebarPanel(\n      sliderInput(\"n\", \"Number of points:\", 10, 100, 50)\n    ),\n    mainPanel(\n      plotOutput(\"plot\")\n    )\n  )\n)\n\nserver \u003c- function(input, output) {\n  output$plot \u003c- renderPlot({\n    plot(rnorm(input$n), main = paste(\"Random points:\", input$n))\n  })\n}\n\nshinyApp(ui = ui, server = server)\n'\n\n# Create app link\napp_link \u003c- shinylive_r_link(app_code, mode = \"app\")\nprint(app_link)\n#\u003e \n#\u003e ── Shinylive R App ──\n#\u003e \n#\u003e \u003chttps://shinylive.io/r/app/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAHQgBsBLAIwCcoWBPACgGcALBhA4BKWrQCuDAAQAeALRSAZnUkATAApQA5nC60pU0g1J04miHDp6wACUt0iUgMoChjAG5wAhNTDDc+lI8DKpwTOwAMlAcROKkehAGBsGh4SzmlglJSTyMoSwAkhCocdYQvrhSvgBy4jBMcCxSRIpSqESCpDyIFVIAjAAMlYNDUgCsA6KJSf6BBjBQghlWc0moDqQA8nEl8b7rRKS+U9knUlNTtDyNnk3ySuIQBEYkXIK7lbGku8JSIIFfXYAEgOpFkChYFHy6g2XH+0wMoK4LAgRBYMDexTiQIg-ikC0EUgAvG0oDxyNYsFAIKoiDA2h0yN1eu9sbizgBfKYcsQQfiCDgAQXQXEkxKkkkq1xYt3F0tuUzwYFIHFQCGQ5AAHqQwByALpAA\u003e\n#\u003e \n#\u003e Files (1):\n#\u003e 'app.R'\n#\u003e \n#\u003e Engine: \"R\"\n#\u003e Mode: \"app\"\n```\n\n## Multi-file Projects\n\nShare complex projects with multiple files:\n\n``` r\n# Create a project with multiple files\nfiles \u003c- list(\n\"analysis.R\" = \"\nsource('utils.R')\ndata \u003c- load_mtcars()\nsummary(data)\ncreate_plot(data)\n\",\n\"utils.R\" = \"\nload_mtcars \u003c- function() {\n  mtcars\n}\n\ncreate_plot \u003c- function(data) {\n  plot(data$mpg, data$wt, \n       main = 'MPG vs Weight',\n       xlab = 'MPG', ylab = 'Weight')\n}\n\",\n\"README.md\" = \"# Car Analysis\\nAnalysis of the mtcars dataset.\"\n)\n\n# Create project with autorun\nproject \u003c- webr_repl_project(files, autorun_files = \"analysis.R\")\nprint(project)\n#\u003e \n#\u003e ── WebR Project ──\n#\u003e \n#\u003e \u003chttps://webr.r-wasm.org/latest/#code=eJx1kcFqAjEQhl9lmBZ2F9L1vrQHaaUnoXjpoSkyrtFd2EwkmVRFfPfiGlc9mNMk30%2Fy%2FeTngEzWYIXE1O1DG8oZKtyQNFjhqHHWjLZmMY%2FB%2BNFdRMxOsELNwUVfmzyL0nahnGWF5iUJwesLdI6Wcys1%2BZAXmkO0lvw%2BP%2BFCc%2B0NiZlvOieXI1RIUZyPjJX4aI5q8EvXP5S78sHs5vmTzSpyLa3jvICDZoAz0XzUfCdzl%2B3FzvlB9Nlu1gr6aSsKTqxfllqGN8imX5%2FwF%2BDbtOtGMjXwXUeLxDMF%2B7RLsaIXwZvGs8n4Yzop7fJh59tEav0E7%2BRhnH5K82UCtwJpTCrdywcjJR5%2F%2FwHli6tX\u0026jz\u003e\n#\u003e \n#\u003e Files (3):\n#\u003e 'analysis.R' → '/home/web_user/analysis.R' (autorun)\n#\u003e 'utils.R' → '/home/web_user/utils.R'\n#\u003e 'README.md' → '/home/web_user/README.md'\n#\u003e Version: \"latest\"\n```\n\n## Educational Content\n\nCreate exercise and solution pairs:\n\n``` r\nexercise \u003c- \"\n# Exercise: Calculate summary statistics\n# TODO: Calculate the mean and median of mtcars$mpg\nmean_mpg \u003c- # YOUR CODE HERE\nmedian_mpg \u003c- # YOUR CODE HERE\n\ncat('Mean MPG:', mean_mpg, '\\\\n')\ncat('Median MPG:', median_mpg, '\\\\n')\n\"\n\nsolution \u003c- \"\n# Solution: Calculate summary statistics\nmean_mpg \u003c- mean(mtcars$mpg)\nmedian_mpg \u003c- median(mtcars$mpg)\n\ncat('Mean MPG:', mean_mpg, '\\\\n')\ncat('Median MPG:', median_mpg, '\\\\n')\n\"\n\nexercise_links \u003c- webr_repl_exercise(exercise, solution, \"mpg_stats\")\n\n# Share exercise with students\nstudent_link \u003c- repl_urls(exercise_links$exercise)\n\n# Keep solution for instructor\nsolution_link \u003c- repl_urls(exercise_links$solution)\n```\n\n## Batch Processing\n\nProcess entire directories:\n\n``` r\n# Process all R files in a directory\nlinks \u003c- webr_repl_directory(\"./examples/\", \n                            autorun = TRUE,\n                            mode = c(\"editor\", \"plot\"))\n\n# Process Shiny app directories\nshiny_links \u003c- shinylive_directory(\"./shiny_apps/\", \n                                  engine = \"r\", \n                                  mode = \"app\")\n```\n\n## Link Preview and Decoding\n\nPreview WebR links without decoding and saving files locally with:\n\n``` r\n# Preview a link without downloading\nexisting_url \u003c- \"https://webr.r-wasm.org/latest/#code=eJyb2LwkLzE3dUVxclFmQYle0JKCxJKM7foZ%2Bbmp%2BuWpSfGlxalF%2BnDJlMSSxCNcBTn5JRqGVoYGmgBEFxiu\"\npreview \u003c- preview_webr_link(existing_url)\nprint(preview)\n#\u003e \n#\u003e ── WebR Link Preview ──\n#\u003e \n#\u003e URL:\n#\u003e \u003chttps://webr.r-wasm.org/latest/#code=eJyb2LwkLzE3dUVxclFmQYle0JKCxJKM7foZ%2Bbmp%2BuWpSfGlxalF%2BnDJlMSSxCNcBTn5JRqGVoYGmgBEFxiu\u003e\n#\u003e \n#\u003e Files: 1\n#\u003e Total size: 10 bytes\n#\u003e Version: \"latest\"\n#\u003e Encoding: \"mz\"\n#\u003e \n#\u003e 'script.R' (10 bytes)\n#\u003e \n#\u003e Use print(preview, show_content = TRUE) to see file contents\n```\n\nDecode existing links to extract files and save them locally:\n\n``` r\n# Extract files to local directory\nresult \u003c- decode_webr_link(existing_url, output_dir = \"./extracted\")\nprint(result)\n\n# Batch decode multiple URLs\nurls \u003c- c(url1, url2, url3)\nresults \u003c- decode_webr_link(urls, output_dir = \"./all_extracted\")\n```\n\n## Python Shiny Support\n\nCreate Python Shiny applications:\n\n``` r\npy_app \u003c- '\nfrom shiny import App, render, ui\n\napp_ui = ui.page_fluid(\n    ui.h2(\"Hello from Python Shiny!\"),\n    ui.input_slider(\"n\", \"N\", 0, 100, 20),\n    ui.output_text_verbatim(\"result\"),\n)\n\ndef server(input, output, session):\n    @output\n    @render.text\n    def result():\n        return f\"n*2 is {input.n() * 2}\"\n\napp = App(app_ui, server)\n'\n\npy_link \u003c- shinylive_py_link(py_app, mode = \"app\")\nprint(py_link)\n#\u003e \n#\u003e ── Shinylive Python App ──\n#\u003e \n#\u003e \u003chttps://shinylive.io/py/app/#code=NobwRAdghgtgpmAXGKAHVA6VBPMAaMAYwHsIAXOcpMAHQgDMAnYmAAgGcALASwm1e4xUxRmVYBBdHlaNKAEziNpAV2506aVAH1VrALytVWKAHM4W+gBtVcgBR1Wjw9wycATPbAAJOJcvFWJhZWAAVsMk5SVgBlHj4AQhowAEo8BycjXlRlMi12S24FRk8IJOkkgDky1gAGaQBGGrrWNxrU9McjYhzs3IoAD1yAN0UAIygyQU9ZdmVLMiT2iGT1CAV6DkUR4qyc6W6yXul2OHZ2blJkxA7WAAED3pvb2TXFDAGFiCdWdZlTubItiuN2+sjIykYX3oSQgACo3AJ2KwQLsyBgIEDWLCWgBfJKrTT6CToWyaHTcY5bRQrCD4MBkbCoBDID5gHEAXSAA\u003e\n#\u003e \n#\u003e Files (1):\n#\u003e 'app.py'\n#\u003e \n#\u003e Engine: \"Python\"\n#\u003e Mode: \"app\"\n```\n\n## License\n\nAGPL (\\\u003e= 3)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatless-rpkg%2Flivelink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoatless-rpkg%2Flivelink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatless-rpkg%2Flivelink/lists"}