Giter Site home page Giter Site logo

mauville / ankidroid-card-preview Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 2.11 MB

Preview and edit AnkiDroid cards in your desktop browser.

License: GNU General Public License v3.0

CSS 45.96% JavaScript 25.51% HTML 28.53%
anki ankidroid designing cards mobile css

ankidroid-card-preview's Introduction

AnkiDroid Card Style Previewer

auto auto

Usage

This is a template that tries to recreate the behaviour of how AnkiDroid displays cards. Use it to design beautiful cards for mobile.

  1. Get the latest release and edit away using your favourite editor.

  2. Once you finish, copy the HTML, CSS and scripts to Anki.

  3. Replace tag content with Anki {{fields}}.

  4. That’s it! 🎉

Unfortunately, you can only preview cards correctly in Chrome/Chromium based browsers, as AnkiDroid uses Chrome Web View to display cards.
You can use placeholder images in this template. Place all of them on the same folder as the main HTML file. However, in practice, all of the files should come from your collection.media directory, using the {{field}} notation.

I also ask of you, that if you use this template to design your cards, to include the header in the CSS file in your final Anki styles deck.

Explanation

I wanted to design good-looking cards for AnkiDroid but the debugging and previewing process was a mess. I had to sync every time I wanted to see how the cards looked and that process took ages.

Since Anki and AnkiDroid both use Chrome WebView to display cards, I decided to create an file structure similar to that of those to easily preview cards and modify as you would with any other HTML page.

In short, instead of designing cards inside Anki lousy Cards screen, you can design cards as if it were just another webpage and then copy your code to Anki.

Convenient mobile card designing advice included!

demo

Live Preview

You can also use the debugging tools on Android to change the card CSS directly.

  1. Enable HTML/Javascript debugging in Advanced Preferences.

  2. Enable Developer Options and USB Debugging in Android setings

  3. Connect your device to your computer and enable debugging in your phone.

  4. Using Chrome on the same computer open chrome://inspect and you should see your device name. Click on it and Inspect the WebView and you’ll get a full Chrome remote debugging console.

Contributing

Spot a mistake? Have a something nice you want to implement?
Open an issue and let me know.
Feel free to fork the code and make a Pull Request!

License

GPL 3.0
Example SVG from KanjiVG

ankidroid-card-preview's People

Contributors

mauville avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ankidroid-card-preview's Issues

Update README for Ankidroid 2.9

Ankidroid 2.9 reduces the pain of enabling a remote WebView debugging session. Instead of installing a beta, now it's just a checkbox.

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.