diff --git a/sources/tech/20220812 Writing project documentation in HTML.md b/sources/tech/20220812 Writing project documentation in HTML.md new file mode 100644 index 0000000000..def1112b5e --- /dev/null +++ b/sources/tech/20220812 Writing project documentation in HTML.md @@ -0,0 +1,317 @@ +[#]: subject: "Writing project documentation in HTML" +[#]: via: "https://opensource.com/article/22/8/writing-project-documentation-html" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lkxed" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Writing project documentation in HTML +====== +HyperText has more features than plain text to level up your documentation. + +![5 trends in open source documentation][1] + +Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 + +Documentation is an important part of any technical project. Good documentation tells the end user how to run the program, how to use it, or how to compile it. For many projects, plain text documentation is the standard. After all, every system can display plain text files. + +However, plain text is limiting. Plain text files lack formatting elements like italics text, bold text, and titles. To add these elements, we can leverage HTML. HyperText Markup Language (HTML) is the markup language used in all web browsers. And with a little extra effort, you can use HTML to write project documentation that can be read by everyone. + +HTML uses a series of tags enclosed in angle brackets to control how different parts of a document should be displayed. These tags define *elements* in an HTML document, such as document headings, paragraphs, italics text, bold text, and other kinds of text. Almost every tag comes in a pair: an *opening* tag, like
to start a paragraph, and a *closing* tag to end the element, such as
to end a paragraph. When using these tags, remember this rule: *if you open a tag, you need to close it*. Not closing a tag properly can result in the web browser incorrectly. + +Some tags define a *block* within the HTML document, while others are *inline*. For more information about block and inline elements, read my other article about [a gentle introduction to HTML][2]. + +### Start an empty document + +Begin by creating a boilerplate empty HTML document. Every HTML document should provide a document type declaration. Use the single tag on the first line of the HTML file to define an HTML document. The HTML standard also requires that pages wrap the document text in two block elements: to define the HTML document, and to define the body text. While HTML doesn't require *indenting* each new code block, but I add it anyway so you can see that is actually "inside" the block: + +``` + + + + + + +``` + +HTML documents also need a block before the that provides extra information called *metadata* about the page. The only required metadata is the title of the document, defined by the. While not everything in this file is actually a paragraph, start by wrapping everything in
and
tags: + +``` + + + +HOW TO PLAY SIMPLE SENET
+ +The game will automatically "throw" the throwing sticks for you, and + display the results in the lower-right corner of the screen.
+ +If the "throw" is zero, then you lose your turn.
+ +When it's your turn, the game will automatically select your first + piece on the board. You may or may not be able to make a move with + this piece, so select your piece to move, and hit Space (or Enter) to + move it. You can select using several different methods:
+ +- Up/down/left/right to navigate to a specific square.
+ +- Plus (+) or minus (-) to navigate "left" and "right" on the + board. Note that this will automatically follow the "backwards S" + shape of the board.
+ +- Tab to select your next piece on the board.
+ +To quit the game at any time, press Q (uppercase Q) or hit Esc, and + the game will prompt if you want to forfeit the game.
+ +You win if you move all of your pieces off the board before your + opponent. It takes a combination of luck and strategy!
+ + +``` + +This makes the Readme look more like a document you want to read. When you view the new document in a web browser, every paragraph starts on a new line, with some extra space above and below. The paragraph is the most common example of a block element. + +![Our first step is to define everything as paragraphs.][4] + +### Headings and subheadings + +The first line in your content is your document's title, so you should make this into a heading. HTML provides six levels of headings, fromThe game will automatically "throw" the throwing sticks for you, and + display the results in the lower-right corner of the screen.
+ +If the "throw" is zero, then you lose your turn.
+ +When it's your turn, the game will automatically select your first + piece on the board. You may or may not be able to make a move with + this piece, so select your piece to move, and hit Space (or Enter) to + move it. You can select using several different methods:
+ +To quit the game at any time, press Q (uppercase Q) or hit Esc, and + the game will prompt if you want to forfeit the game.
+ +You win if you move all of your pieces off the board before your + opponent. It takes a combination of luck and strategy!
+ + +``` + +These extra styles help special items to stand out in the text: + +![The extra formatting makes these gameplay instructions easier to read.][8] + +The point of writing documentation is for users to understand how to use the software, so every open source project should make the effort to write documentation in a way that is easy to read. With a few basic HTML tags, you can write documentation that presents the information more clearly to your users. + +For more information on using HTML to write documentation, check out the complete [HyperText Markup Language reference][9] at MDN, the Mozilla Developer Network, hosted by the Mozilla web project. + +Image by: (Jim Hall, CC BY-SA 4.0) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/22/8/writing-project-documentation-html + +作者:[Jim Hall][a] +选题:[lkxed][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lkxed +[1]: https://opensource.com/sites/default/files/lead-images/documentation-type-keys-yearbook.png +[2]: https://opensource.com/article/22/8/gentle-introduction-html +[3]: https://opensource.com/sites/default/files/2022-08/html-senet-1.webp +[4]: https://opensource.com/sites/default/files/2022-08/html-senet-2.webp +[5]: https://opensource.com/sites/default/files/2022-08/html-senet-3.webp +[6]: https://opensource.com/sites/default/files/2022-08/html-senet-4.webp +[7]: https://opensource.com/sites/default/files/2022-08/html-senet-5.webp +[8]: https://opensource.com/sites/default/files/2022-08/html-senet-6.webp +[9]: https://developer.mozilla.org/en-US/docs/Web/HTML