Git Product home page Git Product logo

docs-api's Introduction

docs-api

An easy-to-use documentation API

Example

Github Page Example

Importing

<script src="https://unpkg.com/json-documentation"></script>

How to use?

  • Create a html file.
  • Create docs.json to the same directory
  • Paste this sample:
{
  "label": "Docs API",
  "pages": [
    {
      "label": "This is a category!",
      "description": "I am indeed a category!",
      "pages": [
        {
          "label": "This is a page!",
          "description": "I am indeed a page!",
          "id": "example",
          "href": "./example.md",
          "markdown": true
        }
      ]
    }
  ]
}
  • Add the sample code to the html file you have created:
<html>
<head>
    <title>Hello, world!</title>
    <script src="https://unpkg.com/json-documentation"></script>
</head>
</html>
  • You're ready to go! Just enter to the html file using a host(can be localhost)!

docs.json

Here's a typescript declaration that describes docs.json

type DocsNormalPage = {
    label: string,
    description: string | undefined,
    id: string | undefined,
    href: string | undefined,
    html: string | undefined,
    markdown: boolean | undefined
};

type DocsCategoryPage = {
    label: string,
    description: string | undefined,
    id: string | undefined,
    href: string | undefined,
    html: string | undefined,
    markdown: boolean | undefined,
    pages: DocsPage[]
};

type DocsPage = DocsNormalPage | DocsCategoryPage;

const DocsJson = {
    label: string,
    href: string | undefined,
    html: string | undefined,
    markdown: boolean | undefined,
    pages: DocsPage
};

docs-api's People

Contributors

oguzhanumutlu avatar

Stargazers

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