Skip to content

Latest commit

 

History

History
94 lines (58 loc) · 5.4 KB

CONTRIBUTING.md

File metadata and controls

94 lines (58 loc) · 5.4 KB

Editing documentation

Thank you for your interest in the LongPort OpenAPI documentation! We appreciate your feedback, edits, and additions to our content. This page covers the basic steps for editing our documentation.

Editing documents in GitHub

We've tried to make editing an existing, public file as simple as possible.

To edit a documentation

  1. Browse to the LongPort OpenAPI Docs article that you want to update.

  2. Then click the Edit this page or Edit page link.

    SCR-20230629-jm3

    If the link isn't present, the content might not be open to public contributions. Some pages are generated (for example, from inline documentation in code) and must be edited in the project they belong to.

    TIP
    View the page source in your browser, and look for the following metadata: original_content_git_url. This path always points to the source markdown file for the article.

  3. In GitHub, select the Pencil icon to edit the article. If the pencil icon is grayed out, you need to either sign in to your GitHub account or create a new account.

    image

  4. Using Markdown language, make your changes to the file. For info about how to edit content using Markdown, see the GitHub's Mastering Markdown documentation.

    If your Longbridge staff, please reading and following the Longbridge Writing Style Guide and the OpenAPI Writing Guide.

  5. Make your suggested change, and then select Preview changes to make sure it looks correct.

    SCR-20230629-jov

  6. When you're finished editing, scroll to the bottom of the page. In the Propose changes area, enter a title and optionally a description for your changes. The title will be the first line of the commit message. Briefly state what you changed. Select Propose changes to commit your changes:

    image

  7. The Comparing changes screen appears to show what the changes are between your fork and the original content. On the Comparing changes screen, you'll see if there are any problems with the file you're checking. If there are no problems, you'll see the message Able to merge.

    SCR-20230629-jre

    Select Create pull request. Next, enter a title and description to give the approver the appropriate context about why you're suggesting this change. Make sure that only your changed files are in this pull request; otherwise, you could overwrite changes from other people.

  8. Select Create pull request again to actually submit the pull request.

    The pull request is sent to the writer of the topic and your edits are reviewed. If your request is accepted, updates are published to their respective article.

Swagger Documentation

There have a lot of Swagger documentation in this project for describe our API, you can find them in swagger-docs directory.

Swagger Editor is a tool can help us to edit and preview Swagger documentation. You can editing the document in the Swagger Editor, and then copy the document to swagger-docs directory.

And please following the Swagger Specification.

Editing documents locally

NOTE: We recommend using Visual Studio Code to develop. This project comes with .vscode built-in VS Code plugins and configuration recommendations. Writing with VS Code can start the automatic formatting function.

If you want to edit the documentation locally, you can follow the steps below.

$ yarn

# Start docusaurus server
$ yarn dev

# Listening swagger to markdown convert
$ yarn dev:swagger

File structure

.
├── README.md
├── docs // All documentation in here
├── swagger-docs // All swagger documentation
├── templates // Template for Swagger to Markdown
├── i18n // I18n translation files, when you change any files in `docs`, you need to update the translation files.
├── src // Documentation website source code.
├── convert-md.js // Script for convert Swagger to Markdown.
├── sidebars.js // For describe the documentation sidebar.
├── docusaurus.config.js // Documentation website contributions.
├── tsconfig.json
├── package.json
└── yarn.lock

Resources

  • You can use your favorite text editor to edit Markdown files. We recommend Visual Studio Code, a free lightweight open source editor from Microsoft.
    • And please install huacnlee.autocorrect extension for VSCode, for make sure your have a better copywriting.
  • You can learn the basics of Markdown in just a few minutes. To get started, check out Mastering Markdown.