A smart nvalt Preview Theme.
- Github theme
- Github markdown support
- Font Awesome icons [fa-github]
- simple checkbox support ([] and [/])
- code highlighting
- User Story detection (As a user, I expect ...)
- LaTex-style math support through Mathjax
- Hyperlinks to other notes
- Sort table rows by click on column headers (using Stuart Langridge's sorttable.js)
- footnotes appear in-place, rendered with bigfoot.js
Instead of what is described below, I just did what is recommended as of today (Dec 2018) on highlight.js the website :
npm -g install highlight.js
It seems to be working fine (for the languages I use, at least), without needing to compile or build via bower/gulp. But I can't really be sure... It might be just a coincidence that the original highlight.js in the nvalt-prime happened to include some of the less popular languages that I have tried just to see (such as VBScript).
Anyhow, below are the original instructions that involve a build step from the original author...
- This extensions of nvALT prime has been compiled to include support for code highlighting in some extra languages such as Rust, Clojure, Swift, ... You might want to get a customised version of highlightjs that includes support for your favorite languages. You can configure and download such a version from their website and then substitute the "vanilla" library that bower imports for your custom one. Assuming you have downloaded the highlightjs.zip file to the
~/Downloads
folder, you can write
bower install
rm -rf bower_components/highlightjs/
mkdir bower_components/highlightjs
unzip ~/Downloads/highlightjs.zip -d bower_components/highlightjs
gulp
nvalt - nvALT is a fork of the original Notational Velocity with some additional features and some interface modifications.
In a terminal:
cd ~/Library/Application\ Support/
rm -rfi nvALT/
git clone --recursive https://github.com/dg2/nvalt-prime.git nvALT
No need to restart nvALT. The changes will be picked up the next time you switch notes. You can also right click on the preview window and click refresh. The recursive clone is required to include Mathjax
You can always restore the default just by deleting the files in ~/Library/Application Support/nvALT/
.
rm -rfi ~/Library/Application\ Support/nvALT
In a terminal:
cd ~/Library/Application\ Support/nvALT/
git pull
Just point ~/Library/Application Support/nvALT
to your local git repository.
cd [your project path]
git clone [email protected]:bawigga/nvalt-prime.git
rm -rfi ~/Library/Application\ Support/nvALT
ln -s /path/to/nvalt-prime/ ~/Library/Application\ Support/nvALT
No need to restart nvALT. The changes will be picked up the next time you switch notes. You can also right click on the preview window and click refresh.
Please share how/why you use nvALT! Submit a quick comment on issue #14
There are two types of checkboxes you can use:
[ ] - unchecked
[/] - checked
[ ] - checked @done
class SomeClass
def someMethod
end
end
[fa-github]
strikethrough: wrap text with ~~
For display mode, math formulae in LaTeX notation can be enclosed by \\(
and \\)
or \\[
\\]
. For inline mode, it can be enclosed by $$
and $$
.
For example, the following code will display the quadratic equation in the same line as the text, but the two expressions for its solution on separate lines.
The solutions of
$$ ax^2 + bx + c = 0 $$
are
\\(
x=\frac{-b + \sqrt{b^2-4ac\ }}{2a}.
\\)
and
\\[
x=\frac{-b - \sqrt{b^2-4ac\ }}{2a}.
\\]
\\[
\sum_{x=1}^\infty \frac{1}{x} = 1
\\]
Tables are automatically sortable: just click on the title to sort in ascending order, then click again to toggle between ascending and descending.
Name | Country | Height |
---|---|---|
Tom | England | 1.9m |
Bob | Scotland | 2.0m |
Sam | Ireland | 1.8m |
Footnotes are rendered using bigfoot.js, so that they appear as easy-to-click buttons 1; when the reader clicks on these, a popover appears. This means the reader can read the note in-place, without jumping around the page 2.
When printed, the buttons are replaced by the more traditional numbers in-situ cross referencing the full text of the notes at the end of the document. This means the notes can still be read without interactivity.