Giter Site home page Giter Site logo

inka's People

Contributors

dependabot[bot] avatar prurph avatar salkirr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

inka's Issues

Using asciimath in cards

This may be not directly related to inka, but it involves the libraries that it uses. I will appreciate any guidance on how to debug this or/and peek into the process of converting markdown into Anki cards.

I would like to write some math formulas using Asciimath inside cards, but don't know how to do it.

Here are the examples of writing cards using asciimath notation, with $ overridden in card's definition (according to template below)

    1. Матрицу $a$ на {{c1::вектор}} ответов $x$ и получить $b$ $f^'(x) >= 0$
  • $f'(x) = lim_(x->0) (f(x + Delta (x))-f(x)) / (delta x)$

Here is the modified template that I use for Inka Cloze cards

        <script type="text/x-mathjax-config">
            MathJax.Hub.Config({
                jax: ['input/AsciiMath'],
                extensions: ['asciimath2jax.js'],
                tex2jax: {
                <!--inlineMath: [["$","$"],["\\(","\\)"]],-->
                <!--displayMath: [['$$','$$'], ["\\[","\\]"]]-->
                },
                asciimath2jax: {
                    delimiters: [['$','$'], ['`','`']]
                }
                });
        </script>

        <script type="text/javascript" src=></script>

<script type="text/javascript">
(function() {
  if (window.MathJax != null) {
    var card = document.querySelector('.card');
    MathJax.Hub.Queue(['Typeset', MathJax.Hub, card]);
    return;
  }
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = "http://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-MML-AM_CHTML-full";
  document.body.appendChild(script);
})();
</script>

{{cloze:Text}}

Thanks!

Allow customization of delimiter strings

It would be nice to be able to use something else than --- as cards delimiters.
For example, I think it would be more elegant to have something like

```inka
<card contents>
```

Sometimes this is a matter of preference, but it would be very useful if you want to embed Anki cards in file with some potentially conflicting content, or if someone already has notes made with another parser in mind.

Need Mathjax Block support on Front/Back notes

Hello, thanks for the project!

I tried Mathjax block in front/back notes and saw Anki desktop didn't render the right symbols:

In the markdown I wrote:

1. MathTest1

> $X^{2}$

2. MathTest2

> $$
> X^{2}
> $$

Anki desktop rendered MathTest1 rightly, the Back textbox of the Anki Browse showed the following content:

\(X^{2}\)

As with MathTest2, Anki desktop showed X^{2} with this block on the textbox:

\(\)

X^{2}

\(\)

After I modified the textbox as follows, Anki rendered it rightly:

\(
x^{2}
\)

By the way, this is a very good tool!

Should each answer line start with >?

Hi,
In the documentation it is stated that answers start by >, but should each new line in the answer contain > as a start. To be more clear is the following answer accepted?

  1. Question

">" Answer
New line of answer

Or it should be like this?

  1. Question

">" Answer
">" New line of answer

Note: the quotes around > are just to prevent it of acting as blockquotes.

Error running inka (Windows)

I don't know if it's a supported scenario to run inka under Windows.

Python 3.9 x64, Windows 10 x64, Anki 2.1.49, aqt 2.1.49. Is there a way to somehow validate my setup?

I use default inka configuration, here is the card that I want to "collect"

---

Deck: Life Questions

Tags: learning life-questions

1. What is the answer to the Ultimate Question of Life, the Universe, and Everything?

> 42

2. If it {looks like a duck, swims like a duck, and quacks like a duck}, then it is a {duck}.

---

Here is the error that I get, it's the bottom of full logs pasted below: TypeError: save() takes from 1 to 2 positional arguments but 3 were given

Full logs:

:: Getting profile...
:: Loading profile...
:: Getting changes from AnkiWeb...
   Isn't authenticated with AnkiWeb. Skipping...
:: Checking note types...
inka\models\anki_api.py:209:'byName' is deprecated: please use 'by_name'
inka\models\anki_api.py:209:'byName' is deprecated: please use 'by_name'
┌───────────────────── Traceback (most recent call last) ─────────────────────┐
│                                                                             │
│ C:\Python39\lib\runpy.py:197 in _run_module_as_main                         │
│                                                                             │
│   194 │   main_globals = sys.modules["__main__"].__dict__                   │
│   195 │   if alter_argv:                                                    │
│   196 │   │   sys.argv[0] = mod_spec.origin                                 │
│ > 197 │   return _run_code(code, main_globals, None,                        │
│   198 │   │   │   │   │    "__main__", mod_spec)                            │
│   199                                                                       │
│   200 def run_module(mod_name, init_globals=None,                           │
│ C:\Python39\lib\runpy.py:87 in _run_code                                    │
│                                                                             │
│    84 │   │   │   │   │      __loader__ = loader,                           │
│    85 │   │   │   │   │      __package__ = pkg_name,                        │
│    86 │   │   │   │   │      __spec__ = mod_spec)                           │
│ >  87 │   exec(code, run_globals)                                           │
│    88 │   return run_globals                                                │
│    89                                                                       │
│    90 def _run_module_code(code, init_globals=None,                         │
│                                                                             │
│ C:\Python39\Scripts\inka.exe\__main__.py:7 in <module>                      │
│                                                                             │
│ [Errno 2] No such file or directory:                                        │
│ 'C:\\Python39\\Scripts\\inka.exe\\__main__.py'                              │
│                                                                             │
│ C:\Python39\lib\site-packages\click\core.py:1128 in __call__                │
│                                                                             │
│   1125 │                                                                    │
│   1126 │   def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any:      │
│   1127 │   │   """Alias for :meth:`main`."""                                │
│ > 1128 │   │   return self.main(*args, **kwargs)                            │
│   1129                                                                      │
│   1130                                                                      │
│   1131 class Command(BaseCommand):                                          │
│                                                                             │
│ C:\Python39\lib\site-packages\click\core.py:1053 in main                    │
│                                                                             │
│   1050 │   │   try:                                                         │
│   1051 │   │   │   try:                                                     │
│   1052 │   │   │   │   with self.make_context(prog_name, args, **extra) as  │
│ > 1053 │   │   │   │   │   rv = self.invoke(ctx)                            │
│   1054 │   │   │   │   │   if not standalone_mode:                          │
│   1055 │   │   │   │   │   │   return rv                                    │
│   1056 │   │   │   │   │   # it's not safe to `ctx.exit(rv)` here!          │
│                                                                             │
│ C:\Python39\lib\site-packages\click\core.py:1659 in invoke                  │
│                                                                             │
│   1656 │   │   │   │   super().invoke(ctx)                                  │
│   1657 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ct │
│   1658 │   │   │   │   with sub_ctx:                                        │
│ > 1659 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(su │
│   1660 │   │                                                                │
│   1661 │   │   # In chain mode we create the contexts step by step, but aft │
│   1662 │   │   # base command has been invoked.  Because at that point we d │
│                                                                             │
│ C:\Python39\lib\site-packages\click\core.py:1395 in invoke                  │
│                                                                             │
│   1392 │   │   │   echo(style(message, fg="red"), err=True)                 │
│   1393 │   │                                                                │
│   1394 │   │   if self.callback is not None:                                │
│ > 1395 │   │   │   return ctx.invoke(self.callback, **ctx.params)           │
│   1396 │                                                                    │
│   1397 │   def shell_complete(self, ctx: Context, incomplete: str) -> t.Lis │
│   1398 │   │   """Return a list of completions for the incomplete value. Lo │
│                                                                             │
│ C:\Python39\lib\site-packages\click\core.py:754 in invoke                   │
│                                                                             │
│    751 │   │                                                                │
│    752 │   │   with augment_usage_errors(__self):                           │
│    753 │   │   │   with ctx:                                                │
│ >  754 │   │   │   │   return __callback(*args, **kwargs)                   │
│    755 │                                                                    │
│    756 │   def forward(                                                     │
│    757 │   │   __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any  # n │
│                                                                             │
│ C:\Python39\lib\site-packages\inka\cli.py:540 in collect                    │
│                                                                             │
│   537 │                                                                     │
│   538 │   # Check correctness of note types                                 │
│   539 │   anki_media = AnkiMedia(profile, anki_path)                        │
│ > 540 │   check_note_types(anki_media, anki_api)                            │
│   541 │                                                                     │
│   542 │   # Get paths to all files                                          │
│   543 │   print_action("Searching Markdown files...")                       │
│                                                                             │
│ C:\Python39\lib\site-packages\inka\cli.py:294 in check_note_types           │
│                                                                             │
│   291 │   print_action("Checking note types...")                            │
│   292 │   try:                                                              │
│   293 │   │   handle_note_types(anki_api)                                   │
│ > 294 │   │   handle_code_highlight(anki_api, anki_media)                   │
│   295 │   except KeyError:                                                  │
│   296 │   │   print_error(                                                  │
│   297 │   │   │   'your config file is corrupted. Please reset its state wi │
│                                                                             │
│ C:\Python39\lib\site-packages\inka\cli.py:195 in handle_code_highlight      │
│                                                                             │
│   192                                                                       │
│   193 def handle_code_highlight(anki_api: AnkiApi, anki_media: AnkiMedia) - │
│   194 │   for note_type in (BasicNote, ClozeNote):                          │
│ > 195 │   │   highlighter.add_code_highlight_to(                            │
│   196 │   │   │   note_type,  # type: ignore                                │
│   197 │   │   │   CONFIG.get_option_value("highlight", "style"),            │
│   198 │   │   │   anki_api,                                                 │
│                                                                             │
│ C:\Python39\lib\site-packages\inka\models\highlighter.py:47 in              │
│ add_code_highlight_to                                                       │
│                                                                             │
│    44 │   │   ConnectionError: if something gone wrong during download of h │
│    45 │   """                                                               │
│    46 │   try:                                                              │
│ >  47 │   │   _update_style_in(note_type, style_name, anki_api)             │
│    48 │   except HTTPError as e:                                            │
│    49 │   │   raise HighlighterError(                                       │
│    50 │   │   │   f"couldn't download styles for code highlighting. Reason: │
│                                                                             │
│ C:\Python39\lib\site-packages\inka\models\highlighter.py:109 in             │
│ _update_style_in                                                            │
│                                                                             │
│   106 │   end = "/*END*/"                                                   │
│   107 │   new_styles = f"{current_styles}\n{start}\n{new_highlight_style}\n │
│   108 │                                                                     │
│ > 109 │   anki_api.update_note_type_styling(note_type, new_styles)          │
│   110                                                                       │
│   111                                                                       │
│   112 def _handle_highlighjs_files_for(                                     │
│                                                                             │
│ C:\Python39\lib\site-packages\inka\models\anki_api.py:167 in                │
│ update_note_type_styling                                                    │
│                                                                             │
│   164 │   │   """Update styling of the note type in Anki"""                 │
│   165 │   │   anki_model = self._get_model(note_type)                       │
│   166 │   │   anki_model["css"] = new_styles                                │
│ > 167 │   │   self._collection.models.save(anki_model, True)                │
│   168 │                                                                     │
│   169 │   def fetch_note_type_templates(                                    │
│   170 │   │   self, note_type: Type[Note]                                   │
└─────────────────────────────────────────────────────────────────────────────┘
TypeError: save() takes from 1 to 2 positional arguments but 3 were given

`test_highlight.py` reference undefined fixtures


============================= test session starts =============================
platform win32 -- Python 3.9.10, pytest-7.0.0, pluggy-1.0.0
rootdir: C:\git-archive\repos\keiqu\inka
collected 14 items

test_highlight.py EEEEEEEEEEEEEE                                         [100%]

=================================== ERRORS ====================================
_ ERROR at setup of test_update_style_in_note_type_when_style_is_empty_string_raises_error _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 21
  def test_update_style_in_note_type_when_style_is_empty_string_raises_error(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_update_style_in_note_type_uses_anki_api_to_get_current_style _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 30
  def test_update_style_in_note_type_uses_anki_api_to_get_current_style(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_update_style_in_note_type_uses_requests_to_download_style _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 43
  def test_update_style_in_note_type_uses_requests_to_download_style(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_update_style_in_note_type_skips_when_same_style_already_exists _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 58
  def test_update_style_in_note_type_skips_when_same_style_already_exists(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_update_style_in_note_type_when_incorrect_style_requested_raises_error _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 74
  def test_update_style_in_note_type_when_incorrect_style_requested_raises_error(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_update_style_in_note_type_when_no_highlight_style_generates_new_with_one _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 85
  def test_update_style_in_note_type_when_no_highlight_style_generates_new_with_one(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_update_style_in_note_type_when_exists_different_highlight_style_replaces_it _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 104
  def test_update_style_in_note_type_when_exists_different_highlight_style_replaces_it(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_handle_highlighjs_script_when_no_script_in_anki_media_downloads_one _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 128
  def test_handle_highlighjs_script_when_no_script_in_anki_media_downloads_one(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_handle_highlighjs_script_when_script_exists_in_anki_media_does_not_download_one _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 144
  def test_handle_highlighjs_script_when_script_exists_in_anki_media_does_not_download_one(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_handle_highlighjs_script_adds_scripts_to_front_and_back_of_note_type _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 157
  def test_handle_highlighjs_script_adds_scripts_to_front_and_back_of_note_type(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_handle_highlighjs_script_when_front_of_note_type_has_scripts_does_not_add_more_to_it _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 186
  def test_handle_highlighjs_script_when_front_of_note_type_has_scripts_does_not_add_more_to_it(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_handle_highlighjs_script_when_back_of_note_type_has_scripts_does_not_add_more_to_it _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 216
  def test_handle_highlighjs_script_when_back_of_note_type_has_scripts_does_not_add_more_to_it(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_handle_highlighjs_script_if_fields_have_not_change_no_update_request_sent _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 239
  def test_handle_highlighjs_script_if_fields_have_not_change_no_update_request_sent(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
_ ERROR at setup of test_handle_highlighjs_script_adds_scripts_to_multiple_templates _
file C:\git-archive\repos\keiqu\inka\tests\test_highlight.py, line 259
  def test_handle_highlighjs_script_adds_scripts_to_multiple_templates(
file C:\git-archive\repos\keiqu\inka\tests\conftest.py, line 47
  @pytest.fixture
  def anki_api_mock(mocker) -> MagicMock:
E       fixture 'mocker' not found
>       available fixtures: anki_api_mock, anki_media, anki_media_mock, another_image, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, config, config_path, default_styles, doctest_namespace, fake_parser, image, image_anki, monkeypatch, path_to_anki_image, path_to_another_anki_image, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

C:\git-archive\repos\keiqu\inka\tests\conftest.py:47
=========================== short test summary info ===========================
ERROR test_highlight.py::test_update_style_in_note_type_when_style_is_empty_string_raises_error
ERROR test_highlight.py::test_update_style_in_note_type_uses_anki_api_to_get_current_style
ERROR test_highlight.py::test_update_style_in_note_type_uses_requests_to_download_style
ERROR test_highlight.py::test_update_style_in_note_type_skips_when_same_style_already_exists
ERROR test_highlight.py::test_update_style_in_note_type_when_incorrect_style_requested_raises_error
ERROR test_highlight.py::test_update_style_in_note_type_when_no_highlight_style_generates_new_with_one
ERROR test_highlight.py::test_update_style_in_note_type_when_exists_different_highlight_style_replaces_it
ERROR test_highlight.py::test_handle_highlighjs_script_when_no_script_in_anki_media_downloads_one
ERROR test_highlight.py::test_handle_highlighjs_script_when_script_exists_in_anki_media_does_not_download_one
ERROR test_highlight.py::test_handle_highlighjs_script_adds_scripts_to_front_and_back_of_note_type
ERROR test_highlight.py::test_handle_highlighjs_script_when_front_of_note_type_has_scripts_does_not_add_more_to_it
ERROR test_highlight.py::test_handle_highlighjs_script_when_back_of_note_type_has_scripts_does_not_add_more_to_it
ERROR test_highlight.py::test_handle_highlighjs_script_if_fields_have_not_change_no_update_request_sent
ERROR test_highlight.py::test_handle_highlighjs_script_adds_scripts_to_multiple_templates
============================= 14 errors in 0.11s ==============================

Anki has stopped working because of an outdated PyQt version

Hi! Thank you for the inka!

Unfortunately, I encountered an issue while using qt 6.5.0-3 on Arch Linux.

When I tried using Release 2.2.2, I received a QT error:

$ anki
Running with temporary Qt5 compatibility shims.
Run with DISABLE_QT5_COMPAT=1 to confirm compatibility with Qt6.
Traceback (most recent call last):
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/bin/anki", line 5, in <module>
    from aqt import run
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/aqt/__init__.py", line 46, in <module>
    from aqt import gui_hooks
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/aqt/gui_hooks.py", line 11, in <module>
    from _aqt.hooks import *
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/_aqt/hooks.py", line 18, in <module>
    from aqt.qt import QDialog, QEvent, QMenu, QModelIndex, QWidget, QMimeData
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/aqt/qt/__init__.py", line 20, in <module>
    from . import qt5_compat  # needs to be imported first
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/aqt/qt/qt5_compat.py", line 18, in <module>
    import PyQt6.QtNetwork
ImportError: /home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/PyQt6/QtNetwork.abi3.so: undefined symbol: _ZN16QNetworkDatagram7destroyEP23QNetworkDatagramPrivate, version Qt_6
$ DISABLE_QT5_COMPAT=1 anki
Traceback (most recent call last):
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/bin/anki", line 5, in <module>
    from aqt import run
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/aqt/__init__.py", line 46, in <module>
    from aqt import gui_hooks
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/aqt/gui_hooks.py", line 11, in <module>
    from _aqt.hooks import *
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/_aqt/hooks.py", line 18, in <module>
    from aqt.qt import QDialog, QEvent, QMenu, QModelIndex, QWidget, QMimeData
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/aqt/qt/__init__.py", line 21, in <module>
    from .qt6 import *
  File "/home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/aqt/qt/qt6.py", line 16, in <module>
    from PyQt6.QtNetwork import QLocalServer, QLocalSocket, QNetworkProxy
ImportError: /home/dl2718/.local/share/pyenv/versions/pyenvx-inka/lib/python3.10/site-packages/PyQt6/QtNetwork.abi3.so: undefined symbol: _ZN16QNetworkDatagram7destroyEP23QNetworkDatagramPrivate, version Qt_6

Do you think it would be helpful to update the release version with the latest versions of PyQt6 and PyQt6-WebEngine (6.5.0)?

Feature request: support for Asciidoc as a source

Could you consider implementing it?

If not, could you draft what is needed for it, i.e. how hard it is to do.

I hope that right now it is about converting markdown into html with some magic around 'cloze' expressions (to generate multiple cards). I'm pretty sure there is more to it, would be great to learn the key points of transformation.

Right now I use asciidoctor + pandoc (docbook as intermediary format). It works, but it makes editing source notes a bit complicated.

But, even with this approach I get remarkable results.

Thank you for Inka!

Support Cloze Deletions

Hi,
Thank you for building this!
This is really not an issue, but a feature request. Supporting cloze deletions will be awesome.
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.