Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customized export command #75

Open
fyuniv opened this issue Nov 29, 2021 · 8 comments
Open

Support customized export command #75

fyuniv opened this issue Nov 29, 2021 · 8 comments

Comments

@fyuniv
Copy link

fyuniv commented Nov 29, 2021

Is it possible to add a feature for customized exporting like Typora? Since Pandoc support default.yaml, this feature will make exporting more powerful. Thank you!

@fyuniv fyuniv changed the title Support customize export commad Support customized export command Nov 30, 2021
@mb21
Copy link
Owner

mb21 commented Nov 30, 2021

What exactly do you want to customize that you currently cannot? Have you read the README?

@fyuniv
Copy link
Author

fyuniv commented Nov 30, 2021

What exactly do you want to customize that you currently cannot? Have you read the README?

My bad, I didn't know that the defaults.yml will be automatically handled by Panwriter. Now I feel much better to recommend it to others.

Other things that I was thinking about is to run some simple commands, such as, git commit, or hugo, in Panwriter. Can this feature be added in future versions? Thank you!

@mb21
Copy link
Owner

mb21 commented Nov 30, 2021

run some simple commands, such as, git commit, or hugo, in Panwriter

hm.. I was thinking of keeping PanWriter focused on the writing experience and calling pandoc... but if enough people are interested in this, could think of a way to add it that doesn't bloat the code and the GUI too much...

@fyuniv
Copy link
Author

fyuniv commented Nov 30, 2021

run some simple commands, such as, git commit, or hugo, in Panwriter

hm.. I was thinking of keeping PanWriter focused on the writing experience and calling pandoc... but if enough people are interested in this, could think of a way to add it that doesn't bloat the code and the GUI too much...

Thank you in advance! The reason I asked for customized commands is to make the editor self-contained for creating and publishing webpages or slides. It will help new users of markdown to get work done without running command in command line or using another App.

@mb21
Copy link
Owner

mb21 commented Jan 29, 2022

We could read out a special key from the document's YAML metadata, which would override the default export command, which is currently simply pandoc, so you could do:

---
export: './run.sh'
---

# my markdown doc

but it would then be up to the run.sh to handle all the same arguments pandoc accepts (potentially passing them on to pandoc).

Also not sure of the security implications of this... users could be easily tricked into opening a malicious document in PanWriter, clicking file -> export, and having arbitrary code executed on their system, we probably would have to put a warning dialog up once per document (and also show that when using a pandoc filters or a custom writer).

@AkechiShiro
Copy link

Hey any news on this feature or any related PR ? If I have some time, I may try to land a PR in after the month of May, anyone willing to help me with that ?

@mb21
Copy link
Owner

mb21 commented Apr 26, 2022

No code written yet, but discussion or even PRs welcome! So far I've been mostly waiting on feedback on whether the proposal in my last comment here would satisfy users' needs...

@AkechiShiro
Copy link

AkechiShiro commented Apr 26, 2022

On my end it would satisfy me as long as I can use a custom template, although I would probably work on panwriter's preview feature to try and support custom pandoc templates too but I hvae no idea how hard or even if that is currently doable, I'm not familiar with the tech stack used by panwriter to preview markdown.

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

No branches or pull requests

3 participants