Obsidian plugin to compose and post threads to Mastodon.
Mastodon is a microblogging network (similar to Twitter), where users can publish text posts and optionally attach media such as pictures, audio, video, or polls. It also lets you follow friends and discover new ones.
Mastodon allows you to link responses together, one after another, to form a thread. Many users on this network, as has been done on Twitter before, use threads to post content that is longer than the limitations of the format would allow.
Making threads can be tedious, manually pasting text and images. This plugin allows you to leverage Obsidian's editing capabilities to prepare thread snippets and then send them to the Mastodon server automatically.
This plugin can:
This plugin is tested under Obsidian v1.7.7. It may not work with older versions.
To install Obsidian, download it from the official site and follow their instructions. Once you have Obsidian installed and created your vault, you can proceed to install the plugin.
main.js, manifest.json and styles.css from the releases page.<path-to-obsidian-vault>/.obsidian/plugins/mastodon-threading/ and copy in it the files.You can also install it with the BRAT plugin helper. Follow its instructions to get the plugin and enable it.
To build the plugin, you need Node.js with NPM or similar manager installed in your computer. Clone the source, install all dependencies and build the plugin:
$ git clone https://github.com/elpamplina/mastodon-threading.git
$ cd mastodon-threading
$ npm install
$ npm run build

Before you use the plugin for the first time, you need to go into the settings to establish a connection to your Mastodon server.
As you know, Mastodon is a distributed network, which means that there are many servers (also known as instances) that collaborate by sending posts. To use the plugin, you need to connect to the server that your personal account lives on and give the plugin permissions to send posts.
If you don't know which server your personal account is, just look at the second part of your username. For example, if your name is @[email protected], then your server is example.org.
Type your server name in the box provided and press "Connect"
A browser window will open on your server, asking for your user credentials, and then for you to grant the following permissions to the plugin:
read:search: Search posts in the server to know if they can be quoted by you.write:media: Send multimedia attachments to the server.write:statuses: Post messages on your behalf.Once permission is granted, the browser may ask you if you want to return to Obsidian, or you will be redirected automatically. It is necessary to return to Obsidian to store the authorization, and then it will be indicated that you are connected. The connection and authorization process is only necessary the first time you use the plugin. From then on, the plugin stores its credentials (not yours) securely until you press "Disconnect."
If the process fails, you can start it from the beginning as many times as necessary.
IMPORTANT: This plugin complies with the official Mastodon authentication guide. At no time does the plugin have access to your user credentials, nor does it store any personal information in any way, nor does it have access to your posts or your user profile. Nor does it collect any information from your account, not even that which is publicly accessible. The plugin stores in encrypted form only the tokens that the server sends to it using the secure OAuth protocol.
[1/10]). By default, this is disabled.For more information about quotes in Mastodon, refer to the official documentation.
In Mastodon, visibility (aka publishing level) allows you to decide how your posts are published on the network:
In Mastodon there is another visibility (direct), which is not supported by this plugin.
NOTE: Before using this plugin, please check your server's rules regarding posting. It is common that posting entire threads to the public to be considered disrespectful. This plugin recommends posting only the first post in the thread to the public. You must also follow the rest of the server rules regarding prohibited topics and content.
The plugin adds the following commands to the Obsidian's palette:
The "Send to Mastodon" and "Insert thread separator" commands also appear in the context menu of the Obsidian editor.
The "Send to Mastodon" command also appears in the icons ribbon (if available).
Separators are the primary tool for composing threads. They are used to place text and images into chunks that will then be sent as posts in the thread.

In Obsidian's edit mode, separators are displayed as horizontal lines with a chunk counter and a character counter.
When the maximum size is exceeded, this is indicated visually by turning the counters red.
In Obsidian's view mode, separators appear as simple horizontal lines with no counter.
When the plugin is disabled, or when copying text somewhere outside the vault, separators are displayed with the typographical paragraph symbol (§).
The plugin manages the images, videos and other media that are supported by the Mastodon server. In addition to the limitations in the number of files, their types and sizes, the Mastodon protocol also prohibits mixing videos and images in the same post, as well as add more than one video in the same post.
The plugin takes into account all this and, in the event that some attachment does not meet the limitations of the server, an error message is shown BEFORE starting to send the thread.
The plugin uses quote blocks (starting with the Markdown symbol ">") to add descriptions to images and other media. Just add a quote block after a media, and it will be sent as description.

Quote blocks that are not directly behind an image will be ignored and will not be sent as part of the thread. Feel free to use them as a place to keep comments or notes.
Starting a line with "!!" symbols will make it a content warning (aka spoiler text). Mastodon will show the rest of the post collapsed behind this warning.
You are greatly welcome to ask questions, post any suggestions, or report any bugs! You can do it directly here in Github, or by email at [email protected], or in Mastodon at @[email protected]
Please note that this is a side project I'm working on in my spare time. I cannot guarantee responsiveness or maintenance beyond my personal circumstances.
Language definitions are in the lang folder. Currently only some languages are supported. Constributions in other languages are GREATLY APPRECIATED!!
Please send your language definitions via Pull Request on Github, or contact me at [email protected] for further instructions.
This plugin is free software, released under the General Public License version 2.
This plugin is made and maintained as a side project for amusement only.