From 515df0bbdad3af8999afa61310046a37ef125d6a Mon Sep 17 00:00:00 2001 From: VLTHellolin Date: Fri, 7 Jun 2024 23:10:54 +0800 Subject: [PATCH 1/2] fix: Use requirements.txt instead of in-script checking --- Pipfile | 12 ++++++++++++ Pipfile.lock | 46 ++++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 1 + start.py | 10 ---------- 4 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock create mode 100644 requirements.txt diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..07f4759 --- /dev/null +++ b/Pipfile @@ -0,0 +1,12 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +django = "*" + +[dev-packages] + +[requires] +python_version = "3.11" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..511611a --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,46 @@ +{ + "_meta": { + "hash": { + "sha256": "af42abefb766e975f7680f10368735353569fb4fe0114e59496a7202658362fc" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.11" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "asgiref": { + "hashes": [ + "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47", + "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590" + ], + "markers": "python_version >= '3.8'", + "version": "==3.8.1" + }, + "django": { + "hashes": [ + "sha256:8363ac062bb4ef7c3f12d078f6fa5d154031d129a15170a1066412af49d30905", + "sha256:ff1b61005004e476e0aeea47c7f79b85864c70124030e95146315396f1e7951f" + ], + "index": "pypi", + "markers": "python_version >= '3.10'", + "version": "==5.0.6" + }, + "sqlparse": { + "hashes": [ + "sha256:714d0a4932c059d16189f58ef5411ec2287a4360f17cdd0edd2d09d4c5087c93", + "sha256:c204494cd97479d0e39f28c93d46c0b2d5959c7b9ab904762ea6c7af211c8663" + ], + "markers": "python_version >= '3.8'", + "version": "==0.5.0" + } + }, + "develop": {} +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d3e4ba5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +django diff --git a/start.py b/start.py index 7981a33..441b2c3 100644 --- a/start.py +++ b/start.py @@ -4,16 +4,6 @@ import threading import time - -def install_package(name): - spec = importlib.util.find_spec(name) - if spec is None: - subprocess.call(['pip', 'install', name, '-i', r'https://pypi.tuna.tsinghua.edu.cn/simple']) - - -install_package('django') - - def launch(): subprocess.call(['python', 'manage.py', 'runserver', '0.0.0.0:8014']) From 3f3b22c75d052c12ebc17bef9bdc6caca1a4ed35 Mon Sep 17 00:00:00 2001 From: VLTHellolin Date: Fri, 7 Jun 2024 23:15:46 +0800 Subject: [PATCH 2/2] docs: Fix typo & grammatical errors --- README.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a138ed6..4a85261 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,22 @@ A viewer and editor of markdown on local web pages. - Based on [Python3](https://www.python.org/), [Django](http://www.djangoproject.com/) and [editor.md](https://github.com/pandao/editor.md). - Support Standard Markdown; -- Support real-time preview, image upload. +- Support real-time preview, image uploading. - Support [KaTeX](https://katex.org). -Please download the Python3 -and run the ```start.py``` to start. +## Usage -NoteBook runs at `127.0.0.1:8014`. +``` shell +$ pip3 insall +$ # or pipenv install for Arch systems +$ python3 start.py +$ # or pipenv run python3 start.py +``` -The all notebooks are storaged in ```/notebooks/``` +NoteBook will run at [127.0.0.1:8014](http://127.0.0.1:8014). -and all images are storaged in ```/image/```. +The notebooks are all storaged in `/notebooks/`. -The host name cannot contain Chinese characters. \ No newline at end of file +And the images are storaged in `/image/`. + +The host name cannot contain Chinese characters.