typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

[Summary] Advanced command line interface support

Open abnerlee opened this issue 6 years ago • 27 comments

Use command line to let Typora:

  • Export file #715
  • Open files in one window (multi-tabs) #979
  • Create file if not exist #721
  • Option for keep foreground (e.g: support edit git commit message) #649
  • Option for showing/hiding views (like sidebar)

abnerlee avatar Dec 02 '18 17:12 abnerlee

One slightly strange use case of mine of "Create file if not exists" i'd like to add to consideration: Do not create the new file directly on disk. Only create a buffer (or whatever the typora equivalent is), and only create the file if it is saved. I use this with sublime text to create possibly temporary notes via a keyboard shortcut. When i want to save the note, I have already specified a name programmatically so I don't have to bother giving it a name. I'd love to replace sublime text with typora for my notes.

nilsj avatar Feb 12 '19 15:02 nilsj

One note about this: the main reason I need CLI support is to integrate Typora's non-markdown features, like mermaid charts. Ideally, a simple way to programatically replicate the "File->Export->HTML" option.

GiovanH avatar Feb 16 '19 07:02 GiovanH

Desire the command line export feature

zerostone avatar Mar 15 '19 06:03 zerostone

Me too, desire the command line export feature. It's awesome tool, we are using it to replace MS word :-), for document automation.

susu3621 avatar Sep 30 '19 13:09 susu3621

Open the file and jump to a specific line number, like Notepad++ does: start notepad++ "some file.txt" -n100 -c8 start typora "some file.md" -n100 -c8 It is extremly useful to be called by text file searching tools like FileLocator!!!

gudonglaile avatar Dec 27 '19 14:12 gudonglaile

I'm very disappointed that there's been little to no official follow up on this issue for almost ~two~ (edit: three) years. As I've mentioned, this is not just an annoyance or a nice feature request: not having these features exposed in a practical way (and the absence of CLI options for conversion and processing) makes Typora markdown files nonstandard and non-portable, which really defeats the purpose.

I'm disappointed and frustrated, and I'm going to have to look into converting all my markdown documents into a standard, useful form. With no support or even a commitment of support, I can no longer even recommend Typora.

GiovanH avatar Jan 22 '20 23:01 GiovanH

Yeah that would be one of the greatest features ever. I've implemented once a Powershell-script to export my Word documents to PDF (I need PDFs to read them on my E-Book Reader and Smartphone):

https://github.com/AlexanderMattheis/relationship-enhancement-scripts/blob/master/src/RecursiveDocToPdfConverter.ps1

Now, I want write me a a Bash script for Typora, since I've switched to Linux Mint.

AlexanderMattheis avatar Feb 22 '20 10:02 AlexanderMattheis

I traced all issues about CLI export option to this one. Is there any followup or any final decision on whether it will be implemented?

Mr-Wiredancer avatar Mar 23 '20 11:03 Mr-Wiredancer

Use command line to let Typora:

  • Export file #715
  • Open files in one window (multi-tabs) #979
  • Create file if not exist #721
  • Option for keep foreground (e.g: support edit git commit message) #649

If the Typora CLI comes up, that could be a really nice feature to use, thanks a lot !!!!!

azataiot avatar Apr 23 '20 17:04 azataiot

@abnerlee is there any followup on this? I want to be able to use Typora's HTML generation to publish web docs, but without a way to build from the command line, it's essentially useless.

maxwellainatchi avatar Jul 06 '20 04:07 maxwellainatchi

As Typora seems to support document conversion through Pandoc, as a workaround for conversion, you can use Pandoc directly: https://pandoc.org/MANUAL.html For me it was already installed and is accessible through the Terminal (on macOS), I guess because it's installed via Typora? If that's not the case, you can install it separately.

v01pe avatar Sep 02 '20 13:09 v01pe

Would be nice to have an update on the status, please?

jochenw avatar Jul 14 '21 10:07 jochenw

I'm currently working on creating an unofficial exporter for typora, it aims to have the exact same output as typora, with some more options for advanced usage. It is written in nodejs (so I can use the same libraries as typora). However it is still in early stages, I'll put it on Github and share it here when I finish basic functions.

I suspect it'll take me 1-2 months from now to release the first version (though it's nothing compared to this 3-years-old issue), be patient!:)

PegasisForever avatar Jul 14 '21 10:07 PegasisForever

Would be nice to have an update on the status, please?

Depends on for what you're here (this issue seems to be very multi-purpose). I recently discovered, there the are new export feature, one being a custom export option, where you can supply your own export scripts, etc. Also existing ones can be customized there – see the custom export feature documentation. This fulfils my needs, others might have different requirements.

v01pe avatar Jul 14 '21 11:07 v01pe

Hi, just a status update on my typora cli. I know I'm behind the schedule :) I've finished all the architectural and algorithm heavy lifting stuff, the rest is pretty trival. Expect to see the first version in 2 weeks!

PegasisForever avatar Oct 01 '21 16:10 PegasisForever

PegasisForever/typora-parser Thanks for yall's patience, let's gooo!

PegasisForever avatar Oct 15 '21 02:10 PegasisForever

I'm very disappointed that there's been little to no official follow up on this issue for almost ~two~ (edit: three) years. As I've mentioned, this is not just an annoyance or a nice feature request: not having these features exposed in a practical way (and the absence of CLI options for conversion and processing) makes Typora markdown files nonstandard and non-portable, which really defeats the purpose.

I'm disappointed and frustrated, and I'm going to have to look into converting all my markdown documents into a standard, useful form. With no support or even a commitment of support, I can no longer even recommend Typora.

I couldn't agree more. Currently Typora is not completely compatible with GitHub Flavored Markdown (#1789), making it a world of pain to publish a document written in Typora to my blog.

YalandHong avatar Nov 03 '21 07:11 YalandHong

Hope you can support "export file via command line" feature soon!

scruel avatar Sep 14 '22 04:09 scruel

Hope you can support "export file via command line" feature soon!

Agreed, I enjoy using command line text editors for most things and MD is no different. I absolutely love the Typora export feature, being able to use it from the command line would be perfect.

jfaz1 avatar Sep 18 '22 06:09 jfaz1

They're not going to. They've decided to make this hostile software. Stop using it.

GiovanH avatar Sep 26 '22 00:09 GiovanH

Does anyone know how to export markdown to PDF in command line that looks exactly like Typora's? I really love its style

WayneYam avatar Feb 02 '23 05:02 WayneYam

@abnerlee when will you add command line support for md to pdf on Linux?

ian-l-kennedy avatar Feb 08 '23 14:02 ian-l-kennedy

@WayneYam Not a complete answer but if you use PegasisForever/typora-parser from above in this thread you get html that is formatted exactly the same and then for going html->pdf you could probably use pandoc

mattiasJohnson avatar Feb 11 '23 22:02 mattiasJohnson

It will be great to have this feature. Currently I'm writing md using Typora, export to PDF to share the document. Would like to make the pdf generation as a part of CI/CD to automatically update the PDF file. I tried the PegasisForever/typora-parser above, which has some differences as the vanilla Typora, especially the mathjs part, e.g. formula number, references, and etc. I feel it's great to be able to use the Typora cli directly. Thanks!

yingbo avatar Jan 23 '24 15:01 yingbo

Generating pdf with typora from command line would be amazing for our CI too. Can't wait to see this feature coming !

cyrilDamae avatar Feb 08 '24 07:02 cyrilDamae

as a part of CI/CD

In my humble opinion, using Typora in CI/CD is a separate and more complicated issue. How to pass the license code to activate? What about the 3-device limit? Can other people trigger the CI (e.g. in PR)? Maybe self-hosted runners are required.

YDX-2147483647 avatar Feb 08 '24 16:02 YDX-2147483647

We precisely have self-hosted runners, our documentary environment is heavy because of CE and FDA appliances and the simple operation of exporting each document in pdf is painful. it would be so nice to have a CI exporting it on each release or on each merge request.

cyrilDamae avatar Feb 09 '24 08:02 cyrilDamae