Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob committed Nov 21, 2016
2 parents 8b27955 + 6886c94 commit 20af571
Show file tree
Hide file tree
Showing 23 changed files with 4,864 additions and 578 deletions.
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,38 @@ The template is built in html and css, with [syntax highlighting](./dist/themes/
## Card Types
There are currently two types of card, a simple card and a puzzle card. Both share the `dist/themes/assets/css/main.css` file.

1. **[Simple](./dist/themes/README.md)**
1. **[Simple](./dist/themes/simple/README.md)**
- What's the answer?
- What does this syntax do?
2. **[Puzzle](./dist/themes/README.md#puzzle-theme)**
2. **[Puzzle](./dist/themes/puzzle/README.md)**
- What's the answer?
- **+** Puzzle question
3. **[Cloze](./dist/themes/cloze/README.md)**
- Freeform show/hide question/answer


## Anki syntax highlighting with Markdown

- **[Anki syntax highlighting and themes](./dist/themes/assets/css/README.md)**

Basic syntax highlighting can be acheived simply by wrapping `<code>` with html tags, such as `<b>`, `<i>`. This works nicely with Anki's editor buttons for quick code blocks or inline code. The included *Monokai* and * and *Tomorrow light* themes can be easily customised with [`less`](http://lesscss.org).
Basic syntax highlighting can be acheived simply by wrapping `<code>` with html tags, such as `<b>`, `<i>`. This works nicely with Anki's editor buttons for quick code blocks or inline code. The included *Monokai* and *Tomorrow light* themes can be easily customised with [`less`](http://lesscss.org).

If you like living life on the edge, I've also included the amazing **highlight.js** for full Markdown syntax highlighting. Currently stable on iPhone, so if you're on Android or a js wizzard [please give me a shout](https://github.com/badlydrawnrob/anki/issues/6).
If you like pretty code blocks, you're in luck: our themes now work with [Pygments](http://pygments.org/); you'll need [a plugin](https://ankiweb.net/shared/info/162313389), unless you're willing to get your hands dirty with terminal. Power Format Pack has really sped up my workflow,

There's some nice default colour schemes; some fields are automatically wrapped in `<code>` so all you need to do is add the symbol, class or function. The main `(code blocks ..)` need to be wrapped in `<pre><code>`. See [fields documentation](./dist/themes/README.md) for more details.

There's some nice default colour schemes; some fields are automatically wrapped in `<code>` so all you need to do is add the symbol, class or function. The main `(code blocks ..)` need to be wrapped in `<pre><code>`. See [fields documentation](./dist/themes/README.md) for more details

#### Why use Anki Themes instead of an Anki plugin?

***Because it's plain `html`!***
> ***Practicality beats purity***
>
> Ideally, we'd use [highlight.js](https://highlightjs.org/) or one of the many javascript syntax highlighters out there. In practice, however, it's proved far too difficult to make this happen with Anki, so Pygments is a far more pragmatic solution.
There's a few Anki syntax highlighting plugins around, but as far I'm aware these all involve solutions like [Pygments](http://pygments.org). Call me old fashioned, but cramming your code with `spans` or inline css feels icky to me.
There's a few Anki syntax highlighting plugins around — call me old fashioned, but cramming your code with inline css feels icky to me. With **Anki themes**, you use a pure(ish) `Markdown > HTML` workflow and *easily customisable* css. It works on all platforms, too: [AnkiMobile](http://ankisrs.net/docs/AnkiMobile.html), MacOS and [Android](https://github.com/ankidroid/Anki-Android).

With **Anki themes**, you use a pure html/Markdown/js workflow and *easily customisable* css. If *highlight.js* dies tomorrow, I can swap it out for another javascript alternative. Granted, it currently works best on mobile, but I use [AnkiMobile](http://ankisrs.net/docs/AnkiMobile.html) 90% of the time anyway!
***Power format pack*** is a solid Markdown plugin for Anki — it compliments *Anki themes* and makes for a nice workflow. If you prefer using stock Anki, [see these notes](./dist/themes/assets/css/README.md#automatic-syntax-highlighting-with-pygments). I generally prefer to use supported, well documented, stable software wherever possible — minus the plugins — but **PFP** really speeds things up.

Having ditched Wordpress for [Craft](https://craftcms.com), I'm also skeptical of plugins and try to use supported, well documented, stable software wherever possible<sup>**[2](#other-notes)**</sup>.
If ever Anki allows external javascript files, I can swap Pygments out for another alternative like _highlight.js_.


## Notes
Expand All @@ -51,13 +56,12 @@ Not sure what all the fuss is about Anki? Some great reading material below ...
- [Anki essentials](http://alexvermeer.com/anki-essentials/)
- [Janki method](http://www.jackkinsella.ie/2011/12/05/janki-method.html)

### Versioning
### Installation

This is a major overhaul from the original, so it's not compatible with earlier versions. In future I'll try to stick to **minor.major.patch** [semantic versioning](http://semver.org), so updates don't break existing cards. Unfortunately Anki makes this tricky, so view commits for any major changes to the theme. [Follow the instructions](./dist/deck/README.md) for the easiest way to test the [.apkg package](./dist/deck) before updating future versions.
This is a major overhaul from the original (pre-beta), so it's not compatible with earlier versions. In future I'll try to stick to **major.minor.patch** [semantic versioning](http://semver.org), so updates don't break existing cards. Unfortunately Anki makes this tricky, so view commits for any major changes to the theme. [Follow the instructions](./dist/deck/README.md) for the easiest way to test the [.apkg package](./dist/deck) before updating future versions.

<!-- NOTES -->

### Other notes

1. Icons courtesy of [@kompa](http://devicon.fr)
2. I'm no luddite, the popular [Power format pack](https://ankiweb.net/shared/info/162313389) could complement Anki themes and make for a nice workflow. I generally work with Sublime/Atom and render html with Marked App but this plugin could save you some hassle.
20 changes: 10 additions & 10 deletions config.codekit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit",
"creatorBuild": "19115",
"creatorBuild": "19137",
"files": {
"\/preview.png": {
"fileType": 32768,
Expand Down Expand Up @@ -164,16 +164,16 @@
"strictMath": 0,
"strictUnits": 0
},
"\/src\/assets\/less\/theme\/highlight.less": {
"\/src\/assets\/less\/theme\/pre.less": {
"allowInsecureImports": 0,
"createSourceMap": 0,
"disableJavascript": 0,
"fileType": 1,
"ieCompatibility": 1,
"ignore": 1,
"ignoreWasSetByUser": 0,
"inputAbbreviatedPath": "\/src\/assets\/less\/theme\/highlight.less",
"outputAbbreviatedPath": "\/src\/assets\/less\/css\/highlight.css",
"inputAbbreviatedPath": "\/src\/assets\/less\/theme\/pre.less",
"outputAbbreviatedPath": "\/src\/assets\/less\/css\/pre.css",
"outputPathIsOutsideProject": 0,
"outputPathIsSetByUser": 0,
"outputStyle": 0,
Expand All @@ -184,16 +184,16 @@
"strictMath": 0,
"strictUnits": 0
},
"\/src\/assets\/less\/theme\/pre.less": {
"\/src\/assets\/less\/theme\/puzzle.less": {
"allowInsecureImports": 0,
"createSourceMap": 0,
"disableJavascript": 0,
"fileType": 1,
"ieCompatibility": 1,
"ignore": 1,
"ignoreWasSetByUser": 0,
"inputAbbreviatedPath": "\/src\/assets\/less\/theme\/pre.less",
"outputAbbreviatedPath": "\/src\/assets\/less\/css\/pre.css",
"inputAbbreviatedPath": "\/src\/assets\/less\/theme\/puzzle.less",
"outputAbbreviatedPath": "\/src\/assets\/less\/css\/puzzle.css",
"outputPathIsOutsideProject": 0,
"outputPathIsSetByUser": 0,
"outputStyle": 0,
Expand All @@ -204,16 +204,16 @@
"strictMath": 0,
"strictUnits": 0
},
"\/src\/assets\/less\/theme\/puzzle.less": {
"\/src\/assets\/less\/theme\/pygments.less": {
"allowInsecureImports": 0,
"createSourceMap": 0,
"disableJavascript": 0,
"fileType": 1,
"ieCompatibility": 1,
"ignore": 1,
"ignoreWasSetByUser": 0,
"inputAbbreviatedPath": "\/src\/assets\/less\/theme\/puzzle.less",
"outputAbbreviatedPath": "\/src\/assets\/less\/css\/puzzle.css",
"inputAbbreviatedPath": "\/src\/assets\/less\/theme\/pygments.less",
"outputAbbreviatedPath": "\/src\/assets\/less\/css\/pygments.css",
"outputPathIsOutsideProject": 0,
"outputPathIsSetByUser": 0,
"outputStyle": 0,
Expand Down
Loading

0 comments on commit 20af571

Please sign in to comment.