Giter Club home page Giter Club logo

ankdown's Issues

Cloze support

Hi Ben:

I just added cloze feature, would you like to add into your project?

Thank you
Houcheng Lin

Option to change math separators

I can't change my vscode plugin (Markdown All in One) to work with the Math separator syntax which the script is using. In my opinion it should be possible to have a option that ankdown also works with $ and $$ by substitute it later in the process to \( \) and \[ \] with a regular expression.

When I have the time I would do a pull request. Would be nice to get your opinion about it.

Thank you for your work.

Images

I am using a lot of mnemonics for my flash cards and audio files. Does ankdown support them? And if yes, how would I add them to my flash cards?

UnicodeDecodeError

When importing the some flashcards with utf8 formatting this error occurs:

Traceback (most recent call last):
  File "c:\Users\Philip\Documents\GitHub\ankdown\ankdown\ankdown.py", line 389, in main
    cards_to_apkg(card_iterator, pkg_arg)
  File "c:\Users\Philip\Documents\GitHub\ankdown\ankdown\ankdown.py", line 340, in cards_to_apkg
    for card in cards:
  File "c:\Users\Philip\Documents\GitHub\ankdown\ankdown\ankdown.py", line 328, in cards_from_dir
    for card in produce_cards(os.path.join(parent_dir, fn)):
  File "c:\Users\Philip\Documents\GitHub\ankdown\ankdown\ankdown.py", line 301, in produce_cards
    for line in f:
  File "C:\Python36\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 3504: character maps to <undefined>

Changing line 297 in ankdown.py to

    with open(filename, "r", encoding="utf8") as f:

helps.

I thought though, that the default import in python is utf8. Should I do a pull request for this little bug?

Reloading decks overwrites css changes

First of all, thanks for this addon and your help with my image issue. PDF -> Markdown -> Anki is sooo much more fun to work with.

As I am often iterating on my cards, I have to reimport the decks multiple times (because I want to keep all the cards managed by ankdown and not risk overwriting changes done in anki itself).
However, everytime I reimport the decks, it overwrites my CSS changes to the Ankdown Card Type (I changed the font-size and the font itself as it was not really readable on my computer).

Is this a known issue?

Currently I just copy the affected CSS back into the card template once I reloaded the decks.

Image import is broken

Somehow we're now creating invalid apkgs when there are images. One problem is the relative paths change, but there's some deeper problem, because even when that's fixed we produce invalid archives.

Merge Ankidown and Ankdown

Hi,

it's a little bit unusual request but I recently found the project ankidown. It can work with more difficult templates but has maybe some problems in parsing the markdown that ankdown doesn't have. Would be great if we could join forces between all who want to have a great tool for importing markdown into Anki. Please check it out. Hope you don't take it offensive.

Images in Subfolders

From @jay-pee in #7 , copying here as it's a slightly different issue

When putting images in subfolders an error occurs:

Traceback (most recent call last):
  File "c:\Users\Philip\Documents\GitHub\ankdown\ankdown\ankdown.py", line 389, in main
    cards_to_apkg(card_iterator, pkg_arg)
  File "c:\Users\Philip\Documents\GitHub\ankdown\ankdown\ankdown.py", line 343, in cards_to_apkg
    copyfile(abspath, newpath) # This is inefficient but definitely works on all platforms.
  File "C:\Python36\lib\shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'assets/images/philly-magic-garden.jpg'

Maybe we have to create the folder before putting the image there with copyfile(abspath, newpath).
Or change the newpath variable.

Configuration file

There are a bunch of things that one might want to configure about this tool: custom CSS and math separators are two that have gotten pull requests recently, but I suspect there are others.

It would probably be nice if these options could be placed into configuration files. But I think you might also want to have different configurations for different decks, or even different files. So it might also be nice if all the configuration options could be passed as command line flags. I don't want to overengineer this, but there's probably a reasonably nice, future-proof solution in design space somewhere.

Tests

I should write some tests or something if I want anyone else to use this ever.

Order of processed markdown files seems random

Is there a way to control the order of cards that are added?
I currently use Markdown to write my lecture notes and then arrange them for the import. However, especially in math-heavy courses the ordering of the cards is quite important.

I just tested two md files with 2 cards each (1Test.md and 2Test.md). The order that the cards were added was random, first one card of md file 1, then two cards of file 2 and then the second card of file 1.
My Anki Setup is configured to ask the cards in the order they were added.

Feature Request: Github flavored markdown

I made a test deck to look if ankdown is converting everything properly.
After fixing the error in issue #24 and #7 it did work! :)

Actually not fully :P

My last card is about github flavored markdown:

# Github Flavored

%

**Syntax Higlighting**

```javascript
function fancyAlert(arg) {
  if(arg) {
    $.facebox({div:'#foo'})
  }
}
```


**Task List**

- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [ ] this is an incomplete item

**Tables**

| test | test2 | test3 | test4 | test5 |
|------|-------|-------|-------|-------|
| test | test2 | test3 | test4 | test5 |
| test | test2 | test3 | test4 | test5 |
| test | test2 | test3 | test4 | test5 |

**Strike through**

~~this~~

Ankdown doesn't support this fully. Her is a picture of the rendered version:

Capture

Would be nice to have this feature :)

Methods of correctly preserving card identity

Preserving card identity across edits is difficult: You can force the user to give each card a unique ID, or you can try to infer one, based either on card position, or on card contents. I wonder if you could do better by incorporating information from your existing anki decks (e.g. by interfacing with an anki plugin, or by reading the database directly). This is one of my major pain points with ankdown at the moment.

Installation instructions failing

Hi,

I've followed the instructions

but i still see:

MacBook-Pro:~ Documents$ ankdown
-bash: ankdown: command not found

after running the pip3 install...

The anki addon also won't work

PyYAML warnings are annoying

This project uses a PyYAML version that has a code execution vulnerability. Since the user is here assumed to be in complete control of any yaml input, I don't actually consider this a vulnerability in the project, but it should probably be dealt with anyway.

Improvement: Text after % field seperator

Hi there,

I've modified your code to allow for 11 fields, this is my basic card type (I don't have that many fields which I actually use for text, some work as toggles). Since it's quite hard to see which of the 11 % symbols belongs to which of the 11 fields it would be nice to put some text after the % symbol.

For instance:

Front

% Back:

Back

% Field 3:

Content of field 3.

etc.

Would there be a simple way to implement this?

README clarification

#20 pointed out that the README doesn't mention that this tool creates .apkg files; this should be fixed.

Cannot import the package in Anki after running Ankdown with method A

I follow the method A to create a package.

An error occurs when importing the package with the Anki import tool:

Selected file was not in UTF-8 format. Please see the importing section of the manual.

The directory specified after -r has only one file which is a copy-paste of the cards example from README.

Tried out on Anki 2.1.11-1 and Anki 2.1.13 (dev).

Is ankdown supposed to produce files in UTF-8 format? When I run file -i package I can see charset=binary, so the output I get from ankdown isn't UTF-8.

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.