This Visual Studio Code extension is a utility tool for working with images in Asciidoc documents. It provides three main features: one that reads an image file path from the clipboard, encodes the image in Base64 format, and inserts it into the document, another that converts an existing image block in the Asciidoc document to a Base64-encoded inline image, and a third that decodes a selected Base64 encoded image and saves it as an image file.
Features
Reads an image file path from the clipboard
Converts selected Asciidoc Image Block to Base64-encoded inline image
If the specified file path points to a PNG, JPG, or JPEG image, the image is loaded and encoded in Base64 format
The encoded image data is inserted at the current editor's selection start position
The decoded image file is saved at the user's chosen location
Usage
Copy the image file path to the clipboard (e.g., C:\Images\example.png)
Open the VS Code command palette and run the "Paste Image as Base64" command
The encoded image data will be inserted at the current editor's selection start position
Or
Select an existing Asciidoc Image Block in the document
Open the VS Code command palette and run the "Convert Image to Base64" command
The selected image block will be replaced with a Base64-encoded inline image
Or
Select a Base64-encoded inline image in the document
Open the VS Code command palette and run the "Decode Image and Save" command
A save file dialog will open for you to choose the location to save the decoded image file
Error Handling
If the content of the clipboard is an invalid file path or the file path does not exist, an error message will be displayed to the user
If the selected text is not a valid Asciidoc Image Block or the file does not exist, an error message will be displayed to the user
If the specified file path does not point to a PNG, JPG, or JPEG image, an error message will be displayed to the user
If the selected text is not a valid Base64-encoded image, an error message will be displayed to the user
Caution
This extension encodes the image that the file path points to in Base64 format. Encoding a very large image may result in a very large amount of generated data.
The "Convert Image to Base64" command will replace the existing image block with encoded data. Be sure to keep a backup of your original document.
The "Decode Image and Save" command will save the decoded image at the user's chosen location. Make sure to have sufficient disk space.
Release Notes
0.0.4
Added command to decode and save image
0.0.3
Added command to Base64 encode an existing Asciidoc Image block
0.0.2
Image notation of Asciidoc was wrong, so fixed it
0.0.1
alpha test
Asciidoc画像挿入ユーティリティ拡張機能
概要
このVisual Studio Code拡張機能は、Asciidocドキュメントでの画像操作を支援するユーティリティツールです。クリップボードから画像ファイルのパスを読み取り、その画像をBase64形式にエンコードしてドキュメントに挿入する機能、既存のAsciidocドキュメント内の画像ブロックをBase64エンコードされたインライン画像に変換する機能、そして選択したBase64エンコードされた画像をデコードし、画像ファイルとして保存する機能、の3つの主要な機能を提供します。