Skip to main content

StuffPages - A quick way to create simple web pages using Markdown

Project description

Introduction

I created StuffPages as a quick way to publish simple web pages on my web server. Basically, it takes Markdown files from a specified directory, turns them into CSS-styeld HTML files, and saves the output in another specified directory.

Have a look at some examples!

Installation

  1. Make sure Python 3 (>=3.6) is installed

  2. Install pipx

    python3 -m pip install --user pipx
    python3 -m pipx ensurepath
    
  3. Install StuffPages

    pipx install stuffpages
    

Usage

  1. Initialize StuffPages within the directory that contains the Markdown files:

    cd /path/to/directory/
    stuffpages init
    
  2. Adapt /path/to/directory/_stuffpages/config.py according to your settings:

    • output_dir is the name of the directory that will contain the converted HTML files
    • ignore_dirs is a list of (sub)directories (within the directory that contains the Markdown files) to not build pages from
    • defaults are the values to be used when nothing is set in the metadata of the Markdown file:
      • title is the default title for generated pages
      • description is the default description for generated pages
      • author is the default name of the author shown on generaged pages
      • authorlink is the default target the author name links to
      • style is a URL or file path for the css style to be used
      • settings is an optional list of the following settings:
        • nonav for not creating a nav section
        • noheader for not creating a header section
        • nofooter for not creating a footer section
        • selfcontained for having a _resources directory for each page
    • html_head is a list of lines that are injected in the final HTML output between <head> and </head>
    • html_nav is a list of lines that are injected in the final HTML output between <nav> and </nav>
    • html_header is a list of lines that are injected in the final HTML output between <header> and </header>
    • html_footer is a list of lines that are injected in the final HTML output between <footer> and </footer>
    • pagelisting_format is a string describing the format for each item in pages listings ([PAGE])
    • breadcrumb_format is a string describing the format for each item in breadcrumb listings ([BREADCRUMB])
    • extras is a dictionary with additional modules to be used by the Markdown Python package
    • extras-configs is a dictionary of configurations for the additional modules
  3. Build the HTML pages:

    stuffpages build
    

Listings

Each Markdown file, as well as the html_(head|nav|header|footer) in the config file can contain special listings markers:

  • [TOC] will be replaced by the table of contents
  • [PAGES] will be replaced by a list of pages sorted by title, prepending ! (i.e. [!PAGES]) will reverse sort, and appending a defaults/meta data variable name (e.g. Description) will sort by that defaults/meta data (e.g. [PAGES Description])
  • [BREADCRUMB] will be replaced by a breadcrumb trail of links from the current page to the parent page

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

StuffPages-0.7.4.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

StuffPages-0.7.4-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file StuffPages-0.7.4.tar.gz.

File metadata

  • Download URL: StuffPages-0.7.4.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.9

File hashes

Hashes for StuffPages-0.7.4.tar.gz
Algorithm Hash digest
SHA256 7fb92550516e7232fb28e394a3dea9464b1078f0968c3172276ef949c38ed068
MD5 739e3a46bf72cd16b6445758770a1a3a
BLAKE2b-256 b26c06788b58e96e1560255beec4ecdcca1a03bc192e4df5486271708c25ca5f

See more details on using hashes here.

File details

Details for the file StuffPages-0.7.4-py3-none-any.whl.

File metadata

  • Download URL: StuffPages-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.9

File hashes

Hashes for StuffPages-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 788386759d9e53bc0f5c8dbe03bf8ea799c00265014019daae0012b273ef5baf
MD5 2af1c6f6a1b1b02c6ae1a7e8060cde9c
BLAKE2b-256 35ab592f0b91ad6207baf5803de119dd7de6baccc6c1c34b6a6f70ccff1c516a

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