Code Monkey home page Code Monkey logo

mudpub's Introduction

mudpub - Markdown Note Publisher

Copies and modifies markdown notes to publish to a GoHugo static site.

Add as CLI tool

  1. Create folder ~/.local/bin:
    mkdir ~/.local/bin
  2. Add mudpub file to ~/.local/bin with contents:
    #!/usr/bin/env bash
    source /home/username/path/to/mudpub/venv/bin/activate
    /usr/bin/env python3 /home/username/path/to/mudpub/mudpub.py
    
  3. Change mudpub permissions:
    chmod u+x mudpub
  4. Add ~/.local/bin to PATH in ~/.profile:
    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/.local/bin" ] ; then
        PATH="$HOME/.local/bin:$PATH"
    fi
    

Notes

  • All external links should be qualified with the protocol https:// or http://
  • Only markdown files from the specified directory will be published (no subfolders)
  • Attachments will be sourced from markdown directory, or a specified attachments sub directory
  • All attachments are published to an attachments directory in Hugo's root content folder
  • Selective publishing does not yet work for attachments
  • Written to run on POSIX systems
  • Publishes to Hugo's content folder only (at present)

Features

Selective Publication

Pages will be published only of they have valid YAML front-matter and configured with publish: yes. This results in some local links leading nowhere (i.e. the referenced page isn't published). Links to such pages are deactivated prior to publishing and look like this: old link text*

Todo

  • Remove invalid local links
  • Publish attachments
  • Output exceptions
  • Only allow alpha chars and spaces in publish names
  • Refactor to run as command line app
  • Ensure local links have .md suffix
  • Add deactivated links to parse exceptions
  • Add logging throughout
  • Handle errors cleanly
  • Refactor OO code
  • Build tests
  • Enable selective attachment publishing
  • Index publish target directory (path.walk, not listdir)
  • Ensure links to previously published sub-folder pages are not deactivated/cleansed
  • Automate git staging
  • Add formatted git diffs to Chronolog
  • Accommodate sub-folder publish targets

mudpub's People

Contributors

danpicton 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.