Atom: Unterschied zwischen den Versionen

Aus Wiki - Jochen Hammann
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „__TOC__ == Package: atom-mktoc == Dieses Atom Package liefert den folgenden Fehler: Uncaught RangeError: Invalid array length Dieser kann in folgender Da…“)
 
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 2: Zeile 2:




== Package: atom-mktoc ==
= Package: atom-mdtoc =


Dieses Atom Package liefert den folgenden Fehler:
Dieses Atom Package liefert den folgenden Fehler:
Zeile 30: Zeile 30:
@tocContent += '  '._repeat_(level - 1) + '- '
@tocContent += '  '._repeat_(level - 1) + '- '
</syntaxhighlight>
</syntaxhighlight>
= Deutsche Rechtschreibkorrektur - Probleme mit Umlauten =
Bei der Verwendung des Pakets ''spell-check'', welches standardmäßig installiert ist, werden Wörter mit Umlaufen nicht als falsch markiert. In den Vorschlägen sind die Umlaute falsch kopiert. Der folgende Beitrag korrigiert dies unter Linux. Das Original ist [https://github.com/atom/spell-check/issues/161 hier] zu finden.
<blockquote>
That works indeed!
But it might not be immediately clear what one has to do exactly to achieve this. Therefore the following step-by-step workaround for (Swiss) German Linux/Ubuntu users (type all the commands into a standard terminal):
# List all the system-wide installed hunspell dictionaries:<pre>hunspell -D</pre>You might have to install the package hunspell beforehand.
# Create a new directory for the custom dictionary files with UTF-8 encoding; I'd recommend:<pre>mkdir ~/.atom/custom_spellchecker_dictionaries/</pre>Of course you could also directly convert the original dictionary files. But since I don't know what potential side effects in conjunction with other programs that could have, I wouldn't recommend it.
# Create UTF-8 versions of all the relevant dictionary files in the new directory. Example for (Swiss) German and English dictionaries:<pre>iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/de_CH.aff | sed 's/^SET ISO8859-1$/SET UTF-8/g' > ~/.atom/custom_spellchecker_dictionaries/de_CH.aff</pre><pre>iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/de_CH.dic > ~/.atom/custom_spellchecker_dictionaries/de_CH.dic</pre><pre>iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/de_DE.aff | sed 's/^SET ISO8859-1$/SET UTF-8/g' > ~/.atom/custom_spellchecker_dictionaries/de_DE.aff</pre><pre>iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/de_DE.dic > ~/.atom/custom_spellchecker_dictionaries/de_DE.dic</pre><pre>iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/en_US.aff | sed 's/^SET ISO8859-1$/SET UTF-8/g' > ~/.atom/custom_spellchecker_dictionaries/en_US.aff</pre><pre>iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/en_US.dic > ~/.atom/custom_spellchecker_dictionaries/en_US.dic</pre>You might have to adjust the paths to the ouptut of hunspell -D; the above are valid in Ubuntu 16.04 LTS.
# Set the path to the new folder in the option Locale Paths of the Atom spell-check package (note that you can only use absolute paths, so no ~ shortcut). If you followed the recommendation under 1), the path would be: /home/USERNAME/.atom/custom_spellchecker_dictionaries/.
# Restart Atom.
</blockquote>

Aktuelle Version vom 5. Januar 2018, 09:41 Uhr


Package: atom-mdtoc

Dieses Atom Package liefert den folgenden Fehler:

Uncaught RangeError: Invalid array length

Dieser kann in folgender Datei behoben werden:

~/.atom/packages/atom-mdtoc/lib/toc-view.coffee

Hierzu müssen folgende Ersetzungen vorgenommen werden:

// replace 
String::repeat = (n) -> Array(n+1).join(this)
// to
String::_repeat_ = (n) -> Array(n+1).join(this)

//replace
@tocContent += '&emsp;'.repeat(level - 1)
//to
@tocContent += '&emsp;'._repeat_(level - 1)

//replace
@tocContent += '   '.repeat(level - 1) + '- '
//to
@tocContent += '   '._repeat_(level - 1) + '- '


Deutsche Rechtschreibkorrektur - Probleme mit Umlauten

Bei der Verwendung des Pakets spell-check, welches standardmäßig installiert ist, werden Wörter mit Umlaufen nicht als falsch markiert. In den Vorschlägen sind die Umlaute falsch kopiert. Der folgende Beitrag korrigiert dies unter Linux. Das Original ist hier zu finden.

That works indeed!

But it might not be immediately clear what one has to do exactly to achieve this. Therefore the following step-by-step workaround for (Swiss) German Linux/Ubuntu users (type all the commands into a standard terminal):

  1. List all the system-wide installed hunspell dictionaries:
    hunspell -D
    You might have to install the package hunspell beforehand.
  2. Create a new directory for the custom dictionary files with UTF-8 encoding; I'd recommend:
    mkdir ~/.atom/custom_spellchecker_dictionaries/
    Of course you could also directly convert the original dictionary files. But since I don't know what potential side effects in conjunction with other programs that could have, I wouldn't recommend it.
  3. Create UTF-8 versions of all the relevant dictionary files in the new directory. Example for (Swiss) German and English dictionaries:
    iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/de_CH.aff | sed 's/^SET ISO8859-1$/SET UTF-8/g' > ~/.atom/custom_spellchecker_dictionaries/de_CH.aff
    iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/de_CH.dic > ~/.atom/custom_spellchecker_dictionaries/de_CH.dic
    iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/de_DE.aff | sed 's/^SET ISO8859-1$/SET UTF-8/g' > ~/.atom/custom_spellchecker_dictionaries/de_DE.aff
    iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/de_DE.dic > ~/.atom/custom_spellchecker_dictionaries/de_DE.dic
    iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/en_US.aff | sed 's/^SET ISO8859-1$/SET UTF-8/g' > ~/.atom/custom_spellchecker_dictionaries/en_US.aff
    iconv -f ISO-8859-1 -t UTF-8 /usr/share/hunspell/en_US.dic > ~/.atom/custom_spellchecker_dictionaries/en_US.dic
    You might have to adjust the paths to the ouptut of hunspell -D; the above are valid in Ubuntu 16.04 LTS.
  4. Set the path to the new folder in the option Locale Paths of the Atom spell-check package (note that you can only use absolute paths, so no ~ shortcut). If you followed the recommendation under 1), the path would be: /home/USERNAME/.atom/custom_spellchecker_dictionaries/.
  5. Restart Atom.