libs to run markdown as an app in a python3 environment
Project description
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);
Web
cd web
-
Użyj portu powyżej 1024 (najlepiej powyżej 8000):
python -m http.server 8080
-
Używaj poprawnej składni - port podaje się bezpośrednio jako pierwszy argument:
python -m http.server 8888
-
Jeśli port jest zajęty, możesz:
- Użyć innego portu (np. 8001, 8080, 9000)
- Zakończyć proces używający danego portu:
# Znajdź proces używający portu 8000 sudo lsof -i :8000 # albo netstat -tuln | grep 8000 # Zakończ proces (zastąp PID numerem procesu) kill PID
Spróbuj wykonać:
python -m http.server 8888
A następnie otwórz w przeglądarce adres:
http://localhost:8888
Jeśli nadal masz problemy z uruchomieniem serwera HTTP, możesz także wypróbować inne rozwiązania:
-
Użyj innego serwera HTTP, np. Node.js:
npx serve -
Użyj PHP (jeśli zainstalowane):
php -S localhost:8888
-
Sprawdź, czy masz uprawnienia do zapisu w katalogu, w którym próbujesz uruchomić serwer.
Aplikacja desktopowa
Instalacja aplikacji desktopowej (bazującej na Electron):
-
Sklonuj repozytorium:
git clone https://github.com/plain-mark/markdown2app.git cd markdown2app/desktop
-
Zainstaluj zależności:
npm install -
Uruchom aplikację:
npm start -
(Opcjonalnie) Zbuduj aplikację dla swojego systemu:
npm run build
Urządzenia mobilne (Android)
Aby zainstalować Plainmark na urządzeniu Android:
- Pobierz plik APK z repozytorium lub sklepu Google Play
- Uruchom plik APK na swoim urządzeniu
- Zaakceptuj wymagane uprawnienia (dostęp do plików, kamera, itp.)
- Aplikacja jest gotowa do użycia!
Alternatywnie, możesz zbudować aplikację z kodu źródłowego:
-
Sklonuj repozytorium:
git clone https://github.com/plain-mark/markdown2app.git
-
Otwórz folder
androidw Android Studio -
Zbuduj i uruchom aplikację na emulatorze lub fizycznym urządzeniu
Pierwsze kroki
Po zainstalowaniu Plainmark, czas na pierwszy program:
- Utwórz nowy plik tekstowy o rozszerzeniu
.md(np.pierwszy.md) - Wpisz następującą treść:
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
- Modular Documentation made possible by the FlatEdit project.
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.6.tar.gz.
File metadata
- Download URL: markdown2app-0.1.6.tar.gz
- Upload date:
- Size: 15.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 |
8ccae1426da0a38fe3657b980cefb7e33bcfb00d9f1bb32b5674783fd8977a51
|
|
| MD5 |
3d00863ee1c442cc636d50f112fc16d3
|
|
| BLAKE2b-256 |
9961392624cce3443d4026644ddc2c8a7e6beebf1a4e73d2a6449ac6745b85cb
|
File details
Details for the file markdown2app-0.1.6-py3-none-any.whl.
File metadata
- Download URL: markdown2app-0.1.6-py3-none-any.whl
- Upload date:
- Size: 11.7 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 |
2bb5f2adec343352508bd01fe96a379a06967bca87f5ed3f2c2b4a895b21d782
|
|
| MD5 |
af1552cbf43c4d35ad02fa5bf7f0d186
|
|
| BLAKE2b-256 |
53173f18c63a5b8adb1cfb3d82d4d5e180f42feaacccd425a8c3656d7b8abcd0
|