Giter VIP home page Giter VIP logo

anki-addon-glossary's Introduction

anki-addon-glossary

Export an Anki desk as an Html Glossary

It is based on https://ankiweb.net/shared/info/2751403243

Install

copy the py file into Anki's add-on folder and restart Anki, or use the Anki's tools, Addons Browse & install menu. See here: https://ankiweb.net/shared/info/156019013

Usage

  1. File menu, Export. Choose Export deck as Html Glossary and choose the desk
  2. Save the file into Anki's media folder (on my Linux, this is Documents\Anki\User 1\collection.media)
  3. Open the file in a browser

Customization of the output

create a custom.css in the directory of the htm file.

For example, if you want that the first column will be the question and the second be the answer, use this custom.css file:

.Question{
    float: left;
 
}
.Answer{
    float: left;
 
}

anki-addon-glossary's People

Contributors

peterborkuti avatar skuzzzy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

skuzzzy srghma

anki-addon-glossary's Issues

Anki 2.1 update

Steps:
1: Put all files inside a folder anki-addon-glossary
2: Rename Export_html_glossary.py to __init__.py
3: Rename xrange() to range() for Python3
???: do any other code changes I've missed. #8
Profit: Upload this version to the plugins page as 2.1-compatible

Pictures aren't added from appdata

Hello,

what would i have to do to make sure my pictures are in html aswell?
They were pasted and are now saved in \appdata\anki2*user*\collection.media (nVersion 2.0.48)

unclosed HTML tags

Front template tags squish right, back template tags squish left.

After lagging on an export of my main deck, I tried it on canadian provinces Default::Flags of Canada https://ankiweb.net/shared/info/2104389644 and moved the export into collection.media for images #5
As I scroll down the page, everything gets squished off to one side because some tag isn't getting closed:


<div style='font-family: Arial; font-size: 15px;color:grey;'>
What is the name of this province/territory?<br><br>
{{Map}}

throws </div> sprinkles all over the templates

Should probably give a warning message like

Card contains unclosed HTML tag {{tag}}
Note type {{Note}} Card type {{type}} Note id {{nid}} Card id {{cid}}

XHTML is not valid

While the export happens in the XHTML namespace, the output is not valid! Since XHTML is XML, all attribute values must be quoted and all elements must be closed.

So, instead of:

<link type="text/css" rel="stylesheet" href="custom.css">
<div class=Card>...<div>

it should read:

<link type="text/css" rel="stylesheet" href="custom.css" />
<div class="Card">...</div>

This should be dead easy to fix. The alternative would be to have to output be HTML4 or HTML5, which, however, would be a shame, since there is not yet any Anki2XML export I found, and this is the closest to it. One can simply write an XSL-T, which would take the XHTML (it's XML!) and transform it to whatever format one wants.

Audio export functionality

It would be nice to have this script export the linked audio as a html audio element with player controls. For now I did this for the exported html by replacing embedded Anki audio elements [sound:colloquial] with following html with my text editor:

 <audio controls src="colloquial.mp3"></audio><br>

Thank's for this work. I used it for returning a vocabulary learning course word log as html http://saltio.la/stuff/vocab-log.

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.