Markdown Viewer / Browser Extension

simov 59dbf03f4f Store scroll position for each path individually %!s(int64=8) %!d(string=hai) anos
background c50510f0e7 Fix anchor links %!s(int64=8) %!d(string=hai) anos
content 59dbf03f4f Store scroll position for each path individually %!s(int64=8) %!d(string=hai) anos
css f79466f892 Minor fixes %!s(int64=9) %!d(string=hai) anos
images af589f3ef2 Add advanced options screenshot %!s(int64=9) %!d(string=hai) anos
themes 8b24fd49f7 Update github themes %!s(int64=9) %!d(string=hai) anos
vendor f2b5ceb243 Re-build mdl js with correct file order %!s(int64=9) %!d(string=hai) anos
.editorconfig 552033301b Update project structure %!s(int64=9) %!d(string=hai) anos
LICENSE 657de18395 Update license %!s(int64=8) %!d(string=hai) anos
README.md 657de18395 Update license %!s(int64=8) %!d(string=hai) anos
manifest.json f46f4ff2b1 Version bump %!s(int64=8) %!d(string=hai) anos
syntax.md f5ed8bf89d Update syntax %!s(int64=9) %!d(string=hai) anos

README.md

Markdown Viewer / Chrome Extension

Install

Features

  • Built on top of the marked compiler
  • Support for GitHub Flavored Markdown
  • Full control over the compiler options
  • Themes from jasonm23, mixu and cobalt
  • Syntax highlighted code blocks using prism
  • Settings synchronization through google sync
  • Supports raw and rendered markdown views
  • Supported file extensions markdown|mdown|mkdn|md|mkd|mdwn|mdtxt|mdtext|text
  • Built as event page - the extension is loaded only when needed
  • No special permissions required for file URLs
  • Full control over the allowed origins
  • Open source

Compiler Options

Option Default Description
gfm true Enable GFM GitHub Flavored Markdown.
tables true Enable GFM tables. This option requires the gfm option to be true.
breaks false Enable GFM line breaks. This option requires the gfm option to be true.
pedantic false Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
sanitize false Sanitize the output. Ignore any HTML that has been input.
smartLists false Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.
smartypants false Use "smart" typograhic punctuation for things like quotes and dashes.

Local Files

To enable the extensions for local files:

  1. Navigate to chrome://extensions
  2. Make sure that the Allow access to file URLs checkbox is checked for the Markdown Viewer extension

Remote Files

  1. Click on the Markdown Viewer icon and select Options
  2. Add the origin that you want enabled for the Markdown Viewer extension

Advanced Options

advanced-options

Markdown Viewer doesn't require any specific permissions in order to render markdown files from local file URLs. For example the file:///home/s/chrome/markdown-viewer/README.md on my hard drive will always be rendered without a problem.

  1. In case you want the extension to render markdown files from web URLs you have to specify the server's origin. The origin consists of [protocol]://[domain] For example adding https://raw.githubusercontent.com will allow the extension to render markdown files from that origin.

  2. By default the extension renders only URLs ending with a markdown file extension. For example if you add the https://raw.githubusercontent.com origin, then the https://raw.githubusercontent.com/simov/markdown-viewer/master/README.md URL will be rendered as markdown file.

  3. At any point you can remove the allowed origin.

  4. In case a custom path matching is needed, for example https://something.com/some-path then after adding the http://something.com origin you'll have to set the path matching regular expression as well \/some-path$.

  5. Markdown Viewer synchronizes your preferences across multiple devices so your list of allowed origins is always up to date. However the actual permissions are not being synced automatically. In case you recently added a new origin on one of your computers you'll have to allow it on your other computers as well. Just click on the Refresh icon to add the same permission on the computer you are currently on.

  6. Markdown Viewer is an Open Source project hosted on GitHub. In case you have any problems with it, questions or other suggestions open up an issue there https://github.com/simov/markdown-viewer/issues.

Markdown Syntax

  • Navigate to this URL and play around with the Compiler Options
  • Use the Markdown/HTML button to switch between raw markdown and rendered HTML
  • At any point click on the Defaults button to reset back the compiler's options

License

The MIT License (MIT)

Copyright (c) 2013-2017 Simeon Velichkov [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.