Skip to main content

Support technical writing on HubSpot using Markdown.

Project description

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hubspot_tech_writing-0.1.3.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

hubspot_tech_writing-0.1.3-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file hubspot_tech_writing-0.1.3.tar.gz.

File metadata

  • Download URL: hubspot_tech_writing-0.1.3.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for hubspot_tech_writing-0.1.3.tar.gz
Algorithm Hash digest
SHA256 807168ccf341d3c882d0c0f1df6b29d5706ce242d646427a2e357209bcc1514b
MD5 0215a5ea509913e74f5f25d171b280f3
BLAKE2b-256 8aa5be82996483ed35a5a3d496f69b9bba947db0e0ddd1dea8d47884c49910c5

See more details on using hashes here.

File details

Details for the file hubspot_tech_writing-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for hubspot_tech_writing-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 50bba0d754a52ca6a4f40b386ae3f8095444c31b86cb33cbd8394379a4f3cf8a
MD5 8844d02a3aedbd6b5c5a4210c2406936
BLAKE2b-256 a85d97ffd371ec2214bb3c96c0cae3c8db9b8b88080b2e4bd7cdc730abceea22

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