Giter Site home page Giter Site logo

darkme.js's Introduction

darkme.js

Parser for custom readme format for it to be used by javascript to generate custom readme pages.

Example

Program

header[class: "header", id: "Blink"]{
	This is a $[bold]{header} for the document
	$list[label: "Fruits"]{
		$[0]{ Apple }
		$[1]{ Orange }
		$[2]{ Tomato }
		$[3]{ Mango }
	}
}

list[label: "Fruits"]{
	$[0]{ Apple }
	$[1]{ Orange }
	$[2]{ Tomato }
	$[3]{ Mango }
}

code[lang: "cpp"]{
	auto t = tensor<float>(extents<1,2,3,4>{{}{{{}}}{}},1.f);
}

AST

{
    "_kind": "@Program",
    "_body": [{
        "_kind": "header",
        "_body": [{
            "_kind": "@String",
            "_body": ["\tThis is a "],
            "_attrs": {}
        }, {
            "_kind": "@anonymousBlock0",
            "_body": [{
                "_kind": "@String",
                "_body": ["header"],
                "_attrs": {}
            }],
            "_attrs": {
                "bold": ""
            }
        }, {
            "_kind": "@String",
            "_body": [" for the document\t"],
            "_attrs": {}
        }, {
            "_kind": "list",
            "_body": [{
                "_kind": "@anonymousBlock1",
                "_body": [{
                    "_kind": "@String",
                    "_body": [" Apple "],
                    "_attrs": {}
                }],
                "_attrs": {
                    "0": ""
                }
            }, {
                "_kind": "@anonymousBlock2",
                "_body": [{
                    "_kind": "@String",
                    "_body": [" Orange "],
                    "_attrs": {}
                }],
                "_attrs": {
                    "1": ""
                }
            }, {
                "_kind": "@anonymousBlock3",
                "_body": [{
                    "_kind": "@String",
                    "_body": [" Tomato "],
                    "_attrs": {}
                }],
                "_attrs": {
                    "2": ""
                }
            }, {
                "_kind": "@anonymousBlock4",
                "_body": [{
                    "_kind": "@String",
                    "_body": [" Mango "],
                    "_attrs": {}
                }],
                "_attrs": {
                    "3": ""
                }
            }],
            "_attrs": {
                "label": "Fruits"
            }
        }],
        "_attrs": {
            "class": "header",
            "id": "Blink"
        }
    }, {
        "_kind": "list",
        "_body": [{
            "_kind": "@anonymousBlock5",
            "_body": [{
                "_kind": "@String",
                "_body": [" Apple "],
                "_attrs": {}
            }],
            "_attrs": {
                "0": ""
            }
        }, {
            "_kind": "@anonymousBlock6",
            "_body": [{
                "_kind": "@String",
                "_body": [" Orange "],
                "_attrs": {}
            }],
            "_attrs": {
                "1": ""
            }
        }, {
            "_kind": "@anonymousBlock7",
            "_body": [{
                "_kind": "@String",
                "_body": [" Tomato "],
                "_attrs": {}
            }],
            "_attrs": {
                "2": ""
            }
        }, {
            "_kind": "@anonymousBlock8",
            "_body": [{
                "_kind": "@String",
                "_body": [" Mango "],
                "_attrs": {}
            }],
            "_attrs": {
                "3": ""
            }
        }],
        "_attrs": {
            "label": "Fruits"
        }
    }, {
        "_kind": "code",
        "_body": [{
            "_kind": "@String",
            "_body": ["\tauto t = tensor<float>(extents<1,2,3,4>{{}{{{}}}{}},1.f);"],
            "_attrs": {}
        }],
        "_attrs": {
            "lang": "cpp"
        }
    }],
    "_attrs": {}
}

darkme.js's People

Contributors

amitsingh19975 avatar

Watchers

James Cloos avatar  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.