Skip to content

added option to use a command line script as image uploader - #2100

Merged
fxha merged 3 commits into
marktext:developfrom
txgruppi:command-image-uploader
Jan 8, 2022
Merged

fxha merged 3 commits into
marktext:developfrom
txgruppi:command-image-uploader

Conversation

@txgruppi

@txgruppi txgruppi commented May 5, 2020

Copy link
Copy Markdown
Contributor
Q A
Bug fix? no
New feature? yes
Breaking changes? no
Deprecations? no
New tests added? no
Fixed tickets none
License MIT

Description

Added the option to upload images using a script.

I have some use cases where the images have to be in specific server and the easiest way for me to implement an uploader with the editor is to run a script that accepts a file path as its first argument and output to stdout the url to use

I believe this feature can help others

Thanks for the project

@Jocs
Jocs requested a review from fxha May 31, 2020 07:26
@fxha fxha added the 🔍 need review This PR need review label Jun 17, 2020

@fxha fxha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@txgruppi Sorry, this PR has been open for a while but Mark Text was not active maintained. I found a few issues and we can merge it after resolving these.

Comment thread src/renderer/util/fileSystem.js Outdated
import { tmpdir } from 'os'
import path from 'path'
import axios from '../axios'
import { dataURItoBlob, getContentHash } from './index'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep old import order.

Comment thread src/renderer/util/fileSystem.js Resolved
<div class="description">The script will be executed with the image file path as its only argument and it should output with any valid value for the <code>src</code> attribute of a <em>HTMLImageElement</em>.</div>
<div class="form-group">
<div class="label">
Script absolute path

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "Shell script location" because the script must be included in the PATH environment variable or absolute? Below too.

<el-button size="mini" :disabled="githubDisable" @click="setCurrentUploader('github')">Set as default</el-button>
</div>
</el-tab-pane>
<el-tab-pane label="Command line script" name="cliScript">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer "Command-line Script" as title.

Comment thread src/renderer/util/fileSystem.js Resolved
@fxha fxha removed the 🔍 need review This PR need review label Dec 22, 2021
@fxha

fxha commented Dec 22, 2021

Copy link
Copy Markdown
Contributor

Closes #2737

@txgruppi

txgruppi commented Jan 6, 2022

Copy link
Copy Markdown
Contributor Author

@fxha can you check if my last commit solves the issues you found?

@fxha

fxha commented Jan 8, 2022

Copy link
Copy Markdown
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants