Skip to main content

Using Pandoc with Static Site Generators

Project description

Using Pandoc with Static Site Generators

This library aims to make it easy to write posts in Pandoc's Markdown and build them to static sites with ANY Static Site Generators (SSG) you want. After specifying the directory structure (pandoc4ssg.DirStruct) of your static site (depends on the SSG you used) and options for compiling posts (pandoc4ssg.PostHandler), pandoc4ssg builds the site for you.

Hugo

Below is an example that builds markdown files located in pandoc_posts/ into a Hugo site. See pandoc4ssg-example for details.

import pandoc4ssg

dir_struct = pandoc4ssg.DirStruct(
    tgt_dir_html="content/post",
    tgt_dir_tex="public/tex",
    pandoc_post_dir="pandoc_posts",
    static_tgt=None,
    public="public"
)

post_handler = pandoc4ssg.PostHandler(
    meta_keep = ["title", "subtitle", "author", "date", "categories", "tags"],
    meta_new=[("new_field", True)],
    use_toml=False,
    output_exts=".html",
    output_dir=True,
    pandoc_html_extra_args=['--citeproc'],
    dir_struct=dir_struct
)

pandoc4ssg.build(ssg_cmd="hugo -D", post_handler=post_handler)

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

pandoc4ssg-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandoc4ssg-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pandoc4ssg-0.0.1.tar.gz.

File metadata

  • Download URL: pandoc4ssg-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for pandoc4ssg-0.0.1.tar.gz
Algorithm Hash digest
SHA256 66d27031acf844e550e36fab0c034dfbce36ae018ef229123847ca05b1e17897
MD5 96acc7c8f12c21580c616b48fafe949c
BLAKE2b-256 c3a8d03a9c843b7aada51845a0033483f045a145d4a48e55d81c7afe2fa6c843

See more details on using hashes here.

File details

Details for the file pandoc4ssg-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pandoc4ssg-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for pandoc4ssg-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c75d9b56b39dc49342e27157524bbd798d5bb46847d5e20246c2216871cebba8
MD5 f2ce47ce01db3570ccc22c0e35bdc0c3
BLAKE2b-256 e9630f5593b7942891af1f969d20e136f172610fc7dfbc6330092d24caf134e8

See more details on using hashes here.

Supported by

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