Skip to main content

Technical Writing on HubSpot

Tests Test coverage Python versions

License Status PyPI Downloads

» Changelog | PyPI | Issues | Source code | License

About

Setup

pip install --upgrade hubspot-tech-writing

After installation, you can verify if it was successful.

hstw --version

Usage

Markup Conversion

You can convert a Markdown file on your workstation, and write the output to an HTML file.

wget -O original.md https://github.com/tech-writing/hubspot-tech-writing/raw/main/tests/data/hubspot-blog-post-original.md
hstw convert original.md converted.html

Alternatively, convert a Markdown file at a remote location, and write the output to STDOUT.

hstw convert https://github.com/tech-writing/hubspot-tech-writing/raw/main/tests/data/hubspot-blog-post-original.md

Link Checker

In order to report about missing links to the web, or inline images, run the link checker on your Markdown documents.

hstw linkcheck original.md

Alternatively, you can also use a remote resource here.

hstw linkcheck https://github.com/tech-writing/hubspot-tech-writing/raw/main/tests/data/hubspot-blog-post-original.md

HubSpot Upload

Uploading to HubSpot is mostly an iterative process, so you will most likely need to use the program multiple times on the same resource. In order ease invocation, we recommend to define an environment variable for storing your access token to the HubSpot API.

export HUBSPOT_ACCESS_TOKEN=pat-na1-e8805e92-b7fd-5c9b-adc8-2299569f56c2

Upload HTML file from workstation. The name of the blog post will be derived from the file name.

hstw upload testdrive.html

Upload PNG image from workstation to folder path on hubfs.

hstw upload testdrive.png --folder-path=/foo/bar

Convert Markdown to HTML, upload the document under a different name, and also upload all referenced images.

hstw upload /path/to/document.md --name=a-different-name --folder-path=/blog/2023/topic

For more detailed information about this feature, please refer to the inline help:

hstw upload --help

HubSpot Delete

You can delete blog post and file entities, by their unique resource identifiers, or by name resp. path.

# Delete blog post by resource identifier.
hstw delete post --id=138458225506
# Delete file by path.
hstw delete file --path=/testdrive/foo.png

For more detailed information about this feature, please refer to the inline help:

hstw delete --help

Troubleshooting

Blog posts may not contain embedded images

If you are uploading directly from GitHub, and run such a command,

hstw upload https://github.com/acme/foo-repo/raw/main/article.md --name=testdrive

only to receive an error message like this,

{
  "correlationId": "4836e94d-e42b-47a1-afff-597d8b67ba93",
  "errorType": "BLOG_POST_CONTAINS_EMBEDDED_IMAGES",
  "message": "Blog posts may not contain embedded images. Please upload images to File Manager.",
  "status": "error"
}

you are most certainly using a "private" repository, where hstw does not have access permissions to.

Prior Art

Metadata

Release files for hubspot-tech-writing 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hubspot-tech-writing 0.1.4
File Size Uploaded
hubspot_tech_writing-0.1.4.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hubspot-tech-writing 0.1.4
File Interpreter ABI Platform
hubspot_tech_writing-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 35.1 kB

Release files / hubspot_tech_writing-0.1.4.tar.gz

Download URL hubspot_tech_writing-0.1.4.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8bac02b864dcaf7ad8849da17d8d304d921bd2cea960e5f5c044caa56a13f144
BLAKE2b-256 checksum
How to use checksums
5f3d4403ef8aea91664337d93297efddd499d4155d21ac225376b3d65d04465f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / hubspot_tech_writing-0.1.4-py3-none-any.whl

Download URL hubspot_tech_writing-0.1.4-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26f7419e2dc325b2173c31440c74c891334e879ee2aaeacb582ed19e11669035
BLAKE2b-256 checksum
How to use checksums
6f3a97ee1ecaa20e9cb84a61b87676f6a1d244f6223b0f804707ff2bdaeef49e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page