Support technical writing on HubSpot using Markdown.
Project description
Technical Writing on HubSpot
» Changelog | PyPI | Issues | Source code | License
About
- Support writing technical documentation on HubSpot.
- Markdown to HTML converter with a few bells and whistles relevant for creating HubSpot blog posts.
- Upload blog posts and files to the HubSpot API, using the hubspot-api-python package.
- See community request about »Markdown Support for Technical Bloggers«.
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/crate-workbench/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/crate-workbench/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/crate-workbench/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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hubspot-tech-writing-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18d6ab59c01d5dd706a5e3a758cbeb8283ca414b86742fb1864159d40d463c7c |
|
MD5 | 88541e11536f20e19a1e7c1d8f0770bc |
|
BLAKE2b-256 | c8ee3799c8fe3fa88c38f0131e895cf7295fe2b6afd8c7382bc45681d77d0828 |
Hashes for hubspot_tech_writing-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e411022116ad34d4d22d3a9f2d3d9896943063fcfbd9a2c3cbbad343559e3f70 |
|
MD5 | bb52d031180b312966d646e5e51e5d4f |
|
BLAKE2b-256 | f12a529ac993a49273a2f7b322e7d2040444dfb1935a1cc3a5678fb4c817970d |