GithubHelp home page GithubHelp logo

slimelia / gengem.py Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 23 KB

Simple Python script to generate a Gemini gemlog and accompanying Atom feed.

License: GNU General Public License v3.0

Python 100.00%

gengem.py's Introduction

gengem.py

Simple Python script to generate a Gemini gemlog and accompanying Atom feed.

Required libraries

Install with

pip install -r requirements.txt

Note: depending on your system pip may need to be replaced with pip3, python -m pip or python3 -m pip.

Usage

Initial setup

Edit gengemConfig.cfg and fill in required information:

  • rootURL - The URL where your gemlog is hosted. Only used for permalinks in the Atom feed.
  • gemlogFolder - The folder where your .txt files containing gemlog posts are stored.
  • public_gemini - The folder where your gemlog.gmi file and atom.xml file will be written to. This folder must contain a subfolder titled posts.

Only the above points are required information, but unless you want the title of your gemlog to be "My Gemlog." I highly recommend editing the other fields. The gengemConfig.cfg file is commented with usage instructions and examples.

Executing

Execute gengem.py and it will do everything else for you - all your files will be neatly placed in the directory you set as your public_gemini. File names are maintained from the .txt files (although spaces are replaced with dashes).

See it in action!

Download this entire repo and replace the contents of gengemConfig.cfg with the contents of SAMPLE_CONFIG.cfg. Execute gengem.py and.. voila! The sample posts (in the posts directory provided) have been generated into a gemlog, found within the public_gemini folder provided! A gemlog index has also been generated, along with an atom.xml! Note that this sample atom.xml is pointing to an example.com domain and the links within it do not work! This is for demonstration purposes only!

Text file format

The first line of your .txt files require:

  • A title, denoted by a +title tag
  • A date in ISO 8601 format, denoted by a +date tag

Note that the title and date tags can go in any order, so long as they are on the first line of your .txt file.

An example .txt file:

+title My first gemlog! +date 2023-04-21
Hi everyone! This is my first gemlog.
Hope you enjoy!

gengem.py's People

Contributors

slimelia avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.