Giter Site home page Giter Site logo

smurf's Introduction

smurf - a simple markdown surfer

Preview any folder on your pc using a website.

Quick Demo:

$ cd ~/project/smurf
$ smurf
Starting server http://localhost:3434
...

Now simply open http://localhost:3434 in your web browser and you can see a directory listing. You can open any files ending in .md, .mkd, .markown, .txt and they will be converted to html on-the-fly.

smurf demo

Supports custom css, first it checks for a file named smurf.css in the directory to be served. Then it checks for a file in home directory ~/.smurf.css.

CSS is provided by sakura, a simple css theme: https://github.com/oxalorg/sakura

Usage:

smurf [PATH to Directory]

PS: Path to directory can be ommited to serve current directory.

Install

# Download the smurf script into your local bin folder
sudo wget "https://raw.githubusercontent.com/oxalorg/smurf/master/smurf.py" -O /usr/local/bin/smurf

# Make the script executable
sudo chmod a+x /usr/local/bin/smurf

# Download a simple css file for pretty webpages [1]
wget "https://raw.githubusercontent.com/oxalorg/sakura/master/css/sakura.css" -O ~/.smurf.css

Now if you don't have pandoc installed, you'll have to download a markdown parser which is as easy as:

pip3 install --user markdown2
# make sure Python user bin directory is in your path,
# other wise you can also install like this:
# sudo pip3 install markdown2

Why?

I write notes using plain markdown files in a dropbox folder. It works really well with me, especially after combining it with zsh and vim. But the one thing I can't do is view them in a pretty format. This is why I made this script to quickly browse those markdown files.

Requirements

  • Python 3
  • Any one of the following markdown parsers
    • Pandoc
    • Markdown2 (pip3 install --user markdown2)

smurf's People

Contributors

oxalorg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

smurf's Issues

Add syntax highlighting for source files.

Current source files are displayed as plain text. Instead even they can be pretty printed/highlighted using pygments, because this is something I find myself doing again and again (i.e. reading source code in smurf).

Though this does seem out of the scope of a "markdown surfer".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.