npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

markline

v0.7.0

Published

Timeline via Markdown

Downloads

24

Readme

Markline

NPM version Build Status Coverage Status


Timeline via Markdown

Install

via npm:

$ npm install markline -g

via spm:

$ spm install markline --save

Usage

for Command Line Interface(CLI):

$ markline server data.md
Server Started 127.0.0.1:8000

$ markline server -p 80 data.md
Server Started 127.0.0.1:80

$ markline server -w data.md
Server Started 127.0.0.1:8000

$ markline build data.md

$ markline build data.md --dist _site

build pages in dist directory by default, you can set --dist argument for custom.

for Web:

var Markline = require('markline');
var $ = require("jquery");

$.get("./data/timeline.md", function(markdown){
  var line = new Markline("#timeline", markdown);
  line.render();
});

API

Markline(Object element, String markdown)

Markline Constuctor.

Params:

  • Object element: markline container element, Need HTMLElement, jQuery Object, or Selector.
  • String markdown: markdown content.

markline.render()

Render timeline into container.

Markdown

Markdown is so easy, and so powerful, you can use it to build the timeline graph.

Markline use subsets of markdown now:

Dates

* 1986 for year.
* 1986/06 for month.
* 1986/06/28 is a good day.
* 1986-06-28 you also can use this date formart.

Date Ranges

* 2012~2014 year to year.
* 2012~2014/02 year to year.
* 1986/06/28~1986/08/14 from date to another date.
* 2012~ year to now.

Header

# title

## h2 group name
### h3 group name
#### h4 group name
##### h5 group name
###### h6 group name

Meta

Between title and group or lines, we can set meta data in markdown by key-value pair.

# title

- age: show
- date: 2014/01/01
- author: @hotoo
- mention: https://twitter.com/{@mention}

----

# Group 1

* 2014 line 1.

Now we support meta data:

  • age: show age after year in top header line. default is hide, if want show, set:

    - age: show
  • mention: set mention enable, and mention base url. default mention is disable.

    # @Mention Demo
    
    - mention: https://github.com/{@mention}
    
    ----
    
    - 2014 @hotoo mention @lizzie

    {@mention} is placeholder for mention name.

  • hashtag: custom hashtag styles.

    # #HashTag Demo
    
    - hashtag:
      - tag-name: text-color, background-color
      - life: yellow, #f00
      - job: rgb(255,255,255), rgba(255,0,0,0.5)
    
    ----
    
    - 2014 this is my #life

following meta data support come soon.

  • theme: set different theme, by build-in theme name, or theme css file url.

    - theme: light
    - theme: http://www.example.com/theme.css
  • year-length: set date column width.

  • date-type: show date type by year, month, or date

  • author: set author information.

List

* 2014 list item
  * 2014/01 sub list item

- 2014 another list item
  - 2014/01 another sub list item

Horizontal

for anonymous group.

* 2014 line 1

----

* 2015 line 2

Link

* 2014 this is a  [link](url)

Image

* 2014 this is an image: ![alt](image-url)

Strong

* 2014 this is **strong** text.
* 2014 this is __another strong__ text.

Emphasized

* 2014 this is _emphasized_ text.
* 2014 this is *another emphasized* text.

Delete

* 2014 this is ~delete~ text.
* 2014 this is ~~another delete~~ text.

Want more markdown syntax feature? make issues, fork and pull request.

Examples

# document name(title)

## group name (optional)

* 2012~2014 list 1
  - 2012/02 sub list 2.1
  - 2013/08/02~2013/12/20 sub list 2.2
* 2012/02 list 2
* 2012/02/02 list 3

## another group

- 2013 another list item.
- 2013-05-05 yet another list item.

References

Why I write this?

LICENSES

MIT