From 93a0adef15e184330263dc30dea7345b9e3e1cf6 Mon Sep 17 00:00:00 2001 From: CanYellow Date: Sat, 17 Dec 2022 16:35:05 +0800 Subject: [PATCH 1/2] Third Translation --- ...­ï¸ Write documentation like you develop code.md | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/sources/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md b/sources/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md index 1aea7321f7..9c373f96bd 100644 --- a/sources/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md +++ b/sources/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md @@ -7,51 +7,52 @@ [#]: publisher: " " [#]: url: " " -Write documentation like you develop code +åƒä»£ç å¼€å‘一样撰写文档 ====== -Don't want documentation to be an afterthought? Try a new approach. +ä¸æƒ³è®©ä¹¦å†™æ»žåŽäºŽä½ çš„æ€è€ƒï¼Ÿæˆ–许你该å°è¯•ä¸€ä¸‹å…¨æ–°çš„写作方å¼ã€‚ -Many engineers and craftspeople are particular about their tools. To do a job well, you need the best tools and the skills to use them. The best tools in software development can be very powerful when applied to other kinds of digital creation. The [Docs as Code][1] approach is a great example. Docs as Code entails writing documentation using the same tools and workflows used for developing code. Proponents of Docs as Code report that this method leads to better documentation while easing the workload of the people who write it. +很多工程师与手工艺者都对他们使用的工具有特别的è¦æ±‚。为了顺利的完æˆå·¥ä½œï¼Œä½ éœ€è¦æœ€å¥½çš„工具和使用它们的技巧。软件开å‘中最好的工具在应用到其他的数字创作领域中也å¯ä»¥æ˜¯å¾ˆå¼ºå¤§çš„。[Docs as Code][1] (译注:代ç åŒ–文档)çš„æ–¹å¼å°±æ˜¯å¾ˆå¥½çš„例å­ã€‚Doc as Code æ„味者使用与代ç å¼€å‘相åŒçš„工具与工作æµæ¥æ’°å†™æ–‡æ¡£ã€‚Doc as Code 的支æŒè€…认为这样的方å¼å¯ä»¥åœ¨é™ä½Žä½œè€…的工作符负è·çš„åŒæ—¶ä¿è¯æ›´å¥½çš„文档结构。 -### Text formats and source control +### 文本格å¼ä¸Žæºæ–‡ä»¶æŽ§åˆ¶ -The most significant adjustment when moving from a more traditional documentation platform to the Docs as Code approach is that the content is stored in a text-based markup format. This change makes all the tools for text-based materials available for generating documentation. Whether you choose [DocBook][2], [Markdown][3], or another markup language, the transition from using just one tool to using a standard format and a variety of tools is a big change. +从传统的写作平å°åˆ‡æ¢åˆ° Docs as Code æ–¹å¼æ—¶ï¼Œæœ€ä¸»è¦çš„调整是写作内容ä¿å­˜åœ¨åŸºäºŽæ–‡æœ¬çš„标记格å¼ä¸­ã€‚这一转å˜ä½¿å¾—基于纯文本æ料的工具都适用于文档写作。当你选择 [DocBook][2], [Markdown][3] 或者其他的标记语言时,从åªä½¿ç”¨ä¸€ç§å·¥å…·åˆ°ä½¿ç”¨ä¸€ç§æ ‡å‡†æ ¼å¼é…åˆå¤šç§å·¥å…·æ˜¯ä¸€ç§å·¨å¤§çš„转å˜ã€‚ -Finding tools that support your workflow is really important. Many developers use their [coding editors][4] when working on Docs as Code projects. Since they are already advanced-level users with that tool, it works well for them. Finding tooling that fits the other professionals on the team, such as technical writers, editors, information architects, and documentation product owners, may take more effort. A few options to consider: +找到支æŒä½ çš„工作æµç¨‹çš„工具是éžå¸¸é‡è¦çš„。在 Docs as Code 项目中,很多开å‘者使用他们的 [代ç ç¼–辑器][4]。考虑到他们已ç»æ˜¯è¿™äº›å·¥å…·çš„高阶用户,一切都很顺利。而找到适åˆå›¢é˜Ÿé‡Œé€‚åˆå…¶ä»–专业从业者,比如技术撰稿ã€ç¼–辑ã€ä¿¡æ¯æž¶æž„师和文档产å“责任人,的工具å¯èƒ½éœ€è¦ä¸€ç•ªåŠªåŠ›ã€‚这里有一些选项å¯å…¹å‚考: -- One of the many [good markdown editors][5] available -- Coding editors with good preview tools, which make them approachable for non-coders -- The web interfaces of popular Git hosting services, especially for occasional contributors +- å„ç§[优秀的 Markdown 编辑器][5]之一是å¯è¡Œçš„ +- 附带良好的预览工具的代ç ç¼–辑器å¯èƒ½æ›´é€‚åˆéžç¨‹åºå‘˜ +- æµè¡Œçš„ Git 托管æœåŠ¡çš„网页界é¢å°¤å…¶é€‚用于å¶å°”有需è¦çš„贡献者 -Once content is safely in a markup format, the project can use source control such as [Git][6], an open source tool with many more features than most documentation platforms can claim: +一旦内容以标记语言的格å¼å®‰å…¨ä¿å­˜å°±å¯ä»¥ä½¿ç”¨ç‰ˆæœ¬æŽ§åˆ¶è¿›è¡Œç®¡ç†ï¼Œæ¯”如 [Git][6]。Git 相比大多数文档平å°å…·æœ‰æ›´å¤šçš„功能: -- A clear and detailed version history of who changed what and when. If you have good commit message culture, you may even be able to learn why the change was made. -- Easy parallel change processes. Working in branches in Git means everyone can make all the changes they want to and combine them at the end. -- Advanced collaboration and review tooling. All the source-control platforms are designed to review each change in detail and have as much discussion as needed until everyone is confident that the change can go ahead. -- Automated quality checks such as spellchecking and link checking. This saves time and catches errors that might otherwise be missed. +- 清晰详细的文档版本历å²ï¼šè°åœ¨ä»€ä¹ˆæ—¶å€™æ”¹å˜äº†ä»€ä¹ˆã€‚ +- 简明的并行修改过程支æŒã€‚在 Git 中使用分支工作æ„味ç€ä»»ä½•äººå¯ä»¥åšå‡ºä»–们想è¦çš„任何改å˜å¹¶åœ¨æœ€åŽåˆå¹¶æ‰€åšçš„更改。 +- 高级的å作与审查工具。所有的æºä»£ç ç®¡ç†å¹³å°éƒ½è®¾è®¡æ”¯æŒè¯„审æ¯ä¸€æ¡ç»†èŠ‚å˜æ›´å¹¶åœ¨è¶³å¤Ÿçš„讨论åŽä½¿æ¯ä¸ªäººéƒ½ç¡®ä¿¡æ”¹å˜å¯ä»¥ç»§ç»­çš„æµç¨‹ã€‚ +- 自动质é‡æ£€æŸ¥ï¼Œæ¯”如拼写检查和链接检查。这ä¸ä»…节çœäº†æ—¶é—´ï¼Œè€Œä¸”å¯ä»¥å‘现以å‰æ— æ³•å‘现的错误。 -Source control has many benefits. Just keep in mind that if you're new to source control, it has a learning curve. There are some excellent [learning resources][7] and [articles for writers][8] that can help. You can also let your curious documentarians find the learning materials that work for them rather than asking your engineers to teach them. (Ask me how I learned this—the hard way of course!) +æºä»£ç ç®¡ç†æœ‰å¾ˆå¤šä¼˜ç‚¹ã€‚但è¦è®°ä½ï¼Œå¦‚果你准备入门æºä»£ç ç®¡ç†ï¼Œå®ƒæœ‰ä¸€å®šçš„学习曲线。这是一些有助于入门的优秀的[学习资æº][7]å’Œ[作者文章][8]。你也å¯ä»¥è®©å…·æœ‰å¥½å¥‡å¿ƒçš„文档作者自行寻找对他们有用的学习æ料,而ä¸æ˜¯è¯·ä½ çš„工程师æ¥åŸ¹è®­ä»–们。(探寻他人的学习历程是最困难的学习方å¼) -### Pull requests and review cycles +### 拉å–请求和评审循环 -All source-control platforms are designed around the concept of pull requests, sometimes also called merge requests. Someone, or some team, puts together a set of changes and then requests that the changes are pulled into the main project. In many ways, working with many changes at once is easier in documentation than in code. Changing one article in one place in documentation has fewer side effects than when you change code and find that there were several other sections depending on it. -The most powerful collaboration tool is the [diff][9], which shows the difference between old and new versions in a way that's easy to follow. There are many versions of this tool available to make the comparison view easier to look at: side-by-side, inline, or even as rendered markdown rather than just text. Each team member can use the tool or tools that work best for them. For example, the web view is commonly used to look at a small change, but for something bigger I would want to look at it locally using `vimdiff` or [Meld][10]. +所有的æºä»£ç ç®¡ç†å¹³å°éƒ½å›´ç»•æ‹‰å–请求这一概念设计,这有时也称为åˆå¹¶è¯·æ±‚。有时候,æŸäº›å›¢é˜Ÿå…ˆå°†ä¸€ç³»åˆ—改å˜æ•´åˆåˆ°ä¸€èµ·ç„¶åŽå‘主项目å‘èµ·è¦æ±‚修改被拉å–的请求。ä¸è¿‡ä»Žè®¸å¤šæ–¹é¢æ¥è¯´ï¼Œåœ¨æ–‡æ¡£ä¸­ä¸€æ¬¡å¤„ç†å¤šä¸ªå˜æ›´æ¯”在代ç ä¸­æ›´å®¹æ˜“。改å˜æ–‡æ¡£ä¸­æŸå¤„的一篇文章比之更改代ç å¹¶æ‰¾å‡ºæœ‰å“ªäº›åœ°æ–¹ä¾èµ–它具有更å°çš„副作用。 -Review comments can be added to the change as a whole or to individual lines in the proposed change. Some projects adopt a maximum line length, called a hard wrap, or start each sentence on a new line to make it easier to attach comments to specific parts of a block of text. Further changes and comments can be added until the review process is complete and the change is accepted. Since the pull requests are shown in a queue on the repository for the project, this is a good way to show what's in progress and what needs review attention. The tools make it easy for reviewers to add their thoughts. In particular, if you are working with technical audiences it can be easier to get reviews from these folks via the tools they use daily. +最强大的å作工具是 [diff][9],它å¯ä»¥é€šè¿‡ä¸€ä¸ªæ˜“于察觉的方å¼å±•ç¤ºæ—§ç‰ˆæœ¬ä¸Žæ–°ç‰ˆæœ¬ä¹‹é—´çš„差异。该工具有多ç§ä¸åŒçš„版本æ¥ä½¿å¾—比较视图更易于查看:åŒæ æ¨¡å¼ã€è¡Œå†…模å¼ï¼Œç”šè‡³æ˜¯æ¸²æŸ“åŽçš„ Markdown 模å¼ã€‚团队中的æ¯ä¸€ä¸ªæˆå‘˜éƒ½å¯ä»¥é€‰æ‹©æœ€é€‚åˆä»–们的版本。举例而言,网页视图通常用于查看细微å˜æ›´ï¼Œè€Œå¯¹äºŽæ›´å¤§çš„å˜æ›´ï¼Œæˆ‘习惯于使用 `vimdiff` 或 [Meld][10] 在本地æµè§ˆã€‚ -### Continuous integration and deployment +检查的注释å¯ä»¥æ•´ä½“æ交到å˜æ›´ä¸­ï¼Œä¹Ÿå¯ä»¥æ交到指定å˜æ›´ä¸­çš„个别行中。一些项目é™åˆ¶äº†è¡Œçš„最大长度,å³ç¡¬æ¢è¡Œï¼Œæˆ–者一行一å¥ï¼Œä»¥ä½¿å¾—å‘文本的特定的部分添加注释更加容易。进一步的å˜æ›´ä¸Žæ³¨é‡Šå¯ä»¥åœ¨æ£€æŸ¥å®ŒæˆæŽ¥å—å˜æ›´æ—¶æ·»åŠ ã€‚由于拉å–请求在项目仓库以队列形å¼å±•ç¤ºï¼Œè¿™æ˜¯å¾ˆå¥½çš„æ–¹å¼æ¥å±•ç¤ºç›®å‰æ­£åœ¨è¿›è¡Œçš„任务以åŠéœ€è¦è¿›è¡Œæ£€æŸ¥æ“作的任务。diff 工具使得评审人员更方便地加入他们的æ€è€ƒã€‚尤其是你在与技术å—众工作时,你å¯ä»¥é€šè¿‡ä»–们日常使用的工具获得æ¥è‡ªä»–们的评论。 -Having the source of your documentation available in plain text has many benefits, such as making it easy to find every occurrence of something that needs changing and using existing tools such as [wc][11], [grep][12], or `tree` to work with potentially large document sets. When you combine this with a source-control platform, even more existing tools become available, and they're all open source. +### æŒç»­é›†æˆä¸Žéƒ¨ç½² -One big workflow improvement is the ability to have continuous deployment in place. This simply means that when a pull request is merged into the main project, the project is immediately and automatically deployed. If the change is good enough to be accepted into the project, it is also good enough to be live on the documentation site, helping your readers. Typically, continuous deployment is set up with either a separate automation server, such as [Jenkins][13], or [Git Hooks][14]. Either way, the text-based markup is combined with the Docs as Code platform (usually a static site generator such as [Hugo][15] or [Sphinx][16]) to produce the documentation website, which is then deployed. +以纯文本形å¼æ‹¥æœ‰ä½ çš„文档的æºä»£ç æœ‰å¾ˆå¤šç›Šå¤„,你å¯ä»¥è½»æ˜“找到æ¯æ¬¡éœ€è¦ä¿®æ”¹çš„ä½ç½®ï¼Œä½ å¯ä»¥ä½¿ç”¨çŽ°æœ‰çš„诸如 [wc][11]ã€[grep][12]或 `tree` 之类的工具在潜在的大型文档集中工作。当你将这些与æºä»£ç ç®¡ç†å¹³å°ç»“åˆèµ·æ¥ä¹‹åŽï¼Œä½ å¯èƒ½èŽ·å¾—更多的å¯ç”¨å·¥å…·ï¼Œå¹¶ä¸”它们都是开æºçš„。 -The same automation can be used before deployment to add some excellent checks to the pull requests before they are merged. On a coding project, it's common to run code linters, tests, and other quality checks that a machine can do itself. Documentation projects can get the same treatment, with tools like [Vale][17] to do prose linting and check for correct heading styles, spellings, and so on. It's also useful to add other tools here, such as a link checker to make sure all the links go somewhere valid. +å¦ä¸€ä¸ªå·¥ä½œæµç¨‹ä¸Šçš„巨大æå‡æ˜¯æŒç»­éƒ¨ç½²çš„能力。简å•æ¥è¯´ï¼Œè¿™æ„味ç€ï¼Œæ¯å½“一个拉å–请求被åˆå¹¶åˆ°ä¸»é¡¹ç›®ä¸­ï¼Œé¡¹ç›®å¯ä»¥ç›´æŽ¥è‡ªåŠ¨åŒ–部署到ä½ã€‚如果å˜æ›´å¥½åˆ°è¶³ä»¥æŽ¥æ”¶è¿›é¡¹ç›®ä¸­ï¼Œä»–åŒæ—¶å¯ä»¥åœ¨æ–‡æ¡£é¡µé¢ä¸­å®žæ—¶æ›´æ–°ï¼Œä»Žè€Œå¸®åŠ©åˆ°ä½ çš„读者。典型情况下,æŒç»­éƒ¨ç½²æ˜¯é…置在任æ„一å°åˆ†ç¦»çš„自动化æœåŠ¡å™¨ä¸Šçš„,比如 [Jenkins][13] 或者 [Git Hooks][14]。ä¸è®ºå“ªç§æ–¹å¼ï¼ŒåŸºäºŽæ–‡æœ¬çš„标记语言与 Doc as Code å¹³å°(通常是é™æ€ç½‘页生æˆå™¨ï¼Œæ¯”如 [Hugo][15] 或 [Sphinx][16])结åˆæ¥ç”Ÿæˆæ–‡æ¡£ç½‘站,然åŽè‡ªåŠ¨éƒ¨ç½²ã€‚ -### Code tools for docs workflows +在部署之å‰ï¼ŒåŒæ ·çš„自动化æµç¨‹å¯ä»¥è¢«ç”¨äºŽå¯¹å°†è¦åˆå¹¶çš„拉å–请求进行检查。在一个编程项目中,通过计算机自行进行代ç æ£€æŸ¥ã€ä»£ç æµ‹è¯•å’Œå…¶ä»–çš„è´¨é‡æ£€æŸ¥å·²ç»ä¹ ä»¥ä¸ºå¸¸ã€‚通过类似 [Vale][17] 之类的工具进行文本检查ã€æ–‡æ¡£é¡¹ç›®ä¹Ÿå¯ä»¥åŒæ ·å¯¹å¾…,你也å¯ä»¥æ·»åŠ å…¶ä»–的工具,比如添加一个链接检查器æ¥ç¡®ä¿æ–‡ä¸­æ‰€æœ‰çš„链接都是有效的。 -The tools known and loved by engineers are very good tools, but they are useful for all sorts of other projects too. For documentation, they contribute valuable efficiency, especially when you need your documentation to be moving at the same speed as your development teams. All the tools discussed here are open source, so you can try them for yourself, deploy them for a huge global team, or anything in between. May your docs process be as smooth as any code process. +### 用于文档æµç¨‹çš„代ç å·¥å…· + +被工程师们熟知并喜爱的工具都是éžå¸¸å¥½çš„工具,它们åŒæ—¶ä¹Ÿå¯ä»¥ç”¨äºŽå…¶ä»–类型的项目中。在文档项目中,它们æå‡äº†å®è´µçš„效率,尤其是当你希望你的文档与你的团队åŒæ­¥æŽ¨è¿›çš„时候。上é¢è®¨è®ºåˆ°çš„所有工具都是开æºçš„,你å¯ä»¥äº²è‡ªå°è¯•ï¼Œä¸ºå¤§åž‹å…¨çƒå›¢é˜Ÿéƒ¨ç½²ä»–们,亦或者介于两者之间,最终使你的æˆæ–‡è¿‡ç¨‹å’Œç¼–程过程一样顺畅。 -------------------------------------------------------------------------------- @@ -59,7 +60,7 @@ via: https://opensource.com/article/22/10/docs-as-code 作者:[Lorna Mitchell][a] 选题:[lkxed][b] -译者:[译者ID](https://github.com/译者ID) +译者:[CanYellow](https://github.com/CanYellow) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) è£èª‰æŽ¨å‡º From dee4803e9dee1a51c3b4c52f9169264b4f66ee76 Mon Sep 17 00:00:00 2001 From: CanYellow Date: Sat, 17 Dec 2022 16:46:37 +0800 Subject: [PATCH 2/2] move --- .../20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md (100%) diff --git a/sources/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md b/translated/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md similarity index 100% rename from sources/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md rename to translated/talk/20221028.1 â­ï¸â­ï¸ Write documentation like you develop code.md