GithubHelp home page GithubHelp logo

zaporter / docs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from viamrobotics/docs

0.0 1.0 0.0 1014.01 MB

Source code of docs.viam.com.

Home Page: https://docs.viam.com

License: Creative Commons Attribution Share Alike 4.0 International

JavaScript 16.93% CSS 6.25% Makefile 0.83% HTML 53.89% SCSS 22.10%

docs's Introduction

published external link check

Welcome to the Viam Documentation

Note Looking to contribute? Check out the Contributor Guide. For help knowing what and how to write, check out our templates: our tutorial template and component page template are accessible on the site when building the docs in Draft mode, or accessible here on GitHub.

Build the docs locally

To be able to build the docs locally, you need to install the following:

You can build the docs for local development using the following command:

make serve-dev-draft

If you would like to see the production view (without drafts and with minified CSS), run:

make serve-prod

You can also run hugo serve after installing Hugo to show the production view.

Generate HTML docs

To generate the full HTML version of the docs run:

make build-prod

You can serve the resulting docs with:

python3 -m http.server 9000 --directory public

Test the docs locally

Python snippets

To ensure all python snippets are properly formatted before creating a commit, install flake8-markdown and add the following lines to the .git/hooks/pre-commit file in your local repository:

if [ "git diff --diff-filter=d --name-only HEAD | grep '\.md$' | wc -l" ];
then
list= $(git diff --diff-filter=d --name-only HEAD | grep '\.md$')
for item in $list
do
flake8-markdown $item
done
fi

If you don't already have a .git/hooks/pre-commit file in your docs git repo directory, you can copy the existing pre-commit.sample file in that directory as pre-commit to use the sample template, or create a new pre-commit file in that directory with the above content. If you create a new file, you must also make it executable with: chmod 755 /path/to/my/.git/hooks/pre-commit.

To ensure your markdown is properly formatted, run make markdowntest.

To check locally for broken links, install htmltest and run make htmltest.

Lint JS and Markdown files with Prettier on save

  1. Install the Prettier VS Code Extension.
  2. Run npm install in the docs folder where you have the docs checked out.
  3. Inside VS code, open the user settings.json file by pressing CMD+SHIFT+P and typing 'settings', and add the following settings to the end of the file:
  "[markdown]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "prettier.configPath": ".prettierrc",
  "prettier.documentSelectors": ["**/*.md"],
  "prettier.prettierPath": "./node_modules/prettier/index.cjs",
  "prettier.withNodeModules": true,
  "prettier.resolveGlobalModules": true,
  "prettier.requirePragma": true

Publishing

The docs are automatically published when a PR merges.

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.