add readme;clean up requirements;adjust config script

This commit is contained in:
Greg Gauthier 2025-03-07 20:48:11 +00:00
parent 404370359b
commit db27cb6e84
3 changed files with 37 additions and 2 deletions

37
README.md Normal file
View File

@ -0,0 +1,37 @@
# lunduke-bot
A simple Playwright script in python, to post content from a local directory
## Requirements
* Python~=3.12
* playwright~=1.50.0
## Usage
It's very crude right now, but basically, follow these steps and it *should* work:
1. Put a "lunduke.toml" somewhere where you can easily find it (not in the project path). The script will look in `~/.discourse/lunduke.toml` by default.
2. Populate the toml file with entries found in the [Example TOML Config](example.toml)
3. Create your markdown content in the path specified in your TOML config. Make it look like this:
```markdown
"""
Category = "No Politics"
Title = "Just another draft post"
Draft = true
"""
### This is a test
Just confirming that the draft status still works
```
The three-double-quote fence at the top is absolutely necessary. That section will get converted into a dictionary to populate the vars needed to make the post. Everything after the fence is just plain markdown, and will render on the site appropriately. Set the "Draft" flag to 'false' if you want to publish your post immediately.
4. Change the filename in the parser call on line 20 in [the main](main.py), to your markdown file (this will be automated soon)
5. It should just work, now. Your mileage may vary.

View File

@ -1,4 +1,3 @@
import os
from pathlib import Path
import tomllib

View File

@ -1,2 +1 @@
playwright~=1.50.0
tomli~=2.2.1