Git Product home page Git Product logo

githubdocs's Introduction

Githubdocs

Easily build a searchable documentation Single Page Application (SPA) using markdown files in your Github Repo or local Markdown files. Github docs is a lightweight alternative to Gitbooks allowing simple but powerful Markdown generate documentation websites.

Website from Github Repo

Installation

  1. Clone Repository: git clone https://github.com/mrvautin/githubdocs.git && cd githubdocs
  2. Install dependencies: npm install
  3. Start application: npm start
  4. Go to http://127.0.0.1:5555 in your browser

Demo

https://githubdocs.markmoffat.com

Markdown files

The docs menu and files are built using files from your Github repo set in the config. Files should have the title of the doc in a single markdown hash/# (HTML = H1) tag in the file. This is used to build the slug of the doc and the menu title etc.

See example docs here: https://github.com/mrvautin/githubdocs/tree/master/docs

Search

Search is built using js-search. The index is built and stored in memory on startup. When searched from the client the API is called returning any matching docs. The menu will then display the match docs. When the search term is removed, the full list of docs is returned.

Config

The config file is located here: /config/config.json.

An example config:

{
    "title": "githubdocs",
    "githubRepoOwner": "mrvautin",
    "githubRepoName": "githubdocs",
    "githubRepoPath": "exampleDocs",
    "updateDocsCron": "*/5 * * * *",
    "addAnchors": true,
    "menuItems": [
        {
            "menuTitle": "About",
            "menuLink": "/about"
        },
        {
            "menuTitle": "Contact",
            "menuLink": "/contact"
        }
    ],
    "static": false
}
Setting Description
title Sets the value to be displayed at the top of the page
githubRepoOwner Owner/username of the Github repo
githubRepoName Name of the repo holding the Markdown files
githubRepoPath Directory relative to the root of the repo holding the Markdown files
updateDocsCron A cron schedule to reindex your Markdown files/docs from Github or static
addAnchors Transforms H1, H2, H3, H4, H5 info HTML anchor points for easy sharing
menuItems Not sure how useful this is. Set the menu items in the top navigation
static Reads Markdown files statically from /docs folder. Defaults to false

Static websites

It's also possible to create a site from local Markdown files rather than using a Github repo.

Starting

You can start your website using the following command from the root of your app:

node app.js

Static

To do this you place your Markdown files into the docs folder and set static to true in your config.

An example config.json for a static site:

{
    "title": "githubdocs",
    "githubRepoOwner": "mrvautin",
    "githubRepoName": "githubdocs",
    "githubRepoPath": "exampleDocs",
    "updateDocsCron": "*/5 * * * *",
    "addAnchors": true,
    "menuItems": [
        {
            "menuTitle": "About",
            "menuLink": "/about"
        },
        {
            "menuTitle": "Contact",
            "menuLink": "/contact"
        }
    ],
    "static": true
}

Layouts

You can also specify your own layout file. The default views/layouts/layout.hbs file is used unless you specify a different file in your config.json.

{
    "layoutFile": "material.hbs"
}

Included is a material.hbs design template and a Bootstrap template (default.hbs).

githubdocs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

githubdocs's Issues

Odd scrolling behaviour on iOS Safari

iOS Safari allows several scrolling related inputs, including:

  1. Tap the very top of the screen to scroll to the top of the webpage
  2. Continuous scrolling by placing another finger on screen before removing the previous one.

Neither of these work on the demo.

Let me know if you need a video or something.

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.