Hongmu Notes

README code example

A minimal example that works right away is better than a three-paragraph explanation.
100% Browser local processing 0 Data upload

📘 Project information

Render preview

💡 Instructions for use

  • Write one or two lines in the introduction to clearly explain what it is and who it is for; if it is too long, people will leave before seeing the installation steps.
  • The installation and usage commands must be directly copied and executed, and multiple steps must be written line by line in order.
  • Badges are generated in real time by an external service. Three to five are appropriate. Too many badges will be distracting.
  • No license statement means that all rights are reserved, and others cannot legally use your code.

A minimal example that works right away is better than a three-paragraph explanation.

Minimal example

Control it within ten lines and retain only necessary parameters.

With the expected output, readers can confirm that they are running correctly.

Parameter description

Make a short list or short list of commonly used parameters and default values.

Only the key parameters that affect the results are explained, the rest are directed to the full documentation.

Various combinations

Two to three typical combinations are given to cover the most common usage paths.

Use comments to separate combinations to prevent readers from mistakenly thinking that they need to be written all at once.

Error handling

The example reflects the return value or exception type in case of failure.

Readers are cautioned not to use the placeholder credentials in the examples for production environments.

How to write code blocks

Mark the language type to ensure that highlighting and copying are normal.

Do not leave ellipsis in the code block. Readers will get an error directly after copying it.

The example should be limited to ten lines or less and should be accompanied by expected output. Do not leave ellipsis in the code block.

📖 Glossary

readme file
The description file in the root directory of the warehouse is the first thing visitors see when they open the project. It does not belong to the code, but it determines whether others are willing to continue reading, so it is often regarded as the face of the project.
badge
A row of small icons posted below the title to display build status, version number, license and download count. It is generated in real time by a third-party image service based on warehouse information, and changes will be automatically reflected.
Directory
A navigation list automatically generated by the title. Click to jump to the corresponding chapter. The long description file plus the table of contents allow readers to quickly determine whether there are any parts they care about.
Installation chapter
Tell readers how to get the project running: dependencies, package manager commands and necessary environmental requirements. The command must be directly copied and executed. Vague descriptions will cause people to give up directly.
Usage chapter
Give the smallest runnable example so that people can see the effect by copying just a few lines. Examples should be as short as possible, put parameter descriptions at the end, and do not make readers find the entry point from a large piece of code first.
Contribution Guide
Explain how to participate in development: branch naming, submission specifications, how to run tests, and how to submit change requests. Writing these clearly can significantly reduce the maintainer's communication costs.
License Chapter
Declare how the project allows others to use, modify, and distribute it. Projects without a license retain all rights by default, and others cannot legally use them at will.
markup syntax
A plain text format that uses a few symbols to express typography, with pound signs for titles, dashes for lists, and backticks for codes. The hosting platform will automatically render it into a web page.
code block
A snippet enclosed in three backticks can be language-tagged for syntax highlighting. Put commands and examples into code blocks so readers can copy them with one click instead of manually selecting.
hierarchical title
The number of pound signs is used to indicate the level. The first-level heading usually only appears once as the project name. The levels must be continuous. Level skipping will cause gaps in the automatically generated directories.
anchor link
A link to a title within the document, automatically generated by the renderer based on the title text. Renaming the title will invalidate the old anchor, so it is recommended that the table of contents be automatically generated rather than written by hand.
technology stack
The languages, frameworks and key dependencies used in the project. Writing a clear technology stack allows readers to quickly determine whether the project is suitable for their own scenarios, and also facilitates retrieval.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Does the example cover all parameters?
No need. Just cover the common parameters, and leave the complete parameters to the interface document.
Can the example be used directly in production?
Not recommended. Examples usually omit retry and exception handling, which need to be completed before formal use.