# Technical Writing on HubSpot
[![Tests](https://github.com/crate-workbench/hubspot-tech-writing/actions/workflows/main.yml/badge.svg)](https://github.com/crate-workbench/hubspot-tech-writing/actions/workflows/main.yml)
[![Test coverage](https://img.shields.io/codecov/c/gh/crate-workbench/hubspot-tech-writing.svg)](https://codecov.io/gh/crate-workbench/hubspot-tech-writing/)
[![Python versions](https://img.shields.io/pypi/pyversions/hubspot-tech-writing.svg)](https://pypi.org/project/hubspot-tech-writing/)
[![License](https://img.shields.io/github/license/crate-workbench/hubspot-tech-writing.svg)](https://github.com/crate-workbench/hubspot-tech-writing/blob/main/LICENSE)
[![Status](https://img.shields.io/pypi/status/hubspot-tech-writing.svg)](https://pypi.org/project/hubspot-tech-writing/)
[![PyPI](https://img.shields.io/pypi/v/hubspot-tech-writing.svg)](https://pypi.org/project/hubspot-tech-writing/)
[![Downloads](https://pepy.tech/badge/hubspot-tech-writing/month)](https://pypi.org/project/hubspot-tech-writing/)
<!-- » [Documentation] -->
» [Changelog]
| [PyPI]
| [Issues]
| [Source code]
| [License]
[Changelog]: https://github.com/crate-workbench/hubspot-tech-writing/blob/main/CHANGES.md
[Documentation]: https://hubspot-tech-writing.readthedocs.io/
[Issues]: https://github.com/crate-workbench/hubspot-tech-writing/issues
[License]: https://github.com/crate-workbench/hubspot-tech-writing/blob/main/LICENSE
[PyPI]: https://pypi.org/project/hubspot-tech-writing/
[Source code]: https://github.com/crate-workbench/hubspot-tech-writing
## 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
```shell
pip install --upgrade hubspot-tech-writing
```
After installation, you can verify if it was successful.
```shell
hstw --version
```
## Usage
### Markup Conversion
You can convert a Markdown file on your workstation, and write the output to an HTML file.
```shell
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.
```shell
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.
```shell
hstw linkcheck original.md
```
Alternatively, you can also use a remote resource here.
```shell
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.
```shell
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.
```shell
hstw upload testdrive.html
```
Upload PNG image from workstation to folder path on hubfs.
```shell
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.
```shell
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:
```shell
hstw upload --help
```
### HubSpot Delete
You can delete blog post and file entities, by their unique resource identifiers,
or by name resp. path.
```shell
# Delete blog post by resource identifier.
hstw delete post --id=138458225506
```
```shell
# Delete file by path.
hstw delete file --path=/testdrive/foo.png
```
For more detailed information about this feature, please refer to the inline help:
```shell
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,
```json
{
"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
- https://github.com/verypossible/hubmd
- https://github.com/danjamescrosby/markdown-to-hubspot-blog
[HubSpot]: https://www.hubspot.com/
[hubspot-api-python]: https://github.com/HubSpot/hubspot-api-python
[Markdown]: https://daringfireball.net/projects/markdown/
[Markdown Support for Technical Bloggers]: https://community.hubspot.com/t5/HubSpot-Ideas/Markdown-Support-for-Technical-Bloggers/idi-p/15724
Raw data
{
"_id": null,
"home_page": "",
"name": "hubspot-tech-writing",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "html,hubspot,markdown,tech-writing",
"author": "",
"author_email": "Andreas Motl <andreas.motl@crate.io>",
"download_url": "https://files.pythonhosted.org/packages/c8/ee/3799c8fe3fa88c38f0131e895cf7295fe2b6afd8c7382bc45681d77d0828/hubspot-tech-writing-0.1.0.tar.gz",
"platform": null,
"description": "# Technical Writing on HubSpot\n\n[![Tests](https://github.com/crate-workbench/hubspot-tech-writing/actions/workflows/main.yml/badge.svg)](https://github.com/crate-workbench/hubspot-tech-writing/actions/workflows/main.yml)\n[![Test coverage](https://img.shields.io/codecov/c/gh/crate-workbench/hubspot-tech-writing.svg)](https://codecov.io/gh/crate-workbench/hubspot-tech-writing/)\n[![Python versions](https://img.shields.io/pypi/pyversions/hubspot-tech-writing.svg)](https://pypi.org/project/hubspot-tech-writing/)\n\n[![License](https://img.shields.io/github/license/crate-workbench/hubspot-tech-writing.svg)](https://github.com/crate-workbench/hubspot-tech-writing/blob/main/LICENSE)\n[![Status](https://img.shields.io/pypi/status/hubspot-tech-writing.svg)](https://pypi.org/project/hubspot-tech-writing/)\n[![PyPI](https://img.shields.io/pypi/v/hubspot-tech-writing.svg)](https://pypi.org/project/hubspot-tech-writing/)\n[![Downloads](https://pepy.tech/badge/hubspot-tech-writing/month)](https://pypi.org/project/hubspot-tech-writing/)\n\n\n<!-- \u00bb [Documentation] -->\n\n\u00bb [Changelog]\n| [PyPI]\n| [Issues]\n| [Source code]\n| [License]\n\n[Changelog]: https://github.com/crate-workbench/hubspot-tech-writing/blob/main/CHANGES.md\n[Documentation]: https://hubspot-tech-writing.readthedocs.io/\n[Issues]: https://github.com/crate-workbench/hubspot-tech-writing/issues\n[License]: https://github.com/crate-workbench/hubspot-tech-writing/blob/main/LICENSE\n[PyPI]: https://pypi.org/project/hubspot-tech-writing/\n[Source code]: https://github.com/crate-workbench/hubspot-tech-writing\n\n\n## About\n\n- Support writing technical documentation on [HubSpot].\n- [Markdown] to HTML converter with a few bells and whistles relevant for creating\n HubSpot blog posts.\n- Upload blog posts and files to the HubSpot API, using the [hubspot-api-python] package.\n- See community request about \u00bb[Markdown Support for Technical Bloggers]\u00ab.\n\n\n## Setup\n\n```shell\npip install --upgrade hubspot-tech-writing\n```\n\nAfter installation, you can verify if it was successful.\n```shell\nhstw --version\n```\n\n\n## Usage\n\n### Markup Conversion\nYou can convert a Markdown file on your workstation, and write the output to an HTML file.\n```shell\nwget -O original.md https://github.com/crate-workbench/hubspot-tech-writing/raw/main/tests/data/hubspot-blog-post-original.md\nhstw convert original.md converted.html\n```\n\nAlternatively, convert a Markdown file at a remote location, and write the output to STDOUT.\n```shell\nhstw convert https://github.com/crate-workbench/hubspot-tech-writing/raw/main/tests/data/hubspot-blog-post-original.md\n```\n\n### Link Checker\n\nIn order to report about missing links to the web, or inline images, run the\nlink checker on your Markdown documents.\n```shell\nhstw linkcheck original.md\n```\n\nAlternatively, you can also use a remote resource here.\n```shell\nhstw linkcheck https://github.com/crate-workbench/hubspot-tech-writing/raw/main/tests/data/hubspot-blog-post-original.md\n```\n\n### HubSpot Upload\n\nUploading to HubSpot is mostly an iterative process, so you will most likely need to use the\nprogram multiple times on the same resource. In order ease invocation, we recommend to define\nan environment variable for storing your access token to the HubSpot API.\n```shell\nexport HUBSPOT_ACCESS_TOKEN=pat-na1-e8805e92-b7fd-5c9b-adc8-2299569f56c2\n```\n\nUpload HTML file from workstation.\nThe name of the blog post will be derived from the file name.\n```shell\nhstw upload testdrive.html\n```\n\nUpload PNG image from workstation to folder path on hubfs.\n```shell\nhstw upload testdrive.png --folder-path=/foo/bar\n```\n\nConvert Markdown to HTML, upload the document under a different name, and also upload all\nreferenced images.\n```shell\nhstw upload /path/to/document.md --name=a-different-name --folder-path=/blog/2023/topic\n```\n\nFor more detailed information about this feature, please refer to the inline help:\n```shell\nhstw upload --help\n```\n\n### HubSpot Delete\n\nYou can delete blog post and file entities, by their unique resource identifiers,\nor by name resp. path.\n\n```shell\n# Delete blog post by resource identifier.\nhstw delete post --id=138458225506\n```\n\n```shell\n# Delete file by path.\nhstw delete file --path=/testdrive/foo.png\n```\n\nFor more detailed information about this feature, please refer to the inline help:\n```shell\nhstw delete --help\n```\n\n\n## Troubleshooting\n\n### Blog posts may not contain embedded images\n\nIf you are uploading directly from GitHub, and run such a command,\n```\nhstw upload https://github.com/acme/foo-repo/raw/main/article.md --name=testdrive\n```\nonly to receive an error message like this,\n```json\n{\n \"correlationId\": \"4836e94d-e42b-47a1-afff-597d8b67ba93\",\n \"errorType\": \"BLOG_POST_CONTAINS_EMBEDDED_IMAGES\",\n \"message\": \"Blog posts may not contain embedded images. Please upload images to File Manager.\",\n \"status\": \"error\"\n}\n```\nyou are most certainly using a \"private\" repository, where `hstw` does not have\naccess permissions to.\n\n\n## Prior Art\n\n- https://github.com/verypossible/hubmd\n- https://github.com/danjamescrosby/markdown-to-hubspot-blog\n\n\n[HubSpot]: https://www.hubspot.com/\n[hubspot-api-python]: https://github.com/HubSpot/hubspot-api-python\n[Markdown]: https://daringfireball.net/projects/markdown/\n[Markdown Support for Technical Bloggers]: https://community.hubspot.com/t5/HubSpot-Ideas/Markdown-Support-for-Technical-Bloggers/idi-p/15724\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Support technical writing on HubSpot using Markdown.",
"version": "0.1.0",
"project_urls": {
"changelog": "https://github.com/crate-workbench/hubspot-tech-writing/blob/main/CHANGES.md",
"documentation": "https://github.com/crate-workbench/hubspot-tech-writing",
"homepage": "https://github.com/crate-workbench/hubspot-tech-writing",
"repository": "https://github.com/crate-workbench/hubspot-tech-writing"
},
"split_keywords": [
"html",
"hubspot",
"markdown",
"tech-writing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f12a529ac993a49273a2f7b322e7d2040444dfb1935a1cc3a5678fb4c817970d",
"md5": "bb52d031180b312966d646e5e51e5d4f",
"sha256": "e411022116ad34d4d22d3a9f2d3d9896943063fcfbd9a2c3cbbad343559e3f70"
},
"downloads": -1,
"filename": "hubspot_tech_writing-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bb52d031180b312966d646e5e51e5d4f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16488,
"upload_time": "2023-10-07T07:11:35",
"upload_time_iso_8601": "2023-10-07T07:11:35.752865Z",
"url": "https://files.pythonhosted.org/packages/f1/2a/529ac993a49273a2f7b322e7d2040444dfb1935a1cc3a5678fb4c817970d/hubspot_tech_writing-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c8ee3799c8fe3fa88c38f0131e895cf7295fe2b6afd8c7382bc45681d77d0828",
"md5": "88541e11536f20e19a1e7c1d8f0770bc",
"sha256": "18d6ab59c01d5dd706a5e3a758cbeb8283ca414b86742fb1864159d40d463c7c"
},
"downloads": -1,
"filename": "hubspot-tech-writing-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "88541e11536f20e19a1e7c1d8f0770bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 18383,
"upload_time": "2023-10-07T07:11:38",
"upload_time_iso_8601": "2023-10-07T07:11:38.060241Z",
"url": "https://files.pythonhosted.org/packages/c8/ee/3799c8fe3fa88c38f0131e895cf7295fe2b6afd8c7382bc45681d77d0828/hubspot-tech-writing-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-07 07:11:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "crate-workbench",
"github_project": "hubspot-tech-writing",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hubspot-tech-writing"
}