Coder Social home page Coder Social logo

rakhithjk / strapdown-zeta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chaitin/strapdown-zeta

0.0 1.0 0.0 3.06 MB

Instant and elegant Markdown documents in the browser, Git powered markdown wiki server, mathjax and theme support, and many more features!

Home Page: http://strapdown.ztx.io

License: Other

JavaScript 86.91% HTML 2.50% Go 5.04% CSS 2.33% Shell 0.11% Makefile 0.17% Python 2.95%

strapdown-zeta's Introduction

Strapdown-Zeta - Git powered Wiki for Hackers!

Join the chat at https://gitter.im/chaitin/strapdown-zeta

Build Status

Strapdown-Zeta is a git-powered wiki system for hackers, derived from strapdown.js project.

Strapdown.js makes it embarrassingly simple to create elegant Markdown documents. No server-side compilation required.

Strapdown-Zeta add more features including a standalone server providing a git powered wiki system, on top of libgit2, we don't want any potential command injections!

Features

Strapdown Static Markdown Page

  • Search Engine friendly.
  • Cross-browser compatible and responsive in mobile screens.
  • GitHub flavored Markdown syntax.
  • MathJax support. Feel free to type in your awesome math equations.
  • Theme switchable. 15 Bootstrap themes included by default, you can add more as you wish. And everybody can switch the theme thru one click.
  • Table of Content auto generation. Just specify toc="true" in the xmp tag
  • Heading numbering and anchor support, just one click will bring you to the section you are going to.
  • Use highlight.js for syntax highlighting, which provides more beautiful coloring and more powerful syntax parsing.
  • Blazing fast loading speed! All the codes are written using vanilla-js, only less than 200KiB source code after compressing.

Git powered Wiki

  • Git Powered Wiki system. A standalone server is provided, just git init then run the server will get you a full functional geeky wiki server.
  • File modification history and view by commit version(shortened sha hash).
  • Custom view options can be specified for different files.
  • Handle of static files. Directory listing can be turned on and off.
  • HTTP Authentication.

For more, please see:

Usage

Use Strapdown static html

Open your favorite text editor, paste the following lines into the text, then type markdown content in the middle, save the file as test.html, and open it, here you go!

<!DOCTYPE html> <html> <title>Hello, Strapdown</title> <meta charset="utf-8"> <xmp theme="cerulean" style="display:none;">

# title

your awesome markdown content goes here...

</xmp> <script src="http://cdn.ztx.io/strapdown/strapdown.min.js"></script> </html>

Alternatively use src attribute

You can points to an external script file through the src attribute:

<!DOCTYPE html> <html> <title>Hello, Strapdown</title> <meta charset="utf-8">
<xmp theme="cerulean" style="display:none;" src="content.md">
</xmp> <script src="http://cdn.ztx.io/strapdown/strapdown.min.js"></script> </html>

(in this example we display parsed content.md file located at same path).

src attribute specifies the URL of an external markdown file.

It should be placed on same domain because of web browsers same-origin policy.

Choose theme

You can set your favorite theme in xmp tag. The following themes are built-in by default.

  • Chaitin
  • Amelia
  • Bootstrap
  • Cerulean
  • Cosmo
  • Cyborg
  • Flatly
  • Journal
  • Readable
  • Simplex
  • Slate
  • Spacelab
  • Spruce
  • Superhero
  • United

To use Cosmo, use the following line

<!DOCTYPE html> <html> <title>Hello, Strapdown</title> <meta charset="utf-8"> <xmp theme="cosmo" style="display:none;">

your awesome markdown content goes here...

</xmp> <script src="http://cdn.ztx.io/strapdown/strapdown.min.js"></script> </html>

Table of Content

To generate table of content, specify toc="true" in xmp tag.

<!DOCTYPE html> <html> <title>Hello, Strapdown</title> <meta charset="utf-8"> <xmp theme="cosmo" toc="true" style="display:none;">

your awesome markdown content goes here...

</xmp> <script src="http://cdn.ztx.io/strapdown/strapdown.min.js"></script> </html>

Strapdown Server

The server supports the following parameters.

  • -addr="0.0.0.0", specify the listening host:port tuple, multiple addresses can be specified by separation of comma, e.g. 192.168.1.10:8080,127.0.0.1:8080.
  • -init, do automatic git init before starting the server, if git repo not found in working directory.
  • -dir=/path/to/dir, use the directory as the root of the git powered wiki.
  • -title=MyTitle, specify the default title of Wiki
  • -auth=.htpasswd, specify the authentication file to use, htpasswd format
  • -heading_number=true|false, set default value for whether to show heading numbers
  • -toc=true|false, set default value for whether to show table of content
  • -host=some.domain.com, the default hosting of strapdown static files
  • -theme=cerulean|cosmo|..., the default theme to use

Installation

For normal users

Standalone downloadable binary can be downloaded at https://github.com/chaitin/strapdown-zeta/releases

For hackers

You can hack this project any way you want. Please follow the following build instructions to get started.

Build

build strapdown.min.js and strapdown.min.css

$ npm install
$ grunt

The generated file would be build/strapdown.min.js and build/strapdown.min.css

Build strapdown server

The server can be built into a single standalone binary.

The server is written using go programming language.

First, you need to install go dependency libraries.

$ make -C server deps

After that, just run make in server directory.

$ cd server
$ make

or just do following in project root directory, both will work!

$ make -C server all

Usage

Just copy the strapdown-server binary to anywhere you want and run the server with proper parameters.

examples here:

$ mkdir -p /home/wiki
$ strapdown-server -dir /home/wiki -init -addr 127.0.0.1:8080

Or,you can run in docker:

$ mkdir -p /home/wiki
$ docker build . -t wiki
$ docker run -d -p 8080:8080 -v /home/wiki:/wiki wiki -dir /wiki -init -addr :8080

Note

The server relies on /etc/mime.types to correctly detect file mime types. So make sure /etc/mime.types exists.

for Mac OSX users, the file is builtin.

For Archlinux users, install mime-types

$ pacman -S mime-types

For other Linux distributions, install apache server will also help.

Systemd script

To run this server using systemd, copy the strapdown.service file into your /etc/systemd/system/ directory and systemctl start strapdown

License

This project use SATA License (Star And Thank Author License), so you have to star this project before using. Read the license carefully.

Credits

All credit goes to the projects below that make up most of Strapdown.js:

Contributor

strapdown-zeta's People

Contributors

ztrix avatar pandada8 avatar yywing avatar arturadib avatar neverland4u avatar jamesliu96 avatar zhangyoufu avatar cbmixx avatar soyking avatar reverland avatar jan-zajic avatar atifaziz avatar lazee avatar joedf avatar gitter-badger avatar virusdefender avatar xhyumiracle avatar

Watchers

 avatar

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.