Livecodes Playground

by @gapmiss
5
4
3
2
1
Score: 50/100

Description

Category: Coding & Technical Tools

The Livecodes Playground plugin integrates a powerful code editor within Obsidian, allowing users to create, manage, and run interactive coding playgrounds. It supports multiple programming languages and frameworks, enabling rapid prototyping and live previews of code. Users can generate new playgrounds, import existing configurations, or utilize starter templates for languages like JavaScript, Python, and HTML. The plugin also offers features such as quick playground creation, integration with CodePen, and live previews of code blocks within Obsidian. Playgrounds are saved as Markdown notes, maintaining compatibility with the Obsidian environment. The plugin provides extensive customization options for setup and configuration, catering to both beginners and advanced developers.

Reviews

No reviews yet.

Stats

25
stars
1,948
downloads
1
forks
772
days
361
days
361
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
2
total issues
1
open issues
1
closed issues
141
commits

README file from

Github

Livecodes playground

screenshot of Livecode Playground editor

Livecodes playground, an open-source client-side code editor plugin for Obsidian.md - powered by Livecodes.io.

Read about why Livecodes, it's features and how to self-host

[!IMPORTANT] The Livecodes codebase can be self-hosted but is not 100% off-line. Internet connection is required.

Installation

Community plugins

  1. Obsidian.md/plugins or
  2. Open Settings > Community Plugins > Browse
  3. Search for "livecodes"

via BRAT (Beta Reviewer's Auto-update Tool)

  1. Ensure BRAT is installed
  2. Trigger the command Obsidian42 - BRAT: Add a beta plugin for testing
  3. Enter this repository, gapmiss/livecodes-playground
  4. Enable Livecodes plugin in community plugin list

Manually

  1. download main.jsmanifest.json & styles.css from the latest release
  2. create a new folder /path/to/vault/.obsidian/plugins/livecodes-playground
  3. move all 3 files to /path/to/vault/.obsidian/plugins/livecodes-playground
  4. Settings > Community plugins > reload Installed plugins
  5. enable plugin

Usage

Initial setup

  1. create a folder inside your vault for storing playground configuration files (*.JSON)
    • default: playgrounds
  2. create a folder inside your vault for storing playground markdown notes (*.MD)
    • default: playgrounds/notes

New playground

New playgrounds can be created via:

  • New playground - (command) opens a prompt for the playground name, markup language, style language, CSS processors, and script language.

  • Quick playground - (command) and (ribbon menu) open a prompt for the playground name. The default markup, style, & script languages can be configured in the settings.

  • Open starter playground (command) opens a suggestion prompt with a list of simple starter playgrounds. These starter include _hyperscript, Alpine.js, Angular, Arrow.JS, Astro, Bootstrap 5, Bulma (CSS), C++, HTMX, Javascript, jQuery, Lemonade.JS, Lit, Lua, Lua (wasm), Markdown, MDX, modulo.js, Open-props (CSS), Perl, PHP, PHP (wasm), Preact, Python, Python (wasm), React, React Native, Reef.js, Riot.js, Ruby, SCSS, Solid.js, Stellar, Stencil.js, Svelte, Tailwind CSS, Typescript, VanJS, Vue 2, Vue 3 SFC

  • New playground from CodePen (command) opens a prompt for a CodePen URL and attempts to import the pen and create a new playground. Please note: this command is experimental and is dependent on CodePen's source code for presenting pens. If CodePen's changes their HTML code, the command could stop working

  • Open codeblocks in Livecodes (command) Live-preview and Source mode. The command parses the markdown note for codeblocks and will attempt to create a new playground with 1-3 codeblocks (markup, style, script) based on the codeblock's language. Supported languages include html, mdx, css, scss, javascript, js, jsx, typescript, ts, tsx, astro, svelte.

  • Open in Livecodes - (codeblock context menu) via right-click (ctrl+click) in supported fenced code blocks. Reading mode ONLY. Supported languages include html, mdx, css, scss, javascript, js, jsx, typescript, ts, tsx, astro, svelte.

  • Open in Livecodes - (file context menu) via right-click (ctrl+click) for supported file extensions. Supported extensions include html, mdx, css, scss, js, jsx, ts, tsx, astro, svelte.

  • Open in Livecodes - (folder context menu) via right-click (ctrl+click) for supported file extensions. Supported extensions include html, mdx, css, scss, js, jsx, ts, tsx, astro, svelte. To activate the menu, the folder must have 1-3 files with the supported extensions. e.g. (index.html, style.css, main.js)

  • Obsidian URI - Create a new playground via importing of a raw JSON configuration file, easily hosted as a Github gist. The Obsidian URI expects 2 parameters, vault and gistUrl formatted as obsidian://playground?vault=VAULTNAME&gistUrl=RAW_JSON_URL The gistUrl needs to be URI encoded (see: Obsidian Help)

    e.g. obsidian://playground?vault=Playground&gistUrl=https%3A%2F%2Fgist.githubusercontent.com%2Fgapmiss%2Ff558657bcde37c677724004c36ed8dcd%2Fraw%2Ff8a7173bbd17d0886534c2f2017385a5fb3cff48%2FJavascript_starter.json

Open playground

Playgrounds can be opened via:

  • Open playground - (command) and (ribbon menu) opens a playground fuzzy search prompt.

  • Open playground - (context menu) via right-click (ctrl+click) for playground config files (*.JSON).

  • Obsidian URI - Create a new playground via importing of a raw JSON configuration file, easily hosted as a Github gist. The Obsidian URI expects 2 parameters, vault and playgroundPath formatted as obsidian://playground?vault=VAULTNAME&playgroundPath=VAULT_PATH_TO_JSON The playgroundPath needs to be URI encoded (see: Obsidian Help)

    e.g. obsidian://playground?vault=VAULTNAME&playgroundPath=path/to/playground.json

[!IMPORTANT] The above context menu options are only available when all file extensions are detected by Obsidian. Open Settings > File and links and enable Detect all file extensions screenshot of settings

Issues and bug reports

Please submit issues, bug reports, feature requests, etc. to gapmiss/livecodes-playground/issues

Development

  1. cd /path/to/vault/.obsidian/plugins
  2. git clone https://github.com/gapmiss/livecodes-playground.git
  3. cd livecodes-playground
  4. npm install
  5. npm run dev

Contributing

Contributions are welcome! Please open an issue for discussion before submitting a pull request with your changes.

Livecodes

This plugin is powered by the Livecodes SDK. The Livecodes SDK is licensed under the MIT License.

MIT License

Copyright (c) 2021-PRESENT Hatem Hosny

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Word Splitting for Simplified Chinese in Edit Mode and Vim Mode
5 years ago by AidenLx
A patch for Obsidian's built-in CodeMirror Editor to support Simplified Chinese word splitting Obsidian内置编辑器的(简体)中文分词支持
Code Editor Shortcuts
5 years ago by Tim Hor
Obsidian plugin to add keyboard shortcuts commonly found in code editors such as Visual Studio Code (vscode) or Sublime Text
Open vault in VS Code
5 years ago by NomarCub
Open vault in VSCode button for Obsidian.md
Pieces for Developers
3 years ago by Pieces For Developers
Pieces' powerful extension for Obsidian-MD that allows users to access their code snippets directly within the Obsidian workspace
React Components
5 years ago by Elias Sundqvist
Write and use React (Jsx) components in your Obsidian notes.
HTML Tags Autocomplete
5 years ago by bicarlsen
Autocomplete HTML formatting tags.
JupyMD
a year ago by Deniz Terzioglu
JupyMD: Use Obsidian as a Jupyter notebook IDE
Ace Code Editor
a year ago by RavenHogWarts
An enhanced code editor using Ace editor
Orgmode (CM6)
2 years ago by Benoit Bazard
Orgmode plugin for Obsidian
Snippets
5 years ago by Pelao
Console Markdown Plugin
3 years ago by Daniel Ellermann
An Obsidian plugin which renders console commands and their output.
Stack Overflow Answers
4 years ago by bramses
Fetch Stack Oveflow answers and copy paste them directly into Obsidian
Custom Theme Studio
7 months ago by @gapmiss
An Obsidian.md plugin to create and tweak custom themes with live CSS editing, element styling, and instant previews. All without leaving Obsidian.
Cursor Bridge
2 years ago by Adam Cloud
Seamlessly bridge Obsidian and Cursor, the AI-powered code editor. Elevate your coding workflow by opening notes directly in Cursor, bringing the power of AI to your knowledge base.
Edit mode switch
2 years ago by Mara-Li
Add a button in file header to switch between LP & Source while editing
Dynamic Text Concealer
2 years ago by Matt Cole Anderson
Obsidian.md Plugin to conceal or replace user configured text patterns in Live Preview and Read Mode.
YAML Table
a year ago by dainakai
Mode manager
a year ago by dk949
Better management of reading/editing modes in obsidian
Adapt to Current View
7 months ago by greetclammy
Obsidian plugin to set different accent colors for Reading view, Live Preview and Source view.
Auto Close Tags
9 months ago by k0src
Obsidian MD plugin to auto-close HTML tags.
Better Link Clicker
4 months ago by Eniverz
An Obsidian plugin that modifies the default link click event.
GLSL Viewer
3 months ago by iY0Yi
Preview GLSL shaders on Obsidian.
Negative Heading
2 months ago by Ashan Devine
Render Discord-style "-#" lines as compact headings in reading view and the editor.