Skip to main content

libs to run markdown as an app in a python3 environment

Project description

markdown2app

markdown2app.plainmark.com

Plainmark

Plainmark is a lightweight programming language embedded in Markdown that runs across multiple platforms including web browsers, terminal environments, desktop applications, and mobile devices.

What is Plainmark?

Plainmark allows you to write both documentation and executable code in the same Markdown file. Code blocks tagged with ```plainmark are interpreted and executed by the Plainmark runtime.

Key Features

  • Write Once, Run Anywhere: The same Plainmark code works across all supported platforms
  • Embedded in Markdown: Combine documentation and executable code in a single file
  • Platform-Specific APIs: Access platform capabilities like file system, device sensors, etc.
  • Interactive Documents: Create dynamic, interactive documentation
  • Easy to Learn: Familiar JavaScript-like syntax

Platform Implementation Guide

Browser Implementation

The browser implementation uses JavaScript to interpret and execute Plainmark code. It consists of:

  1. An HTML file that provides the editor interface
  2. A JavaScript interpreter that extracts code blocks and executes them
  3. DOM manipulation capabilities for UI rendering

Running in Browser:

  1. Open index.html in any modern browser
  2. Write your Plainmark code in the editor
  3. Click "Run" to execute

Terminal/Python Implementation

The Python implementation allows running Plainmark in any terminal environment. It consists of:

  1. A Python script (plainmark.py) that processes Markdown files
  2. A code extractor and interpreter for Plainmark code blocks
  3. Python-based API for file system access and terminal commands

Running in Terminal:

# Execute a file
python plainmark.py example.md

# Start REPL mode
python plainmark.py --repl

# Create an example file
python plainmark.py --example

Desktop Implementation (Electron)

The desktop implementation provides a native application experience using Electron. It consists of:

  1. A main process (main.js) that handles application lifecycle
  2. A renderer process (index.html) with the editor UI
  3. IPC communication for file operations
  4. Full system access through Node.js APIs

Building for Desktop:

# Install dependencies
npm install

# Run in development mode
npm start

# Build for distribution
npm run build

Mobile Implementation (Android)

The Android implementation runs Plainmark on mobile devices. It consists of:

  1. A Kotlin-based Android app
  2. A WebView for executing Plainmark code
  3. JavaScript interfaces for accessing device features (camera, sensors, etc.)
  4. Integration with the Android filesystem

Building for Android:

  1. Open the project in Android Studio
  2. Connect an Android device or start an emulator
  3. Build and run the app

Plainmark Syntax Examples

Basic Syntax

# My Plainmark Program

This is a simple program.

```plainmark
// Variables
let name = "World";
let number = 42;

// Output
print("Hello, " + name + "!");
print("The answer is: " + number);

### Platform-Specific Features

```markdown
# Cross-Platform Example

```plainmark
// Detect platform
let platform;
if (typeof window !== 'undefined' && window.Android) {
  platform = "Android";
} else if (typeof process !== 'undefined' && process.versions.electron) {
  platform = "Desktop";
} else if (typeof document !== 'undefined') {
  platform = "Browser";
} else {
  platform = "Terminal";
}

print("Running on: " + platform);

// Use platform-specific features
if (platform === "Android") {
  // Mobile-specific code
  let acceleration = JSON.parse(readSensor("accelerometer"));
  print("Device acceleration: " + acceleration.x + ", " + acceleration.y + ", " + acceleration.z);
} else if (platform === "Desktop") {
  // Desktop-specific code
  let sysInfo = getSystemInfo();
  print("CPU cores: " + sysInfo.cpus);
} else if (platform === "Browser") {
  // Browser-specific code
  document.body.innerHTML += "<div>Running in browser!</div>";
} else {
  // Terminal-specific code
  print("Current directory: " + executeCommand("pwd"));
}

## Use Cases

- **Educational tools** - Interactive learning materials and tutorials
- **Documentation** - Self-executing technical documentation
- **Prototyping** - Quick application development across platforms
- **Note-taking** - Executable notes and code snippets
- **Data analysis** - Process and visualize data in Markdown

## License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

markdown2app-0.1.3.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markdown2app-0.1.3-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file markdown2app-0.1.3.tar.gz.

File metadata

  • Download URL: markdown2app-0.1.3.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for markdown2app-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7b4d9c4f1d66543f5d44319d98541a32a88a86aa34b495b4c6c01ec204597c02
MD5 69f9a2d68819712768fce2b164fc6933
BLAKE2b-256 89ddff50fb32b9994d4b01c33acdf43b22a5838c00a75ed4b8acd169d891f52e

See more details on using hashes here.

File details

Details for the file markdown2app-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: markdown2app-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for markdown2app-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9981fd46eeb033ed46c758800b0a756ab80c230b0223165b93fd24f9a1f8c806
MD5 b8dd7db6fba412c5bcc30f20b31d52e3
BLAKE2b-256 e1219086a18800e99906b97ce08c89c26b102f58ffe26861baeda7595dfa44e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page