|
| 1 | +--- |
| 2 | +title: How to write READMEs |
| 3 | +description: A guide in my new Starlight docs site. |
| 4 | +--- |
| 5 | + |
| 6 | +## Before you start writing |
| 7 | + |
| 8 | +- We write our READMEs to be approachable to hobbyists. Keep your words simple, |
| 9 | + but it's ok to make assumptions about the technologies they know. |
| 10 | +- Our libraries are often useful to advanced developers too. Make sure there |
| 11 | + are sections that speak more directly to their language and needs. Help them |
| 12 | + skip over basic explanations they don't need to go to what interests them. |
| 13 | + |
| 14 | +## Sections |
| 15 | + |
| 16 | +### Intro |
| 17 | + |
| 18 | +- Project banner |
| 19 | +- Few words description of what the library does |
| 20 | +- Technologies used and other badges |
| 21 | + |
| 22 | +## About this library |
| 23 | + |
| 24 | +### What does `[library-name]` do? |
| 25 | + |
| 26 | +- Simple explanation (couple short sentence) for a fannish person stumbling upon |
| 27 | + the repo. |
| 28 | +- A few more sentences that mention technical terms so experienced folks can |
| 29 | + pattern-match and really understand if it does what they seek. |
| 30 | +- Make sure you namedrop and link to the relevant technologies. For example, |
| 31 | + if it's an Astro Integration, make sure you link to Astro. |
| 32 | + |
| 33 | +### Inside you'll find... |
| 34 | + |
| 35 | +- A quick list of the major components of this library. Once again, make sure |
| 36 | + it's understandable to a hobbyist for whom the library is relevant. |
| 37 | + |
| 38 | +### What can you build with `[library-name]`? |
| 39 | + |
| 40 | +Alternatively: What can you do with `[library-name]`? |
| 41 | + |
| 42 | +- Think about the major categories of applications that the library enables, building |
| 43 | + from the simplest cases, to those that require more configurations. |
| 44 | +- List items should state the general concept first, then go into practical examples. |
| 45 | + For example, "read the data on a visitor's PDS, so you can create comment sections, |
| 46 | + or guestbooks, or..." |
| 47 | + |
| 48 | +## How to use `[library-name]` |
| 49 | + |
| 50 | +If we have examples, this may be a good place to add a note like "learn better |
| 51 | +with examples? Skip directly to the examples section (link) or look for them in |
| 52 | +[`folder/path`] (link) |
| 53 | + |
| 54 | +### Prerequisites |
| 55 | + |
| 56 | +- Anything the library assumes is already there. For example, make sure your Astro |
| 57 | + site is configured, that it has server mode, and have Astro sessions enabled. |
| 58 | +- If we have any guide that would help getting folks started, this is a good |
| 59 | + place to link to them. |
| 60 | + |
| 61 | +### Installation & Requirements |
| 62 | + |
| 63 | +- The install command. We should use `npm` and assume everyone who's using a |
| 64 | + different one is aware they can use another. |
| 65 | +- If other special libraries must be installed, this is also a place to mention |
| 66 | + them. |
| 67 | +- If a library should already be installed by the time a user finds a use for |
| 68 | + the library, it would go in pre-requisites instead. |
| 69 | + |
| 70 | +### Configuring `[library-name]` |
| 71 | + |
| 72 | +Start with easy to follow steps: |
| 73 | + |
| 74 | +- Quick steps needed for the base configuration, in numbered bullet points |
| 75 | +- You don't have to show everything that's possible, just do a quick |
| 76 | + list for the minimum required setup |
| 77 | +- Try not to skip steps. If something needs e.g. importing, mention it |
| 78 | +- If choices need to be made, give a quick explanation of what they are |
| 79 | + and influence, and a reccommendation to get started |
| 80 | +- You can add optional steps for common use cases |
| 81 | + |
| 82 | +Then do a full example: |
| 83 | + |
| 84 | +- Finish with an example, as copy/pastable then easy to fill |
| 85 | + as possible. For example, prefer writing `"your_string_here"` to |
| 86 | + just leaving a comment, so someone who copy pastes can just double |
| 87 | + click and replace. |
| 88 | +- In the example, you can reiterate minimum requirements and |
| 89 | + choices to be made using comments |
| 90 | +- The example should be simple, but you can add configuration options |
| 91 | + if it helps illustrate what's possible, even if they're not required. |
| 92 | + |
| 93 | +At the end, redirect to a configuration section (or site) for further |
| 94 | +options. You can tease what those options will enable, so folks know |
| 95 | +whether it's worth going there. |
| 96 | + |
| 97 | +If there are multiple independent sections (e.g. configure the client |
| 98 | +and then configure the server), you should split those up in their own |
| 99 | +subsections. |
| 100 | + |
| 101 | +### Using `[library-name]` |
| 102 | + |
| 103 | +- Note that to see this in action, people can go directly to the |
| 104 | + example folder |
| 105 | +- Start by highlighting things you get out of the box |
| 106 | +- If there are more involved usages, create subsections with descriptive |
| 107 | + titles |
| 108 | +- Make sure you redirect users to practical examples throughout (link |
| 109 | + directly to the appropriate lines) |
| 110 | + |
| 111 | +## Configuration Options |
| 112 | + |
| 113 | +TODO |
0 commit comments