GithubHelp home page GithubHelp logo

nkashiv / nginx-amplify-doc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nginxinc/nginx-amplify-doc

0.0 0.0 0.0 11.77 MB

Public documentation for Amplify

License: Apache License 2.0

Makefile 60.11% HTML 39.89%

nginx-amplify-doc's Introduction

NGINX Amplify Documentation

This directory contains all of the user documentation for NGINX Amplify, as well as the requirements for linting, building, and publishing the documentation.

Docs are written in Markdown. We build the docs using Hugo and host them on Netlify.

Setup

  1. To install Hugo locally, refer to the Hugo installation instructions.

    NOTE: We are currently running Hugo v0.115.3 in production.

  2. We use markdownlint to check that Markdown files are correct. Use npm to install markdownlint-cli:

    npm install -g markdownlint-cli   

Local Docs Development

To build the docs locally, run the desired make command from the docs directory:

make clean          -   removes the local `public` directory, which is the default output path used by Hugo
make docs           -   runs a local hugo server so you can view docs in your browser while you work
make hugo-mod       -   cleans the Hugo module cache and fetches the latest version of the theme module
make docs-drafts    -   runs the local hugo server and includes all docs marked with `draft: true`

Linting

  • To run the markdownlint check, run the following command from the docs directory:

    markdownlint -c docs/mdlint_conf.json content

    Note: You can run this tool on an entire directory or on an individual file.

Add new docs

Generate a new doc file using Hugo

To create a new doc file that contains all of the pre-configured Hugo front-matter and the docs task template, run the following command in the docs directory:

hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>

For example:

hugo new getting-started/install.md

The default template -- task -- should be used for most docs. To create docs using the other content templates, you can use the --kind flag:

hugo new tutorials/deploy.md --kind tutorial

The available content types (kind) are:

  • concept: Helps a customer learn about a specific feature or feature set.
  • tutorial: Walks a customer through an example use case scenario; results in a functional PoC environment.
  • reference: Describes an API, command line tool, config options, etc.; should be generated automatically from source code.
  • troubleshooting: Helps a customer solve a specific problem.
  • openapi: Contains front-matter and shortcode for rendering an openapi.yaml spec

How to format docs

How to format internal links

Format links as Hugo refs.

  • File extensions are optional.
  • You can use relative paths or just the filename. (Paths without a leading / are first resolved relative to the current page, then to the remainder of the site.)
  • Anchors are supported.

For example:

To install <product>, refer to the [installation instructions]({{< ref "install" >}}).

How to include images

You can use the img shortcode to add images into your documentation.

  1. Add the image to the static/img directory, or to the same directory as the doc you want to use it in.

    • DO NOT include a forward slash at the beginning of the file path. This will break the image when it's rendered. See the docs for the Hugo relURL Function to learn more.
  2. Add the img shortcode:

    {{< img src="<img-file.png>" >}}

Note: The shortcode accepts all of the same parameters as the Hugo figure shortcode.

How to use Hugo shortcodes

You can use Hugo shortcodes to do things like format callouts, add images, and reuse content across different docs.

For example, to use the note callout:

{{< note >}}Provide the text of the note here. {{< /note >}}

The callout shortcodes also support multi-line blocks:

{{< caution >}}
You should probably never do this specific thing in a production environment. 

If you do, and things break, don't say we didn't warn you.
{{< /caution >}}

Supported callouts:

  • caution
  • important
  • note
  • see-also
  • tip
  • warning

A few more fun shortcodes:

  • fa: inserts a Font Awesome icon
  • img: include an image and define things like alt text and dimensions
  • include: include the content of a file in another file; the included file must be present in the content/includes directory
  • link: makes it possible to link to a file and prepend the path with the Hugo baseUrl
  • openapi: loads an OpenAPI spec and renders as HTML using ReDoc
  • raw-html: makes it possible to include a block of raw HTML
  • readfile: includes the content of another file in the current file; does not require the included file to be in a specific location

nginx-amplify-doc's People

Contributors

achawla2012 avatar adubhlaoich avatar akamoroz avatar bheftel avatar defanator avatar dwmcallister avatar igor-meleshchenko-deel avatar jcahilltorre avatar jputrino avatar megazoll avatar nkashiv avatar poluyanov avatar pravdomil avatar richbrowne avatar travisamartin 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.