This project is a fork of
markdown-preview-enhanced, which is a popular Atom package for previewing markdown files.
Most of the code in this fork is inherited from the upstream repository and is thus courtesy of @shd101wyy and other contributors to
Litvis functionality has been designed and developed at giCentre by Jo Wood, Alexander Kachkaev and Jason Dykes. This research was in part supported by the EU under the EC Grant Agreement No. FP7-IP-608142 to Project VALCRI.
Please ensure that you have
run-elm installed on your machine before proceeding to the setup.
The following command will ensure that both of these tools are in place and are up-to-date.
npm install --global elm run-elm
If you don’t have npm, please download it as a part of Node.js from https://nodejs.org/.
Go to Preferences → Packages and disable
markdown-preview (Atom’s standard preview tool)
If you are using
markdown-preview-enhanced, temporary disable it too while you are trying out this fork.
Switch to Install section in Preferences and search for
Click Install and reload Atom.
apm disable markdown-preview markdown-preview-enhanced apm install markdown-preview-enhanced-with-litvis
Literate visualization uses Elm and Vega-Lite in the form of a declarative visualization language elm-vega. While you don't have to use elm-vega in a litvis document it does enable quick declarative generation of interactive data graphics and therefore considerably enhances the capability of a litvis document.
Creating your own litvis narrative is as easy as writing a markdown file. You can start with exploring the examples available at https://github.com/gicentre/litvis/tree/master/examples.
It is possible to automatically format litvis-enabled markdown files including embedded Elm code blocks with Prettier, which is an opinionated code formatting tool.
Prettier is available in Atom via
prettier-atom package, but it does not format literate Elm code blocks in markdown files out of the box.
Please follow these steps to enable full-featured formatting support for litvis in Atom:
Globally install Prettier and its Elm plugin via npm:
npm install --global github:kachkaev/prettier#fix-global-plugin-api-dist prettier-plugin-elm
github:kachkaev/prettier#...instead of just
prettieris necessary until prettier/prettier#4192 is merged.
prettier-atom package via Atom’s Preferences or from a command line:
apm install prettier-atom
Enable Format on save in
prettier-atom package preferences.
(optional) Configure Prettier globally by creating
~/.prettierrc with the following yaml:
overrides:- files: "*.md"options:tabWidth: 4
Doing this via bash:
echo -e "overrides:\n- files: \"*.md\"\n options:\n tabWidth: 4" > ~/.prettierrc
This will indent bullet point lists in markdowns with four spaces instead of two.
When a currently opened litvis narrative contains issues such as errors in Elm code blocks, you are automatically shown a list of problems via Atom's built-in linter.
If you have used Atom linting for any programming language before, all the necessary packages should be already installed.
Otherwise, please install packages called
apm install linter linter-ui-default intentions busy-signal
When you are working on branching litvis narratives or those depending on narrative schemas, you may benefit from going to
linter-ui-default settings and changing Panel Represents parameter to Entire project.
This will make the list of reported issues more informative.
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.