pb

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2021 License: MIT

README

pb: Write once, publish anywhere

pb is a command-line tool designed to facilitate a multi-platform, scientific publishing workflow.

It allows you to write your posts locally using scientific-styled Markdown (tables, code blocks, footnotes, and math formulas) and publish to external hosts[^1] while maintaining the structure of the original post.

Installation

If you have the Go toolchain installed, then you can use go get:

go get github.com/jdkato/pb

Otherwise, download one of the pre-built binaries.

Configuration

Medium

Uploading content to Medium requires an Integration token. To generate one, go to your settings page, select "Integration tokens" from the sidebar, and create one:

Select 'Integrations tokens' from the sidebar. Create an Integration token; the description can be anything you want.

Then, enter the pb configure command, follow the instructions, and enter your token. For math formulas on Medium, you also need to have Inkscape installed and available on your $PATH.

Usage

pb - A multi-platform publishing workflow.

Usage:	pb [options] [command] [arguments...]
	pb --to medium file.md
	pb configure

pb is a tool for cross-posting Markdown content while preserving structural
elements (math typesetting, syntax highlighting, diagrams, etc.) across
multiple platforms.

Flags:

 -h, --help       Print this help message.
 -d, --image-dir  Search directory for local images.
 -t, --to         Comma-delimited list of destination platforms.
 -v, --version    Print the current version.

Commands:

 configure        Run an interactive configuration wizard.

The basic command is

pb -d <image path> <markdown file>

Where <image path> is the directory where your local images are stored. For example, if you have an image definition like

![A demo of uploading content to Medium](/img/medium-upload.gif)

and the file is stored at /some/path/static/img/medium-upload.gif, then you'd use:

pb -d /some/path/static <markdown file>

[^1]: Currently, only Medium is supported. Other hosts, like DEV and Hashnode, will be added in a future release.

Directories

Path Synopsis
cmd
pb
internal
cli
ext
BSD 3-Clause License Copyright (c) 2019, Michael McLoughlin All rights reserved.
BSD 3-Clause License Copyright (c) 2019, Michael McLoughlin All rights reserved.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL