Package Details: typora 1.9.3-1

Git Clone URL: https://aur.archlinux.org/typora.git (read-only, click to copy)
Package Base: typora
Description: A minimal markdown editor and reader.
Upstream URL: https://typora.io/
Keywords: markdown
Licenses: custom:"Copyright (c) 2015 Abner Lee All Rights Reserved."
Submitter: duckbrain
Maintainer: irgendwr
Last Packager: irgendwr
Votes: 135
Popularity: 0.44
First Submitted: 2016-09-28 06:28 (UTC)
Last Updated: 2024-08-28 01:55 (UTC)

Pinned Comments

irgendwr commented on 2023-01-24 18:49 (UTC) (edited on 2023-10-17 21:03 (UTC) by irgendwr)

Before flagging this package as "out-of-date", please read this:

First of all, I appreciate your help, but I'm already running a script that notifies me once a new version is available. Please wait 1-2 days before flagging, unless it is critical. Usually I manage to push updates on the same day as Typora releases them.

Also: The latest version on their website might not be the latest Linux repository version. E.g. because some updates do not have any changes related to Linux.

To check the latest Linux version, run the following command: curl -s https://www.typora.io/linux/Packages | grep Version | cut -f 2 -d ' ' | sort -V | cut -f 1 -d '-' | uniq

Please do not flag this package as "out-of-date" if the "new version" is not listed in the output of the aforementioned command.

irgendwr commented on 2021-11-26 12:36 (UTC) (edited on 2022-10-09 11:03 (UTC) by irgendwr)

Typora is no longer completely free since it's out of beta. It is possible to use Typora for free on Linux; Some restrictions may apply. See the official FAQ: "Can I use Typora for free?" for more details. Alternatively you can purchase a license.

Please report issues with Typora here: https://github.com/typora/typora-issues

Latest Comments

« First ‹ Previous 1 .. 4 5 6 7 8 9 10 11 12 Next › Last »

rocka commented on 2018-10-03 13:51 (UTC) (edited on 2018-10-07 07:47 (UTC) by rocka)

Good to know that changes, but I found 2 new questions:

  1. app configuration path has been changed to ~/.config/Electron, not ~/.config/Typora, because electron did not start with a package.json file. We can use electron's app.setPath() to override it;

  2. the app version in 'Help -> About' displays version of electron, not Typora. We can also override it with the version name from package.json file.

Here was the changed typora.js:

#!/usr/bin/electron

const { join } = require('path');
const { app } = require('electron');
const APP_DIR = '/usr/share/typora/';
const conf = require(APP_DIR + 'package.json');

app.setName(conf.name);
app.setPath('userData', join(app.getPath('appData'), conf.name));
app.getVersion = () => conf.version;

process.argv.shift();
require(APP_DIR + conf.main);

duckbrain commented on 2018-10-03 03:45 (UTC)

@rocka, I used your idea, but without patching the Typora code. My entrypoint is a JavaScript file with electron in the hash-bang, that just immediately removes the extra arg and runs the normal code. It seems to work.

Let me know if there are any other issues with the new system electron package.

rocka commented on 2018-09-26 13:03 (UTC) (edited on 2018-09-27 03:51 (UTC) by rocka)

Finally I figured out how to keep the featrue "On Launch - Restore last closed files and folders" functionality with system electron. Just patch the .js files.

When typora is launched with bundled electron, it's process.argv equals to ["/usr/share/typora/Typora", "/path/to/file"]. But if it was launched with system electron, it changes to ["/usr/lib/electron/electron", "/path/to/typora", "/path/to/file"], so it would just restore typora folder every times.

Let me show the PKGBUILD and patch:

pkgname=typora
pkgver=0.9.58
pkgrel=1
pkgdesc="Typora will give you a seamless experience as both a reader and a writer."
arch=('x86_64')
license=('custom:"Copyright (c) 2015 Abner Lee All Rights Reserved."')
url="https://typora.io/"
depends=('gconf' 'libxss' 'electron')
makedepends=('asar')
optdepends=('noto-fonts-emoji: Or some other emoji font to see emojis')
provides=('typora')
conflicts=('typora')
source=(
    'typora.sh'
    'atom.js.diff'
    "https://typora.io/./linux/${pkgname}_${pkgver}_amd64.deb"
)
md5sums=(
    'ba1aa3c5c401723a06cb941fe8b7c23a'
    'a103aa5e384d9fc4b54a7aae4e10d4e5'
    '23e55a05ead4115b415c77c1709aa9e6'
)

package() {
    _src="$srcdir/$pkgname"
    mkdir -p "$_src"
    bsdtar -xf data.tar.xz -C "$_src/"

    sed -i '/Change Log/d' "$_src/usr/share/applications/typora.desktop"

    asar e "$_src/usr/share/typora/resources/app/atom.asar" "$_src/usr/share/typora/resources/app/atom"
    patch "$_src/usr/share/typora/resources/app/atom/atom.js" "$srcdir/atom.js.diff"
    asar p "$_src/usr/share/typora/resources/app/atom" "$_src/usr/share/typora/resources/app/atom.asar"
    rm -r "$_src/usr/share/typora/resources/app/atom"

    install -Dm644 "$_src/usr/share/applications/typora.desktop" "$pkgdir/usr/share/applications/typora.desktop"
    install -Dm644 "$_src/usr/share/doc/typora/copyright" "$pkgdir/usr/share/doc/typora/copyright"
    install -Dm755 "$srcdir/typora.sh" "$pkgdir/usr/bin/typora"

    cp -r "$_src/usr/share/icons" "$pkgdir/usr/share/icons"
    cp -r "$_src/usr/share/typora/resources/app" "$pkgdir/usr/share/typora"
}

typora.sh

#!/usr/bin/bash
exec /usr/bin/electron /usr/share/typora $@

atom.js.diff

--- atom.js 2018-09-26 20:48:45.760765096 +0800
+++ atom.1.js   2018-09-26 20:46:57.989992178 +0800
@@ -60,6 +60,9 @@

 function getFilePath(argv, workingDirectory) {
     var path;
+    if (argv[0].endsWith('electron')) {
+        argv.shift();
+    }
     if (argv.length > 1) {
         path = argv[argv.length - 1];
     }

arch440 commented on 2018-08-24 08:07 (UTC)

That makes sense, I was suggesting it because I noticed a regression/change when keeping the electron dependency: the preference "On Launch - Restore last closed files and folders" is not working anymore, and it always opens in the system Typora folder /usr/share/typora/. This was working before.

duckbrain commented on 2018-08-21 23:20 (UTC)

I prefer having the electron dependency, unless it causes a problem. It makes the package much smaller (44038772 to 8509788 bytes) and prevents having these types of issues in the future.

arch440 commented on 2018-08-17 09:10 (UTC)

Today glibc was updated to 2.28-4, so I guess we can remove the electron dependency now?

duckbrain commented on 2018-08-13 17:20 (UTC)

Sorry, I made the fix @rocka suggested, but I forgot to push it (to the correct remote). I can't get into my machine with the key right now, (NetworkManager keeps stopping sshd) but I'll push it when I can.

In the meantime. If you replace /usr/bin/typora with @rocka's script, it should work.

@Peven, good to know that this is a glibc issue. I'm liking the removing the packaged electron to trim down package size anyway.

Peven commented on 2018-08-13 16:05 (UTC) (edited on 2018-08-13 16:06 (UTC) by Peven)

The segmentation fault (core dumped) typora can be solved by upgrading glibc to 2.28-4 in testing Repo

rocka commented on 2018-08-13 08:26 (UTC) (edited on 2018-08-13 13:21 (UTC) by rocka)

@duckbrain That was a mistake, sorry for that ... Maybe we should write typora.sh as below:

#!/usr/bin/bash
exec /usr/bin/electron /usr/share/typora/resources/app $@

the directory /usr/share/typora/resources/app should be where typora's package.json located, that's depends on where we installed it ...

bilabila commented on 2018-08-11 14:03 (UTC)

a way to open with local electron

cd /usr/share/typora/resources/app
electron .