From e0ff0f5cdc55989bcb904836af5626021758b84b Mon Sep 17 00:00:00 2001 From: David Thurstenson Date: Wed, 4 Jan 2017 17:01:47 -0600 Subject: [PATCH] Use JQuery to add .table to every table element in order to use Bootstrap table style. Add doccumentation about this change --- Vimwiki.wiki | 35 +++++++++++++++++++++++++++-------- html-template/index.html | 11 +++++++++++ 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/Vimwiki.wiki b/Vimwiki.wiki index fa89884..99456f2 100644 --- a/Vimwiki.wiki +++ b/Vimwiki.wiki @@ -1,10 +1,29 @@ = Vimwiki = == TODO == -* [ ] Commit to a repository +* [X] Commit to a repository * [ ] Setup remote to host * [ ] Setup remote to automatically `:VimwikiAll2HTML` after it's been pushed to +== Table tweaks == + +Tables without any styles are gross, so let's use the styles from Bootstrap. Problem is that Vimwiki doesn't provide a way to add a class to a table element, so we'll do it with JQuery: + +{{{class="prettyprint" + +}}} + +This adds `.table`, `.table-condensed`, and `.table-hover` classes to every table element in the whole document. Don't see why it should be any other way for the moment. + +=== References === + +http://stackoverflow.com/a/39897883 +http://www.w3schools.com/jquery/jquery_syntax.asp + == HTML Checkboxes == By default, there is no difference between how a non-checkbox list item, unchecked list item, and a checked list item are displayed when exported to HTML. @@ -13,13 +32,13 @@ There are 5 states of a checkbox, 0-4, and they each represent a different level Checkbox states: -| # | % Complete | li class | Unicode character | Escape sequence | HTML code | -|---|------------|----------|-------------------|-----------------|------------| -| 0 | 0% | `done0` | ◯ | `\u25EF` | `◯` | -| 1 | 1-33% | `done1` | ◔ | `\u25D4` | `◔` | -| 2 | 34-66% | `done2` | ◑ | `\u25D1` | `◑` | -| 3 | 67-99% | `done3` | ◕ | `\u25D5` | `◕` | -| 4 | 100% | `done4` | ✔ | `\u2714` | `✔` | +| State # | % Complete | li class | Unicode character | Escape sequence | HTML code | +|---------|------------|----------|-------------------|-----------------|------------| +| 0 | 0% | `done0` | ◯ | `\u25EF` | `◯` | +| 1 | 1-33% | `done1` | ◔ | `\u25D4` | `◔` | +| 2 | 34-66% | `done2` | ◑ | `\u25D1` | `◑` | +| 3 | 67-99% | `done3` | ◕ | `\u25D5` | `◕` | +| 4 | 100% | `done4` | ✔ | `\u2714` | `✔` | Now, in order to use these in our HTML, we just have to write a style for `ul li.doneX:before` in our header like so: diff --git a/html-template/index.html b/html-template/index.html index 078737e..bec1fd8 100644 --- a/html-template/index.html +++ b/html-template/index.html @@ -11,6 +11,8 @@ + + @@ -25,6 +27,13 @@ + + + + +