jupyterlab-contrib / spellchecker

Spellchecker for JupyterLab notebook markdown cells and file editor.
BSD 3-Clause "New" or "Revised" License
205 stars 20 forks source link

Spellcheck in TEX Documents? #30

Closed BrandenEsses closed 4 years ago

BrandenEsses commented 4 years ago

I'm trying to have the extension work on .tex documents. It works on LaTEX class files (.cls) out of the box. I tried adding 'text/x-tex' to the accepted type list in index.ts, but to no avail. It seems that .tex documents are a subset of 'text/plain', and I am not sure where to go from here.

Apologies if this is not the correct place for this - I am new to GitHub.

krassowski commented 4 years ago

It seems that lab uses text/latex mimetype for tex documents as per file formats documentation. Would that work for you?

BrandenEsses commented 4 years ago

Thanks for your quick reply!

I went ahead and changed it to:

accepted_types = [ 
        'text/plain',
        'text/x-ipythongfm',   // IPython GFM = GitHub Flavored Markdown, applies to all .md files
        'text/latex',
    ]; 

I rebuilt with:

npm run build
jupyter lab build

But no dice. So I completely uninstalled, rebuilt and reinstalled, but still no luck. Am I missing anything?

krassowski commented 4 years ago

I would try one more command (if you have not already): jupyter labextension link .

If you are not sure if your changes are being picked up, you could always try to add an alert() call somewhere in the code.

Feel free to post the result of jupyter labextension list. Also, you may be interested in the tex support we have over in jupyterlab-lsp extension.

BrandenEsses commented 4 years ago

I've decided to focus my attention on jupyterlab-lsp. Thank you for the support!

QZ4869 commented 3 years ago

You need use text/x-latex instead of text/latex

accepted_types = [ 
        'text/plain',
        'text/x-ipythongfm',   // IPython GFM = GitHub Flavored Markdown, applies to all .md files
        'text/x-latex',
    ]; 
krassowski commented 3 years ago

Thanks @QZ4869! It should be now possible to change the types for the user interface (see #32).