GithubHelp home page GithubHelp logo

chronark / saleor-docs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saleor/saleor-docs

0.0 1.0 0.0 19.32 MB

Saleor documentation

Home Page: https://docs.saleor.io

Dockerfile 0.58% JavaScript 70.97% CSS 28.19% Shell 0.27%

saleor-docs's Introduction

Saleor Documentation

What's In This Document

Get Started in 5 Minutes

  1. Make sure you are using Node in version 12+:
node --version
  1. Install project dependencies:
npm install
  1. Run your dev server:
npm start

Production Build

  1. Build project:
npm run build
  1. Testing build local:
npm run serve

Editing Content

Directory Structure

  • /docs/dashboard Current dashboard user documentation.
  • /docs/developer/api-reference Automatically generated API reference.
  • /docs/developer Current developer documentation.
  • /docusaurus.config.js Docusaurus configuration file.
  • /docusaurus2-graphql-doc-generator GraphQL API Reference plugin code.
  • /sidebars.js Sidebar menu structure.
  • /static Styling and other static files.
  • /versioned_docs Previous versions of documentation.

Formatting

Code formatting

Code and response examples should be inside code blocks with proper language:

```graphql
query{
  id
  name
}
``` 
```json
{
  "errorCode": 400
}
``` 

Lining pages

Use full path to the file to avoid linking to wrong page.

  • ✅ Example of good link: [Attributes](/docs/developer/attributes.mdx)
  • 🛑 Avoid: [Attributes](/attributes)

Using custom React components

All documentation files use extension:

  • .mdx - Developer documentation
  • .md - Dashboard documentation

If your page uses custom react components, you are required to use .mdx file extension. Import statement is also required:

<!-- /docs/developer/export-products.mdx file -->
---
title: Exporting Products
---

import Chart from "@site/components/Chart";

...

<Chart
  definition={`
  graph TD
    D[Export products data <br> Background Worker] -->|Success| E[Send email to user <br> with a link to <br> download file]
    D -->|Success| X[Set SUCCESS <br>ExportFile status]
    E -->Y[Create export file <br>sent event]
    X -->F[Create data export <br>success event]
    D -->|Failed| G[Set FAILED <br>ExportFile status]
    G --> U[Create data export <br>failed event]
    U --> J[Send email to the user<br>with information <br>about failing export]
    J --> K[Create export failed <br>info sent event]
`}
/>

For charts we are using Mermaid package.

Editing an existing docs page

Edit docs by navigating to docs/ and editing the corresponding document:

docs/doc-to-be-edited.md

---
id: page-needs-edit
title: This Doc Needs To Be Edited
---

Edit me...

For more information about docs, click here

Adding Content

Adding a new docs page to an existing sidebar

  1. Create the doc as a new markdown file in /docs, example docs/newly-created-doc.md:
---
id: newly-created-doc
title: This Doc Needs To Be Edited
---

My new content here..
  1. Refer to that doc's ID in an existing sidebar in sidebar.js:
// Add newly-created-doc to the Getting Started category of docs
{
  "docs": {
    "Getting Started": [
      "quick-start",
      "newly-created-doc" // new doc here
    ],
    ...
  },
  ...
}

For more information about adding new docs, click here

Adding items to your site's top navigation bar

  1. Add links to docs, custom pages or external links by editing the headerLinks field of siteConfig.js:
{
  headerLinks: [
    ...
    /* you can add docs */
    {
      type: "doc",
      docId: "dashboard/before-you-start",
      label: "Dashboard Manual",
      position: "left",
    },
    /* you can add custom pages */
    { page: 'help', label: 'Help' },
    /* you can add external links */
    { href: 'https://github.com/facebook/Docusaurus', label: 'GitHub' },
    ...
  ],
  ...
}

For more information about the navigation bar, click here

Adding custom pages

  1. Docusaurus uses React components to build pages. The components are saved as .js files in ./pages/en:
  2. If you want your page to show up in your navigation header, you will need to update siteConfig.js to add to the headerLinks element:
{
  headerLinks: [
    ...
    { page: 'my-new-custom-page', label: 'My New Custom Page' },
    ...
  ],
  ...
}

For more information about custom pages, click here.

Updating the API Reference

All files in /docs/api-reference are generated by @edno/docusaurus2-graphql-doc-generator script. Introduction page is automatically copied from /docs/api-introduction.mdx file.

To update the API reference:

  1. Start Saleor API at http://localhost:8000
  2. Run npm run update-api-reference

Debugging

In dev mode, Docusaurus serves a debug page with a list of all available routes and config at http://localhost:3000/__docusaurus/debug.

Style

Available visual components and text formatting can be found at http://localhost:3000/docs/3.0/style-guide.

Full Docusaurus Documentation

Full documentation can be found on the website.

saleor-docs's People

Contributors

0xflotus avatar baku-yaki avatar benekex2 avatar bogdal avatar d-wysocki avatar daaawx avatar deliseev avatar dependabot[bot] avatar dylmye avatar fowczarek avatar grzegorzkowalik avatar heliumbrain avatar ikarbowiak avatar jimmykamau avatar karolkielecki avatar korycins avatar krzysztofwolski avatar lex111 avatar maarcingebala avatar michaljelonek avatar mirekm avatar monikamrozek avatar parammittal16 avatar patrys avatar piotrgrundas avatar rafalp avatar robertology avatar tim-hub avatar timcla avatar tomaszszymanski129 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.