
1) There is now a new preference page under images for "Maintaining server paths". You specify a server path (such as /images/) and a local path (such as c:\hugo\static\images), and Marktext will do the right mapping internally. Image previews will come from the images on your computer, while the content stored in the document will represent the corresponding server paths. Full documentation has been added to IMAGES.md. 2) Path variables (like ${filename}) have been expanded to support year, month, and day. This helps prevent filename collisions and is common in many blogging platforms. 3) Pasting images and dragging them into Marktext supports this path mapping as well, moving them to the local path as appropriate 4) Image imports (pasting and or dragging) now retain the source image file name if possible, only using the image hash if there is a conflict. Images with names are easier to manage and show up appropriately in search engines 4) The image edit dialog now has a 'Rename' tab so that you can rename the images to something more specific when they are just pasted from the clipboard. This simplifies the previous workflow that used to require editing the markdown and renaming the file in the filesystem manually. There is also now a 'User Notification Dialog' component to let Marktext communicate with the user about error conditions.
2.2 KiB
Image support
MarkText can automatically copy your images into a specified directory or handle images from clipboard.
Maintaining server paths during editing and preview
When editing documents, you may want image paths to represent absolute paths on the server that will ultimately host them (such as /images/myImage.png
) rather than
local filesystem paths (such as C:\assets\static\images\myImage.png
). You can use Maintain server paths during editing and preview to support this scenario.
When MarkText sees a specified server path for an image in your document, it will instead look into the local path you've provided when previewing images. Your document will retain the original server path as specified.
Upload to cloud using selected uploader
Please see here for more information.
Move to designated local folder
This option automatically copies images into the specified local directory. This path may be a relative path, and may include variables like ${filename}
. The local resource directory is used if the file is not saved. This directory must be a valid path name and MarkText need write access to the directory.
The following are valid variables for use in the image path:
${filename}
: The document's file name, without path or extension${year}
: The current year${month}
: The current month, in 2-digit format${day}
: The current day, in 2-digit format
If you have specified the option to Maintain server paths during editing and preview, MarkText will replace local filesystem paths with the corresponding server path.
Prefer relative assets folder:
When this option is enabled, all images are copied relative to the opened file. The root directory is used when a project is opened and no variables are used. You can specify the path via the relative image folder name text box.
Examples for relative paths:
assets
../assets
.
: current file directoryassets/123
assets_${filename}
(add the document file name)assets/${year}/${month}
(save the assets into year and month subdirectories)
Keep original location
MarkText only saves images from clipboard into the specified local directory.