An open API service indexing awesome lists of open source software.

https://github.com/roneoorg/localstackedit

Open local files in Stackedit.io
https://github.com/roneoorg/localstackedit

Last synced: 4 months ago
JSON representation

Open local files in Stackedit.io

Awesome Lists containing this project

README

          

# Local Stackedit

This script aims to bodge the limit of [StackEdit.io](https://stackedit.io/) which cannot access local files.

It opens in Brave (as an automated browser - Selenium) the file provided as first argument.

The file can be saved with ctrl + s and closed with ctrl + q (or the usual ways of closing a browser, but the stackedit state won't be saved).

For the moment, it allows only one instance running.

## Usage

`python LocalStackedit.py ""`

or (Linux only on a Python virtual env)

`StackEdit.sh `

Depends on Brave-browser (version `90.1.24.82`).

For future or ulterior versions of Brave, the proper driver can be downloaded on [Chrome's official website](https://chromedriver.storage.googleapis.com/index.html) and placed in the folder `Webdrivers`.

It _should_ work without too many modifications for chromium-based navigators:
- change `src/Browser.initialize` line 83 for the correct browser (`which` check)
- change the ugly hard-coded `windowName` in `LocalStackedit` line 40 by what the windows manager displays
- maybe something else

For Firefox: good luck, have fun.

## Platforms

Tested on Linux, depends on a x-server running (your distro has a windows manager).

Not tested on MacOS, but should work (?).
Edit `src/Browser.initialize` first to allow running on other platform than Linux, download the proper driver for MacOS and place it in the `Webdrivers` folder, and set the `WEBDRIVER` variable.

Not working on Windows due to the usage of a X11 library for `src/WindowManager`

## Installation

**Python**

Python version 3.6 or above

```bash
python --version
```

**Clone the repository**

Git is required
```bash
git --version
```

Clone it
```bash
git clone <++>
```
**Create a virtual environment** (Optional)

`python -m venv venv`

Activate it

`source ./venv/bin/activate`

**Dependencies**

Install dependencies:

```bash
pip install -r requirements.txt
```

**Executable**

Allows execution of the entry point
```bash
chmod +x ./LocalStackedit.py
```
or for the version in a virtual environment
```bash
chmod +x ./StackEdit.sh
```

**Bash shortcut**

If you want to access it directly from the terminal (Linux and MacOsX) with the command `stackedit`:

```bash
INSTALL_DIR="TODO SET ME"
printf "# Stackedit\nalias stackedit='${INSTALL_DIR}/StackEdit.py'" >> ~/.bash_aliases
```

**Update**

```bash
git pull
```

## License and EULA

See `LICENSE`