Giter Club home page Giter Club logo

yat-docs's Introduction

Website

This website is built using

  • Docusaurus 2, a modern static website generator, for the static site generation
  • Widdershins, for OpenApi spec => API reference markdown
  • OpenAPI Generator for generating the SDKs and related documentation.

Installation

Prerequisites

  • You need node (version 12 works fine. v14 had some issues)
  • Java (Tested with OpenJDK 1.8.0_242-b08. Presumably later versions work too).
  • s3-deploy to push to AWS S3

Building the site

$ cd yat-docs
$ yarn install # npm doesn't seem to work for some reason
$ cd ../yatdocs-plugin
$ yarn install

Local Development

$ cd yat-docs
$ yarn run generate-docs # Generates the API reference and SDK docs
$ yarn start

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

Build

$ cd yat-docs
$ yarn run generate-docs # Generates the API reference and SDK docs
$ yarn build

This command generates static content into the build directory and can be served using any static contents hosting service.

Other commands

Usage: docusaurus <command> [options]

Options:
  -V, --version                                            output the version number
  -h, --help                                               output usage information

Commands:
  build [options] [siteDir]                                Build website
  swizzle [options] [themeName] [componentName] [siteDir]  Copy the theme files into website folder for customization.
  deploy [options] [siteDir]                               Deploy website to GitHub pages
  start [options] [siteDir]                                Start the development server
  serve [options] [siteDir]                                Serve website
  docs:version <version>                                   Tag a new docs version
  clean-sdk                                                Delete all generated SDK documentation files
  generate-sdk                                             Build the SDKs and then quit
  clean-api-ref                                            Delete all generated documentation files
  generate-api-ref                                         Build the API reference documentation and then quit
  clean-docs                                               Delete all generated SDK and API reference documentation files
  generate-docs                                            Generate and save the SDK and API reference docs without building the website

Debug logs

To generate debug logs to stdout, set the `DEBUG~ environment variable. All yat-doc plugin logs are namespaced accordingly, so

$ DEBUG=yat-docs:* npm run build

will print out all yat-docs debug information and ignore any other messages from other packages.

Build and deploy

There's a makefile that eases the build / deploy cycle pain.

Make command Description
clean Deletes the build directory
cleandocs Deletes the generated docs
generate Generates the API and SDK docs
build Builds the static website
preview Build and run the site locally

To successfully deploy, you need some environment variables set up. You can store these in .env

REGION=us-east-1

PREVIEW_BUCKET=previewbucket
PREVIEW_KEY=previewkey
PREVIEW_SECRET=previewsecret

PRODUCTION_BUCKET=productionbucket
PRODUCTION_KEY=prodkey234876786d
PRODUCTION_SECRET=prodsecret-3498sduhsdvjnvsdnflk

Then run

$ ./deploy.sh

Generate API Key

To generate an API key that you can use as authentication in the X-Api-Key header follow these steps.

  1. Get an access token - in your browser after refreshing the page open a developer console and type JSON.parse(localStorage.getItem('tokens')).access_token
  2. Generate an API key
    curl -X POST https://a.y.at/api_keys -H 'Authorization: Bearer access_token' -H 'Content-Type: application/json' -d '{"name": "Your-Key-Name"}'
  3. The response contains an api_key field in the JSON result.
  4. All further queries can now be called with curl -H 'X-Api-Key: api_key'

yat-docs's People

Contributors

cjs77 avatar novat82 avatar erikaw82 avatar kukabi avatar krakaw avatar dunnock avatar truszczynskia avatar alexandrvakhtintari avatar timo614 avatar serhiishovkoplias 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.