{"id":524824,"date":"2024-11-11T16:11:57","date_gmt":"2024-11-11T15:11:57","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=writerside&#038;p=524824"},"modified":"2024-11-11T16:33:02","modified_gmt":"2024-11-11T15:33:02","slug":"writing-docs-with-code-samples-try-out-the-new-writerside-eap-release","status":"publish","type":"writerside","link":"https:\/\/blog.jetbrains.com\/zh-hans\/writerside\/2024\/11\/writing-docs-with-code-samples-try-out-the-new-writerside-eap-release","title":{"rendered":"Writing Docs With Code Samples? Try Out the New Writerside EAP Release"},"content":{"rendered":"\n<p><em>Each Early Access release is designed to make writing documentation easier and more enjoyable. This update is based on your feedback and focuses on <a href=\"https:\/\/blog.jetbrains.com\/writerside\/2024\/11\/writing-docs-with-code-samples-try-out-the-new-writerside-eap-release\/#new-in-writerside-eap-9-code-block-enhancements\" data-type=\"link\" data-id=\"https:\/\/blog.jetbrains.com\/writerside\/2024\/11\/writing-docs-with-code-samples-try-out-the-new-writerside-eap-release\/#new-in-writerside-eap-9-code-block-enhancements\">improving code blocks<\/a>, but <a href=\"https:\/\/blog.jetbrains.com\/writerside\/2024\/11\/writing-docs-with-code-samples-try-out-the-new-writerside-eap-release\/#but-wait,-there-are-more-features-and-improvements\" data-type=\"link\" data-id=\"https:\/\/blog.jetbrains.com\/writerside\/2024\/11\/writing-docs-with-code-samples-try-out-the-new-writerside-eap-release\/#but-wait,-there-are-more-features-and-improvements\">there is more<\/a>! Thank you all for sharing your ideas. It\u2019s a pleasure to keep improving our product for you.<\/em><\/p>\n\n\n    <div class=\"buttons\">\n        <div class=\"buttons__row\">\n                                                <a href=\"https:\/\/jetbrains.com\/writerside\/download\" class=\"btn \" target=\"_blank\" rel=\"noopener\">Download Writerside<\/a>\n                                    <\/div>\n    <\/div>\n\n\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Code samples in documentation: Stick to the basics<\/h2>\n\n\n\n<p>When I first started thinking about presenting code samples in technical documentation, the initial idea was about advanced features, like interactivity, robust linking between text and code, and sophisticated presentation options, such as substituting placeholders on the fly.&nbsp;<\/p>\n\n\n\n<p>However, the recent Unconference session at the<a href=\"https:\/\/www.writethedocs.org\/conf\/atlantic\/2024\/\" target=\"_blank\" rel=\"noopener\"> Write The Docs Atlantic conference<\/a> revealed something surprising \u2013 <mark style=\"background-color:#ffe394\" class=\"has-inline-color\">the most pressing concerns regarding code blocks weren&#8217;t about cutting-edge features, but about getting the fundamentals right<\/mark>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"768\" height=\"758\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/wrs_blog_ill2.jpg\" alt=\"\" class=\"wp-image-524825\" style=\"object-fit:cover;width:512px;height:505px\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Reality check: Know your audience<\/h2>\n\n\n\n<p>At the conference, the discussion quickly shifted from &#8220;How can we make our code samples more interactive?&#8221; to &#8220;What does our audience actually need?&#8221; <mark style=\"background-color:#ffe394\" class=\"has-inline-color\">This pivot highlighted a fundamental truth in technical writing: understanding your readers&#8217; goals is more important than implementing cutting-edge features.<\/mark><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The 4 key insights regarding code blocks<\/h2>\n\n\n\n<ol>\n<li><strong>Context and purpose<\/strong><\/li>\n<\/ol>\n\n\n\n<p>It\u2019s not about \u201cshort\u201d versus \u201clong\u201d code samples \u2013 what matters is context and purpose. Tutorials need complete, real-world examples. API docs benefit from focused code blocks that demonstrate specific functionality.&nbsp;<\/p>\n\n\n\n<ol start=\"2\">\n<li><strong>Copy-paste is the reality&nbsp;<\/strong><\/li>\n<\/ol>\n\n\n\n<p>There\u2019s no way around it \u2013 regardless of experience level, people consistently copy and paste code samples. We can\u2019t fight it, but we can use code blocks that are complete enough to work even when directly copy-pasted, or that indicate what to do to make them work.&nbsp;<\/p>\n\n\n\n<p>As Chris Chinchilla points out in <a href=\"https:\/\/chrischinchilla.com\/books\/\" target=\"_blank\" rel=\"noreferrer noopener\">&#8220;Technical Writing for Software Development&#8221;<\/a>, developers frequently copy and paste a series of code snippets into an editor because it&#8217;s a fundamental part of learning.<br><\/p>\n\n\n\n<ol start=\"3\">\n<li><strong>Different strokes for different folks<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Code samples serve as learning material, and, like any other learning resource, one size does not fit all \u2013 <a href=\"https:\/\/bau.edu\/blog\/types-of-learning-styles\/\" target=\"_blank\" rel=\"noreferrer noopener\">different learning styles<\/a> call for different examples. Beginners might need step-by-step breakdowns, while expert developers might prefer more comprehensive examples that they can tweak to fit their own needs without much hassle.<\/p>\n\n\n\n<ol start=\"4\">\n<li><strong>Complementary tools<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Swagger specs and Postman collections are great companions to documentation, but not replacements. They help users move from learning to doing, once the concepts are clear.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code block maintenance: The hidden challenge<\/h2>\n\n\n\n<p>As products evolve, keeping code samples up to date is crucial \u2013 and challenging.<\/p>\n\n\n\n<ul>\n<li>How can you efficiently update examples across documentation?<\/li>\n\n\n\n<li>When should you remove or deprecate outdated examples?<\/li>\n\n\n\n<li>What are the best strategies for version management?<\/li>\n<\/ul>\n\n\n\n<p>These challenges aren&#8217;t new to us at JetBrains. We&#8217;ve explored several automation strategies in our <a href=\"https:\/\/blog.jetbrains.com\/writerside\/2022\/01\/the-holy-grail-of-always-up-to-date-documentation\/#automate-wisely\" target=\"_blank\" rel=\"noreferrer noopener\">previous post about keeping documentation up to date<\/a>. Building on those insights, we\u2019re now focusing on code sample maintenance.<\/p>\n\n\n\n<p>Chris Chinchilla, in his recent book, outlines two approaches to documentation testing:<\/p>\n\n\n\n<ul>\n<li><strong>Manual testing<\/strong>: Writers regularly verify examples from a newcomer&#8217;s perspective.<\/li>\n\n\n\n<li><strong>Automated testing<\/strong>: Tests are integrated into CI\/CD pipelines for continuous verification.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>Another approach, called <a href=\"https:\/\/www.docsastests.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Docs as Tests<\/a>, is being actively explored by Manny Silva. We highly recommend checking out both Chris\u2019s book and Manny&#8217;s project for further inspiration.<\/p>\n\n\n\n<p>As we continue to evolve Writerside\u2019s code sample capabilities, we\u2019re keeping this lesson in mind: <mark style=\"background-color:#ffe394\" class=\"has-inline-color\">the best features aren\u2019t always the flashiest \u2013 they&#8217;re the ones that help writers meet their readers\u2019 needs, whoever those readers may be.<\/mark><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">New in Writerside EAP 9: Code block enhancements<\/h2>\n\n\n\n<p>The latest Writerside release focuses on practical improvements that directly address common challenges with code blocks:<\/p>\n\n\n\n<p><strong>External code block references<\/strong> provides a single source of truth for code samples, reducing maintenance overhead.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/lana_codeblocks_src.mp4\"><\/video><\/figure>\n\n\n\n<p><strong>Enhanced language support<\/strong> ensures accurate syntax highlighting across more programming languages.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/lana_codeblocks_highligting.mp4\"><\/video><\/figure>\n\n\n\n<p><strong>Native support for .puml and .mermaid files<\/strong> streamlines the integration of diagrams with code samples.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/11\/lana_codeblocks_mermaid.mp4\"><\/video><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Working with code samples? Help us stay up to date<\/h3>\n\n\n\n<p>We&#8217;ve learned that the best documentation improvements come from understanding real-world needs. Have you faced challenges with code samples in documentation? Which features make a difference in your daily work? <\/p>\n\n\n\n<p>Whether you&#8217;re a technical writer crafting examples or a software developer, we&#8217;d love to hear your perspective. Join the conversation in our Slack community and help shape the future of code samples in Writerside.<\/p>\n\n\n    <div class=\"buttons\">\n        <div class=\"buttons__row\">\n                                                <a href=\"https:\/\/jb.gg\/WRS_Slack\" class=\"btn btn--transparent\" target=\"_blank\" rel=\"noopener\">Join our Slack community ?<\/a>\n                                    <\/div>\n    <\/div>\n\n\n\n\n\n\n\n<h2 class=\"wp-block-heading\">But wait, there are more features and improvements!<\/h2>\n\n\n\n<p>Writerside EAP 9 offers more than just improved code blocks:<\/p>\n\n\n\n<ul>\n<li><strong>PDF CLI<\/strong>: Our builder can now produce PDFs alongside the web output.<\/li>\n\n\n\n<li><strong>The Good Docs integration<\/strong>: We\u2019ve improved <a href=\"https:\/\/blog.jetbrains.com\/writerside\/2024\/09\/new-in-writerside-the-good-docs-project-templates-right-in-your-editor\/\" target=\"_blank\" rel=\"noreferrer noopener\">our recent integration of The Good Docs project templates<\/a>.<\/li>\n\n\n\n<li><strong>API documentation generation<\/strong>: You can now generate API docs as a new instance.<\/li>\n\n\n\n<li><strong>Table of contents<\/strong>: This long-awaited feature provides a table of contents for topics with API docs.<\/li>\n\n\n\n<li><strong>Multi-specification support<\/strong>: Generate documentation from multiple specification files.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>? <a href=\"https:\/\/www.jetbrains.com\/help\/writerside\/21565.html#other-fixes-and-improvements\" target=\"_blank\" rel=\"noreferrer noopener\">Read the full release notes<\/a><\/p>\n\n\n\n<p>We hope you like the new features. If you have feedback or ideas on how to make Writerside better, we\u2019d love to hear from you!<\/p>\n\n\n    <div class=\"buttons\">\n        <div class=\"buttons__row\">\n                                                <a href=\"https:\/\/jb.gg\/WRS_Slack\" class=\"btn btn--transparent\" target=\"_blank\" rel=\"noopener\">Join our Slack community<\/a>\n                                                                <a href=\"https:\/\/jetbrains.com\/writerside\/download\" class=\"btn \" target=\"_blank\" rel=\"noopener\">? Download Writerside ?<\/a>\n                                    <\/div>\n    <\/div>\n\n\n\n\n\n\n\n\n\n\n","protected":false},"author":1318,"featured_media":524873,"comment_status":"closed","ping_status":"closed","template":"","categories":[],"tags":[600,76,7079],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/writerside\/524824"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/writerside"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/writerside"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/1318"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=524824"}],"version-history":[{"count":9,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/writerside\/524824\/revisions"}],"predecessor-version":[{"id":525171,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/writerside\/524824\/revisions\/525171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/524873"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=524824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=524824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=524824"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=524824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}