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:
- An HTML file that provides the editor interface
- A JavaScript interpreter that extracts code blocks and executes them
- DOM manipulation capabilities for UI rendering
Running in Browser:
- Open
index.htmlin any modern browser - Write your Plainmark code in the editor
- Click "Run" to execute
Terminal/Python Implementation
The Python implementation allows running Plainmark in any terminal environment. It consists of:
- A Python script (
plainmark.py) that processes Markdown files - A code extractor and interpreter for Plainmark code blocks
- 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:
- A main process (
main.js) that handles application lifecycle - A renderer process (
index.html) with the editor UI - IPC communication for file operations
- 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:
- A Kotlin-based Android app
- A WebView for executing Plainmark code
- JavaScript interfaces for accessing device features (camera, sensors, etc.)
- Integration with the Android filesystem
Building for Android:
- Open the project in Android Studio
- Connect an Android device or start an emulator
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b4d9c4f1d66543f5d44319d98541a32a88a86aa34b495b4c6c01ec204597c02
|
|
| MD5 |
69f9a2d68819712768fce2b164fc6933
|
|
| BLAKE2b-256 |
89ddff50fb32b9994d4b01c33acdf43b22a5838c00a75ed4b8acd169d891f52e
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9981fd46eeb033ed46c758800b0a756ab80c230b0223165b93fd24f9a1f8c806
|
|
| MD5 |
b8dd7db6fba412c5bcc30f20b31d52e3
|
|
| BLAKE2b-256 |
e1219086a18800e99906b97ce08c89c26b102f58ffe26861baeda7595dfa44e7
|