• Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    JavaScript
  • Created about 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ⓜ️ Timeline via Markdown.

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

More Repositories

1

pinyin

🇨🇳 汉字拼音 ➜ hàn zì pīn yīn
JavaScript
7,048
star
2

detector

🐶 客户端环境识别模块。(UserAgent detector)
JavaScript
884
star
3

pangu.vim

『盘古之白』中文排版自动规范化的 Vim 插件
Vim Script
328
star
4

nong

中国农历 (Nong Li)
JavaScript
129
star
5

rime

闲耘的 rime 输入法配置
Makefile
98
star
6

gitlab-notifications

👍 Notifications Center for GitLab
58
star
7

gitplus

🔀 git+ is a hack of git, smart for you.
JavaScript
57
star
8

gitopen

🔀 Open git/hg/svn remote url via web browser from terminal.
JavaScript
43
star
9

obsidian-markline

Markline: Markdown timeline view in Obsidian.
TypeScript
24
star
10

unistring

Unicode String for JavaScript
TypeScript
23
star
11

template.vim

Smart load template for Vim.
Vim Script
18
star
12

rm-trash

rm-trash is utility for safely remove files in Termail.app of macOS.
Shell
18
star
13

hongbao

叫花不理红包
18
star
14

vim-desktop-calendar

Printable Vim desktop Calendar 2024
17
star
15

versioning

Semantic Versioning Number Compare
JavaScript
14
star
16

lcal

lcal: 农历事件自动生成器 (Lunar Calender)
JavaScript
12
star
17

jsgf.vim

Improved `gf` for JavaScript, TypeScript and package.json.
Vim Script
11
star
18

hotoo.github.io

HTML
11
star
19

vimlide

Vimlide: Vim-like HTML(5) Slide.
JavaScript
10
star
20

chrommon.js

A Module Loader for Google Chrome Extensions.
JavaScript
9
star
21

url

Uniform Resource Locator.
JavaScript
9
star
22

Vimmer

Vim user contact list.
8
star
23

star

Star
JavaScript
7
star
24

vimwiki-to-markdown

Convert Vimwiki to Markdown
JavaScript
7
star
25

apassword

移动端密码控件
JavaScript
7
star
26

spm-build-deps

Build project all deps
JavaScript
7
star
27

jstidy

Javascript tidy (Lexical analysis, Syntax Analysis, Semantic Analysis, Formatter, Compression, Outline view)
C++
7
star
28

kissy-editor

KISSY Rich-Text Editor
JavaScript
6
star
29

vimkey

Vim-like key mapping
JavaScript
6
star
30

Edit-with-Vim-tabs

Edit with Vim tabs
6
star
31

perf-javascript-error

Performance test for JavaScript Error.
JavaScript
5
star
32

jobs

🐜 蚂蚁集团・数字金融技术部招聘
5
star
33

markdown.vim

5
star
34

rhythmaware

节奏感知器:根据用户的输入速度自动感知停顿状态。
JavaScript
5
star
35

eggjs-gf.vim

goto file for eggjs( support router, controllers, services, proxy, enums)
Vim Script
4
star
36

round-percent

Round Percent Widget
JavaScript
4
star
37

BaiduIndexAPI.java

第三方百度指数 API (Java版)
Java
4
star
38

js2json

Convert JavaScript Object to JSON format.
JavaScript
4
star
39

smartree

Smart Tree
JavaScript
4
star
40

blog

 · 闲耘™・博客
JavaScript
3
star
41

jsonmatter

JSON formatter tool by stream.
JavaScript
3
star
42

orderby

SQL like sort function.
JavaScript
3
star
43

blacklint

Check certain words.
Shell
3
star
44

highlight-cursor-word.vim

Highlight words which under text-cursor(caret) for Vim.
Vim Script
3
star
45

echo

Echo for Web UI, a replicator.
JavaScript
3
star
46

life

@hotoo's life line. A sample for use [markline](https://github.com/hotoo/markline).
Makefile
3
star
47

hundun

盘古之白,浑沌之初。
JavaScript
3
star
48

csspretty.vim

Vim Script
3
star
49

gitruth

Clean Git Files Forever.
Shell
3
star
50

firebug-lite-ie

Firebug Lite for IE.
3
star
51

chinese-lunar-calendar

中国农历
3
star
52

gaegtalk

基于gae和gtalk群聊服务
Python
2
star
53

Jumsoft-Money-zh_CN.lproj

Jumsoft Money 简体中文语言包。
2
star
54

Doit.vim

Vim plugin for Doit.im
2
star
55

fastclone

The fast clone way
JavaScript
2
star
56

linkage

无限级联动
JavaScript
2
star
57

seajs-gettext

GNU `gettext` like for seajs.
JavaScript
2
star
58

hotoo

1
star
59

scripts

很久之前在 Google Code 上备份的代码
JavaScript
1
star
60

.gitblacklist

Check and Reject certain words commit into git repository.
Shell
1
star
61

Chronos

Sync Server and Client Time by Javascript.
JavaScript
1
star
62

pasteboard

批量粘贴通用解决方案。
JavaScript
1
star
63

BaiduIndexAPI.php

第三方百度指数 API (PHP版)
1
star
64

imagic

Imagic send data by image, for tests mock.
JavaScript
1
star
65

samoyed

The samoyed life timeline who named Summer.
Makefile
1
star
66

open-basketball-court

开放篮球场地标工程
1
star
67

jquery.mousepause.js

Add mousepause event for jQuery (trigger when mouse move stoped).
JavaScript
1
star
68

jquery.editable.js

JavaScript
1
star
69

spm-xgettext

GUN xgettext-like for spm.
JavaScript
1
star
70

family-tree-builder-zh_cn

Family Tree Builder 简体中文语言包
1
star
71

tabbar

TabBar
JavaScript
1
star
72

jquery.checkallable.js

支持Checkbox 和 Radio,及 shiftKey 多选功能。
JavaScript
1
star
73

twitter

@hotoo tweets page.
JavaScript
1
star
74

.n-completion

n completion
1
star
75

repeatable

之前写的『可重复新增』模块,后来写了全新的 Echo,这个模块闲置没管,因为换电脑先备份在这。
JavaScript
1
star
76

Snotra

Vim-like WYSIWYG Web Editor
1
star
77

jsbc

JavaScript code Batch Compiler
JavaScript
1
star