Skip to main content

Light-wait produces the bare minimum blog content from markdown files

Project description

light-wait

GitHub release (latest by date) GitHub code size in bytes License: CC0-1.0 Keybase PGP PyPI PyPI - Wheel

light-wait is a blogging platform to produce light (as in features), minimal wait (as in fast to download) web content from markdown.

Light-wait produces the bare minimum blog content from markdown files:

  • overview and per-tag (category) indexes
  • RSS feed
  • configuration file to simplify customization

Here is an example screen-shot of blog content:

GIF demo

Usage

Usage: python light-wait.py [OPTIONS]

  Generate blog content from markdown


optional arguments:
  -c COMMAND, --command COMMAND # import or generate

  -f FILE, --file FILE          # import src markdown file path
  -n NAME, --name NAME          # import short unique name
  -d DESCRIPTION, --description DESCRIPTION  # import description
  -t TAGS, --tags TAGS          # import tag (category) list

  -o OUTPUT, --output OUTPUT    # generate output directory

  -h, --help                    # show this help message and exit  

Quick Start

  1. Install with pip

    • $ pip install lightwait

Use light-wait to generate blog content from existing markdown. First, import your markdown files, providing a unique name, description and a list of tags. The name will be used in the URL of the blog post, so it needs to be URL friendly.

In this example, a markdown about signs is imported:

 $ lightwait -c import -f example/opensource.md -n opensourced -d 'How Light-wait was open-sourced' -t opensource

The generation of the static site content makes use of the imported markdown files as well as user-updatable configurations (such as URL or blog title). See the Configuration Options section below for details. You can immediately generate content using default configuration, review, then update properties as desired and repeat.

To generate the static site content from the imported markdown, use the generate command, providing the output directory:

 $ lightwait -c generate -o /usr/local/var/www/

The generated content can be directly placed into a docroot of a locally running web server like above, or staged and transferred to a remote host. The URL is configurable (see Configuration Options below). A python web server can be used to verify the content:

 $ cd /usr/local/var/www/
 $ python3 -m http.server

Configuration Options

Light-wait is designed with customization in mind. When Light-wait is first run, a directory is created under the user home directory. This is called .lightwait and it will hold configuration, CSS, templates and imported markdown and metadata:

 $ cd ~/.lightwait
 $ ls
 lightwait.ini	markdown	metadata	template	www
 $

These files will only be copied if this initial set does not exist- you can freely modify them, or if you wish to start over, remove them for Light-wait to re-initialize.

The most important user-defined configurations are held in the lightwait.ini file. This is a python INI file (see configparser), containing a default configuration section and the possibility to have multiple overriding configuration sections.

Light-wait uses the lw section and inherits all the defaults. The simplist way to configure is to update all of the default properties and not have any override properties.

An example of using an override property is to be able to test locally but deploy remotely:

[DEFAULT]
url = http://localhost:8080/

[lw]
url = http://some.domain/

Refer to the example directory for a fully configured INI.

Feel free to further customize the static content output by changing the templates (jinja2 format) or css. These can be found here:

 ~/.lightwait/template/base.index  # Common including footer
 ~/.lightwait/template/main.index  # for main index.html
 ~/.lightwait/template/tag.index   # for tag-SOMETAG.html 
 ~/.lightwait/template/post.index  # for each post
 ~/.lightwait/www/css/main.css
 $ ls
 lightwait.ini	markdown	metadata	template	www

Running local web server Example

The following is an example of running lighttpd, a fast and lightweight web server, and generating web content from markdown files, using Light-wait.

To install lighttpd on MacOS using homebrew

 $ brew update 
 $ brew install lighttpd
 $ brew services start lighttpd

This installs a default configuration file /usr/local/etc/lighttpd/lighttpd.conf and a docroot at /usr/local/var/www

Now generate content using light-wait:

 $ lightwait -c generate -o /usr/local/var/www/

Then open a browser to http://localhost:8080/

Tool Chain and Frameworks

The following frameworks and tools enable Light-wait:

Details are provided under the example markdown

How to Contribute

  1. Clone repo and create a new branch: $ git checkout https://github.com/mechregard/light-wait -b name_for_new_branch.
  2. Make changes and test
  3. Submit Pull Request with comprehensive description of changes

Donations

This is free, open-source software.

Image credit goes to: https://dauntlessfightclub.net/

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

lightwait-0.0.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

lightwait-0.0.2-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file lightwait-0.0.2.tar.gz.

File metadata

  • Download URL: lightwait-0.0.2.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.6

File hashes

Hashes for lightwait-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ff4a1f0f9545d694c6ae1b5817fc6a9b2cb942843374aceb3862e9a4126b5f63
MD5 e6726472672e20091d92048394711af5
BLAKE2b-256 a687b797d38cc11d22bb374c6e61bc2d928470cf61633b274d55201e108a1282

See more details on using hashes here.

File details

Details for the file lightwait-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: lightwait-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.6

File hashes

Hashes for lightwait-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a1e88cdd9e5fe1158be9cd2640c0efca80baa532d03a64da484762ebf8c518d
MD5 1a66a3e6fa7257b309fbc7052fb55e1b
BLAKE2b-256 4c212b1a2b1bec9c776b2e79070a4864691031d6965dc2819652b06fda9f6cd6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page