[Userscript] WaniKani Markdown Notes (Rich-Text Formatting of Notes)


#1

WaniKani Markdown Notes

Although the notes feature recently implemented is very useful, having only plain text can make it difficult to put anything meaningful in the notes. It would be very useful to even just have bold text in the notes.

But now, you can!

This script gives you all of the power of markdown in your notes. For a reference, see here for a full reference of the syntax. Markdown allows you to make text bold, italic, insert links and insert pictures, all into notes.

Installation

  1. Install Tapermonkey on Chrome or Greasemonkey on Firefox.
  2. Install the script from here.

Usage

When you edit a script, use some of the markup syntax listed below. When you save the comment, it will be rendered as HTML. Currently this works in reviews and on the individual item pages.

Markup Summary

The following is a summary of the markup you can use within notes.

  • **text** → text
  • __text__ → text
  • *text* → text
  • _text_ → text
  • [Link Text](http://www.google.com) → Link Text
  • ![Alternate Text](image_url) → (Display image_url)

Although there is more markup within Markdown, newlines are not allowed in notes, so you can’t use most of it.

Custom Markdown

In addition to this, I have included the ability to mark various parts of the text as kanji/vocab/radical/reading, just like during reviews and on item detail pages. They are as follows:

  • #kan#Kanji#/kan# → Kanji, but will be pink.
  • #rad#Radical#/rad# → Radical, but will be blue.
  • #voc#Vocabulary#/voc# → Vocabulary, but will be purple.
  • #read#Reading#/read# → Reading, but will be black.

Compatability

Tested and works on:

  • Chrome 31.0.1650.57 (with Tapermonkey 3.5.3630.77).
  • Firefox 25.0.1 (with Greasemonkey 1.12).

Known Issues

  • If you click in the text area while editing a note, it may reset to the original contents.

Version History

1.1

  • Fixed bug where only the first occurrence of each custom tag was being replaced.

Screenshots

To produce the following, just type the following:

  • This is a custom note. It has some **markdown** in it. And some #kan#custom#/kan# #rad#markup#/rad#.

Screenshot 1


[Userscript]: Markdown Notes (updated)
List of API and Third-Party Apps
#2

Very nice. Thanks.


#3

Just thought of such a feature a few days ago. Thanks a lot!


#4

First of all, your scripts are awesome.
Now, I just had some problems with this one:


(From http://www.wanikani.com/kanji/%E5%86%8D)
It seems you can only mark once with each of the markdown types.


#5
Breathless said... First of all, your scripts are awesome.
Now, I just had some problems with this one:

(From http://www.wanikani.com/kanji/%E5%86%8D)
It seems you can only mark once with each of the markdown types.

 Thanks! This should be fixed now if you update the script (not sure if this happens automatically?).

Jeshua

#6
jeshuamorrissey said...
Breathless said... First of all, your scripts are awesome.
Now, I just had some problems with this one:

(From http://www.wanikani.com/kanji/%E5%86%8D)
It seems you can only mark once with each of the markdown types.

 Thanks! This should be fixed now if you update the script (not sure if this happens automatically?).

Jeshua
 Had to update manually but, wow, that was fast! Thanks, bro. :D

#7

Just installed. ありがとう!


#8

This script is causing a little problem now.

When enabled, all my line breaks vanish and it mushes the lines together.

Do I need to use some type of code to insert line breaks when this is enabled?

As a demonstration, if I were to write the above, in its current format into the user note section, it would look like this:

This script is causing a little problem now.When enabled, all my line breaks vanish and it mushes the lines together.Do I need to use some type of code to insert line breaks when this is enabled?


#9

Good find! Should be fixed now. Make sure you upgrade to the latest version of the script :slight_smile:

Just a note: you can’t have kanji/vocab/radical popovers that span multiple lines. 


#10

It works! :slight_smile:

Thanks for that.


[Request] Usable bold\italic in reading\meaning notes
#11

I love this script. I wonder where my markdown stuff is stored? If I reset Safari is it all going to disappear? :slight_smile:


#12
sukoshi said...I love this script. I wonder where my markdown stuff is stored? If I reset Safari is it all going to disappear? :)
 FYI, in case you haven't seen the updated version of this script:
/t/Userscript-Markdown-Notes-updated/11462/1

The markdown (for both versions) is stored on WK's server as unencoded text.  The script just encodes/decodes it.