Code Monkey home page Code Monkey logo

microblog's Introduction

MicroBlog

A light dynamic blog server powered by bottle, sqlite and mistune, written in python.

Features

  • Render markdown to HTML
  • Build directories automatically
  • Easy to post, update, delete articles
  • Comment support (and quote)
  • All in python (web-framework, database and markdown renender).
  • Python3 only!! (which sqlite is buildin)

Dependence

Depend on the following python modules

  • bottle (framework)
  • bottle_sqlite (sqlite database plugin)
  • mistune (markdown renderer)

These three module files have been copied to project dirctory, so all you need is python3.

Usage

  1. Prepare your documents
    Organise your markdown file and images in categories, and put them in /docs folder. It should like this:

    |---docs
    |     |---category_1
    |     |      |---passage_1
    |     |      |      |------passage_name.md
    |     |      |      |------image1
    |     |      |      |------image2
    |     |      |      |        .
    |     |      |      |        .
    |     |      |      |        .
    |     |      |
    |     |      |---passage_2
    |     |      |      .
    |     |      |      .
    |     |      |      .
    |     |
    |     |---category_2
    |     |      .
    |     |      .
    |     |      .
    

    category_n will be the category name
    passage_name will be the passage title(underline will be replaced by whitespace)

  2. Initialization
    In project directory, run

    python gentool.py init
    

    This will create several table in database, render md file and save the result in database, relink and rename the image, then put them in the /static folder.

  3. Run the server

    python server.py
    

To add, delete or modify, just change the categories and files in /docs folder and run one of the following command:

  • ./gentool.py update_category
  • ./gentool.py update_article
  • ./gentool.py update_all

Any of this command will update the database according to the content in /docs folder. But won't delete anything in database that has been deleted in /docs folder. However, you can specify arguement delete to delete them.

Use at your own risk!

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.