Ever wanted to easily preview what your markdown would look like exactly on Github? Ever wanted to do that from inside of a Terminal? Well this Gem is for you. Dead simple. Never get caught writing ugly markdown again.
Octodown uses the same parsers and CSS that Github uses for their markdown rendering. Github markdown styling looks beautiful, so it is Octodown's primary goal to reproduce it as faithfully as possible.
-
Uses the same markdown parsers and CSS as Github for true duplication.
- Yes emojis are included. 😈
-
Fast.
octodown
uses native parsers to ensure performance. -
Multiple CSS styles.
octodown --style atom README.md
- The
--github
markdown (default) - The
--atom
text editor markdown
-
Properly parses
STDIN
.cat README.md | octodown
- Install
icu4c
andcmake
:
- Mac:
brew install icu4c cmake pkg-config
- Apt:
sudo apt-get install -y libicu-dev cmake pkg-config
- Install octodown:
- If you have a non-system Ruby (highly recommended):
gem install octodown
- Else:
sudo gem install octodown
- Install in VIM (optional):
-
Use Dispatch and add this to your ~/.vimrc:
" Use octodown as default build command for Markdown files autocmd FileType markdown let b:dispatch = 'octodown %'
-
Caveat: make sure you follow the directions on the Dispatch README.md and make sure that the correct version of Ruby (the one which as Octodown install as a Gem), is used.
- Basic:
octodown README.md
- Markdown preview styling:
octodown --style atom README.md
- *nix lovers:
echo '# Hello world!' | octodown --raw > index.html
- With no arguments given, octodown will read
STDIN
untilEOF
is reached.
- In order to work with this mode, type what you want into the input, then press
Ctrl-D
when finished.
octodown
attempts to use default OS support for opening HTML files from terminal. In Mac, this would be theopen
command; for Linux it is eitherxdg-open
orx-www-browser
. If these are not set, octodown will not automatically open the file in the browser. If octodown doesn't have the commands necessary to open files in a browser, please consider opening a pull request to add support!
- Fork it ( https://github.com/ianks/octodown/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Run the test suite (
bundle exec rake
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request