Skip to content

Commit

Permalink
Migaku Launch Fiesta
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasMIA committed Sep 16, 2020
1 parent 46861cf commit dd47ab9
Show file tree
Hide file tree
Showing 21 changed files with 304 additions and 212 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to the MIA Japanese Addon
# Contributing to the Migaku Japanese Addon

## Important checks
- Before create any pull requests, please open a issue explaining the situation
Expand Down
9 changes: 9 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
The GNU GENERAL PUBLIC LICENSE Version 3 license listed below is applicable in areas not conflicting with the following rules:

1. Any open-source Migaku project must be shared under the Migaku brand, name changes are not allowed. Additions to the default project names are however allowed. For example "Migaku Japanese - Extra Kanji Support Edition", which would be an appending of " - Extra Kanji Support Edition", to the default name of "Migaku Japanese".

2. When making a release of a fork whether publicly or privately a link to the official Migaku GitHub, the Migaku Patreon, and the Migaku Youtube Channel must also be provided.

3. Forks of an open-source Migaku project that is officially released on the AnkiWeb platform (https://ankiweb.net/shared/addons/) must not be released there.


GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Expand Down
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
<h2 align="center">MIA Japanese Addon</h2>
<h2 align="center">Migaku Japanese Addon</h2>

<p align="center">
<a title="Rate on AnkiWeb" href="https://ankiweb.net/shared/info/278530045"><img src="https://glutanimate.com/logos/ankiweb-rate.svg"></a>
<a title="License: GNU AGPLv3" href="https://github.com/mass-immersion-approach/MIA-Japanese-Add-on/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-GNU AGPLv3-green.svg"></a>
<a title="License: GNU AGPLv3" href="https://github.com/migaku-official/Migaku-Japanese-Addon/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-GNU AGPLv3-green.svg"></a>
<br>
<a title="Buy us a coffee :)" href="https://ko-fi.com/massimmersionapproach"><img src="https://img.shields.io/badge/ko--fi-contribute-%23579ebd.svg"></a>
<a title="Support us on Patreon" href="https://www.patreon.com/massimmersionapproach/posts"><img src="https://img.shields.io/badge/patreon-support-orange.svg"></a>
<a title="Support us on Patreon" href="https://www.patreon.com/Migaku"><img src="https://img.shields.io/badge/patreon-support-orange.svg"></a>
<br>
<a title="Subscribe to YogaMIA" href="https://www.youtube.com/c/yogamia"><img src="https://img.shields.io/badge/YouTube-YogaMIA-red.svg"></a>
<a title="Subscribe to Matt vs Japan" href="https://www.youtube.com/user/MATTvsJapan"><img src="https://img.shields.io/badge/YouTube-Matt vs Japan-red.svg"></a>
<a title="Subscribe to Immerse with Migaku" href="https://www.youtube.com/c/ImmerseWithYoga"><img src="https://img.shields.io/badge/YouTube-Immerse%20with%20Yoga-red"></a>
<br>
<a title="Follow me on Twitter" href="https://twitter.com/intent/user?screen_name=Yoga_MIA"><img src="https://img.shields.io/twitter/follow/Yoga_MIA.svg"></a>
<a title="Follow me on Twitter" href="https://twitter.com/intent/user?screen_name=mattvsjapan"><img src="https://img.shields.io/twitter/follow/mattvsjapan.svg"></a>
<a title="Follow us on Twitter" href="https://twitter.com/Migaku_Yoga"><img src="https://img.shields.io/badge/Twitter-Immerse%20with%20Yoga-blue"></a>
</p>

>Add readings and pitch accent to Japanese words in Anki
>Add readings and pitch accent information to Japanese words, allows playing audio when clicking a word, export pitch accent graphs, convert to katakana, or historical kanji and kana and much more!
### Table of Contents

- [Tutorial](https://massimmersionapproach.com/table-of-contents/anki/mia-japanese-addon)
- [Installation](#installation)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [License and Credits](#license-and-credits)

### Installation

1. Make sure you have the [latest version](https://apps.ankiweb.net/#download) of Anki 2.1 installed.
1. Install the version of Anki that is listed under the "Migaku Development Cycles" section of the AnkiWeb add-on [page](https://ankiweb.net/shared/info/278530045).
2. Download the latest version of the addon from [AnkiWeb](https://ankiweb.net/shared/info/278530045)

### Documentation
Expand All @@ -43,11 +39,11 @@ Contributions are welcome! Please review the [contribution guidelines](./.github

### License and Credits

*MIA Japanese* is
*Migaku Japanese* is

*Copyright © 2019 Mass Immersion Approach
*Copyright © 2020 Migaku ltd.

MIA Japanese is free and open-source software. The add-on code that runs within Anki is released under the GNU AGPLv3 license, extended by a number of additional terms. For more information please see the [LICENSE](https://github.com/mass-immersion-approach/MIA-Japanese-Add-on/blob/master/LICENSE) file that accompanied this program.
Migaku Japanese is free and open-source software. The add-on code that runs within Anki is released under the GNU AGPLv3 license, extended by a number of additional terms. For more information please see the [LICENSE](https://github.com/migaku-official/Migaku-Japanese-Addon/blob/master/LICENSE) file that accompanied this program.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.

Expand Down
6 changes: 3 additions & 3 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#Thanks to Damien Elmes, the MIA Japanese Add-on borrows lightly from his project.
#Thanks to Damien Elmes, the Migaku Japanese Add-on borrows lightly from his project.
#https://ankiweb.net/shared/info/3918629684
#
#Thanks to Asweigart, I use Pyperclip in this project
Expand All @@ -10,10 +10,10 @@
#
# This is a beta prototype release, when officially released a fully commented version of this project will be added and linked on GitHub
# The final release will also be organized into individual .py files by functionality.
# Yoga MIA
# Lucas - Migaku Founder

from . import models
from anki.hooks import addHook
addHook("profileLoaded", models.addModels)

from . import main
from . import main, migakuMessage
22 changes: 11 additions & 11 deletions src/autoCSSJSHandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ def __init__(self, mw, addon_path):
self.mw = mw
self.addon_path = addon_path
self.wrapperDict = False
self.jCssHeader = '/*###MIA JAPANESE SUPPORT CSS STARTS###\nDo Not Edit If Using Automatic CSS and JS Management*/'
self.jCssFooter = '/*###MIA JAPANESE SUPPORT CSS ENDS###*/'
self.jCssHeaderP = '\/\*###MIA JAPANESE SUPPORT CSS STARTS###\nDo Not Edit If Using Automatic CSS and JS Management\*\/'
self.jCssFooterP = '\/\*###MIA JAPANESE SUPPORT CSS ENDS###\*\/'
self.jHistHeader = '<!--###MIA JAPANESE SUPPORT CONVERTER JS START###\nDo Not Edit If Using Automatic CSS and JS Management-->'
self.jHistFooter = '<!--###MIA JAPANESE SUPPORT CONVERTER JS ENDS###-->'
self.jJSHeader = '<!--###MIA JAPANESE SUPPORT JS START###\nDo Not Edit If Using Automatic CSS and JS Management-->'
self.jJSFooter = '<!--###MIA JAPANESE SUPPORT JS ENDS###-->'
self.jKHeader = '<!--###MIA JAPANESE SUPPORT KATAKANA CONVERTER JS START###\nDo Not Edit If Using Automatic CSS and JS Management-->'
self.jKFooter = '<!--###MIA JAPANESE SUPPORT KATAKANA CONVERTER JS ENDS###-->'
self.jCssHeader = '/*###MIGAKU JAPANESE SUPPORT CSS STARTS###\nDo Not Edit If Using Automatic CSS and JS Management*/'
self.jCssFooter = '/*###MIGAKU JAPANESE SUPPORT CSS ENDS###*/'
self.jCssHeaderP = '\/\*###MIGAKU JAPANESE SUPPORT CSS STARTS###\nDo Not Edit If Using Automatic CSS and JS Management\*\/'
self.jCssFooterP = '\/\*###MIGAKU JAPANESE SUPPORT CSS ENDS###\*\/'
self.jHistHeader = '<!--###MIGAKU JAPANESE SUPPORT CONVERTER JS START###\nDo Not Edit If Using Automatic CSS and JS Management-->'
self.jHistFooter = '<!--###MIGAKU JAPANESE SUPPORT CONVERTER JS ENDS###-->'
self.jJSHeader = '<!--###MIGAKU JAPANESE SUPPORT JS START###\nDo Not Edit If Using Automatic CSS and JS Management-->'
self.jJSFooter = '<!--###MIGAKU JAPANESE SUPPORT JS ENDS###-->'
self.jKHeader = '<!--###MIGAKU JAPANESE SUPPORT KATAKANA CONVERTER JS START###\nDo Not Edit If Using Automatic CSS and JS Management-->'
self.jKFooter = '<!--###MIGAKU JAPANESE SUPPORT KATAKANA CONVERTER JS ENDS###-->'
self.formatJapaneseJS = self.getFormatJapaneseJS()
self.jFormattingFunctionsJS = self.getJFormattingFunctions()

Expand Down Expand Up @@ -349,7 +349,7 @@ def fieldConflictCheck(self, item, array, dType):
def getJapaneseCss(self):
config = self.getConfig()
pitchColors = config['ColorsHANOK']
css = '.museika{width:22px;height:22px;border-radius:50% ;border:1px #db4130 dashed}.j-mia-cont{display:inline-block;}.pitch-numbers{display:inline-block;position:relative;color:#000;font-size:10px;right:2px;padding:0 2px 8px 10px;bottom:7px;vertical-align:top;text-align:right}.thumb-hover:hover{cursor:pointer}.hovered-word{cursor:pointer}.unhovered-word .kanji-ruby{color:#000}.unhovered-word .kana-ruby{visibility:hidden}.unhovered-word.japanese-word{color:#000;background:0 0}.pitch-box{position:relative}.japanese-word{position:relative;display:inline-block}.kana-ruby{display:inline-block;text-align:justify!important}.pitch-accent-popup{box-shadow:2px 2px rgba(0,0,0,.6);position:absolute;display:none;z-index:10;background-color:#fff;border:1px solid #000;border-radius:5px;white-space:nowrap;padding:8px 0 0 4px;top:105%;left:-10%}.pitch-graph-container{position:relative;display:inline-block;top:25%}.pitch-box,.pitch-drop,.pitch-overbar{display:inline-block}.japanese-word .pitch-overbar{background-color:#000}.japanese-word .pitch-drop{background-color:#000}.pitch-overbar{background-color:red;height:2px;width:100%;position:absolute;top:-3px;left:0}.pitch-drop{background-color:red;height:6px;width:2px;position:absolute;top:-3px;right:-2px}.no-ruby{padding:2px 4px 2px 4px}.no-ruby-pitch{height:100%;width:100%;margin:auto;text-align:center;line-height:100%}.pitch-shape-box{padding:4px;display:inline-block;position:relative}.pitch-circle-box-right{display:inline-block;position:relative}.pitch-circle-box-left{padding-right:1.5px;display:inline-block;position:relative}.pitch-diamond{width:8px;height:8px;transform:rotate(45deg);display:inline-block;position:relative;bottom:2px}.left-pitch-circle,.right-pitch-circle{height:12px;width:6px;display:inline-block;position:relative}.right-pitch-circle{border-bottom-right-radius:12px;border-top-right-radius:12px}.left-pitch-circle{border-bottom-left-radius:12px;border-top-left-radius:12px}.pitch-shape-box .pitch-overbar{background-color:#000}.pitch-shape-box .pitch-drop{background-color:#000}.rubyMIA{display:inline-block;padding:0;margin:0;text-align:center}.rtMIA{padding:2px 0 0 0;margin:0;vertical-align:top;text-align:center;line-height:100%}.kana-ruby{position:relative;bottom:-1.5px;z-index:5}.kana-ruby1{font-size:10%}.kana-ruby2{font-size:20%}.kana-ruby3{font-size:30%}.kana-ruby4{font-size:40%}.kana-ruby5{font-size:50%}.kana-ruby6{font-size:60%}.kana-ruby7{font-size:70%}.kana-ruby8{font-size:80%}.kana-ruby9{font-size:90%}.kana-ruby10{font-size:100%}.rbMIA{display:inline-block;padding:0;margin:0}.wrapped-japanese{visibility:hidden}.ankidroid_dark_mode .pitch-box .pitch-drop,.ankidroid_dark_mode .pitch-box .pitch-overbar,.nightMode .pitch-box .pitch-drop,.nightMode .pitch-box .pitch-overbar,.night_mode .pitch-box .pitch-drop,.night_mode .pitch-box .pitch-overbar{background-color:#fff!important}.ankidroid_dark_mode .pitch-accent-popup,.nightMode .pitch-accent-popup,.night_mode .pitch-accent-popup{background-color:#000;border:1px solid #fff;box-shadow:2px 2px rgba(0,0,0,.2)}.ankidroid_dark_mode .unhovered-word .kana-ruby,.ankidroid_dark_mode .unhovered-word .kanji-ruby,.ankidroid_dark_mode .unhovered-word.japanese-word,.nightMode .unhovered-word .kana-ruby,.nightMode .unhovered-word .kanji-ruby,.nightMode .unhovered-word.japanese-word,.night_mode .unhovered-word .kana-ruby,.night_mode .unhovered-word .kanji-ruby,.night_mode .unhovered-word.japanese-word{color:#fff}.popup-comma{color:#000}.ankidroid_dark_mode .popup-comma,.nightMode .popup-comma,.night_mode .popup-comma{color:#fff}';
css = '.museika{width:22px;height:22px;border-radius:50% ;border:1px #db4130 dashed}.j-migaku-cont{display:inline-block;}.pitch-numbers{display:inline-block;position:relative;color:#000;font-size:10px;right:2px;padding:0 2px 8px 10px;bottom:7px;vertical-align:top;text-align:right}.thumb-hover:hover{cursor:pointer}.hovered-word{cursor:pointer}.unhovered-word .kanji-ruby{color:#000}.unhovered-word .kana-ruby{visibility:hidden}.unhovered-word.japanese-word{color:#000;background:0 0}.pitch-box{position:relative}.japanese-word{position:relative;display:inline-block}.kana-ruby{display:inline-block;text-align:justify!important}.pitch-accent-popup{box-shadow:2px 2px rgba(0,0,0,.6);position:absolute;display:none;z-index:10;background-color:#fff;border:1px solid #000;border-radius:5px;white-space:nowrap;padding:8px 0 0 4px;top:105%;left:-10%}.pitch-graph-container{position:relative;display:inline-block;top:25%}.pitch-box,.pitch-drop,.pitch-overbar{display:inline-block}.japanese-word .pitch-overbar{background-color:#000}.japanese-word .pitch-drop{background-color:#000}.pitch-overbar{background-color:red;height:2px;width:100%;position:absolute;top:-3px;left:0}.pitch-drop{background-color:red;height:6px;width:2px;position:absolute;top:-3px;right:-2px}.no-ruby{padding:2px 4px 2px 4px}.no-ruby-pitch{height:100%;width:100%;margin:auto;text-align:center;line-height:100%}.pitch-shape-box{padding:4px;display:inline-block;position:relative}.pitch-circle-box-right{display:inline-block;position:relative}.pitch-circle-box-left{padding-right:1.5px;display:inline-block;position:relative}.pitch-diamond{width:8px;height:8px;transform:rotate(45deg);display:inline-block;position:relative;bottom:2px}.left-pitch-circle,.right-pitch-circle{height:12px;width:6px;display:inline-block;position:relative}.right-pitch-circle{border-bottom-right-radius:12px;border-top-right-radius:12px}.left-pitch-circle{border-bottom-left-radius:12px;border-top-left-radius:12px}.pitch-shape-box .pitch-overbar{background-color:#000}.pitch-shape-box .pitch-drop{background-color:#000}.rubyMigaku{display:inline-block;padding:0;margin:0;text-align:center}.rtMigaku{padding:2px 0 0 0;margin:0;vertical-align:top;text-align:center;line-height:100%}.kana-ruby{position:relative;bottom:-1.5px;z-index:5}.kana-ruby1{font-size:10%}.kana-ruby2{font-size:20%}.kana-ruby3{font-size:30%}.kana-ruby4{font-size:40%}.kana-ruby5{font-size:50%}.kana-ruby6{font-size:60%}.kana-ruby7{font-size:70%}.kana-ruby8{font-size:80%}.kana-ruby9{font-size:90%}.kana-ruby10{font-size:100%}.rbMigaku{display:inline-block;padding:0;margin:0}.wrapped-japanese{visibility:hidden}.ankidroid_dark_mode .pitch-box .pitch-drop,.ankidroid_dark_mode .pitch-box .pitch-overbar,.nightMode .pitch-box .pitch-drop,.nightMode .pitch-box .pitch-overbar,.night_mode .pitch-box .pitch-drop,.night_mode .pitch-box .pitch-overbar{background-color:#fff!important}.ankidroid_dark_mode .pitch-accent-popup,.nightMode .pitch-accent-popup,.night_mode .pitch-accent-popup{background-color:#000;border:1px solid #fff;box-shadow:2px 2px rgba(0,0,0,.2)}.ankidroid_dark_mode .unhovered-word .kana-ruby,.ankidroid_dark_mode .unhovered-word .kanji-ruby,.ankidroid_dark_mode .unhovered-word.japanese-word,.nightMode .unhovered-word .kana-ruby,.nightMode .unhovered-word .kanji-ruby,.nightMode .unhovered-word.japanese-word,.night_mode .unhovered-word .kana-ruby,.night_mode .unhovered-word .kanji-ruby,.night_mode .unhovered-word.japanese-word{color:#fff}.popup-comma{color:#000}.ankidroid_dark_mode .popup-comma,.nightMode .popup-comma,.night_mode .popup-comma{color:#fff}';
hanok = ["heiban","atamadaka","nakadaka", "odaka", "kifuku"]
count = 0
for pitchColor in pitchColors:
Expand Down
8 changes: 4 additions & 4 deletions src/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Profiles" : ["all"],
"AddMIAJapaneseTemplate": "on",
"AddMigakuJapaneseTemplate": "on",
"LookAhead" : 25,
"FuriganaFontSize" : 4,
"BufferedOutput" : "off",
Expand All @@ -17,9 +17,9 @@
"AudioFields" : "Audio;overwrite",
"PlayAudioOnClick" : "on",
"ActiveFields": [
"coloredhover;all;MIA Japanese;Sentence;Expression;front",
"coloredkanjireading;all;MIA Japanese;Sentence;Expression;back",
"coloredhover;all;MIA Japanese;Sentence;Meaning;back"
"coloredhover;all;Migaku Japanese;Sentence;Expression;front",
"coloredkanjireading;all;Migaku Japanese;Sentence;Expression;back",
"coloredhover;all;Migaku Japanese;Sentence;Meaning;back"
]

}
2 changes: 1 addition & 1 deletion src/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ There are eight different display types: "kanji", "coloredkanji", "kanjireading"
The Profile Name can be set to "all" to function on all profiles.
The Side can be set to "front", "back", or "both".

*AddMIAJapaneseTemplate*: "on" or "off", tells the add-on whether to create the "MIA Japanese" note type or not.
*AddMigakuJapaneseTemplate*: "on" or "off", tells the add-on whether to create the "Migaku Japanese" note type or not.

*AudioFields*: "FieldName;ExportType(;delimiter)"
The Field Name can be set to any field in your collection, if that field exists on a particular card then the audio link(s) will automatically be exported to that field. If you set Field Name to "clipboard" the link to the audio file(s) will be copied to the clipboard.
Expand Down
Loading

0 comments on commit dd47ab9

Please sign in to comment.