There was a recent discussion about README.txt files in #drupal, and I figured it was time to reinvigorate the README.txt discussion. It appears, however, that one person (hello, you-know-who-you-are! ;)) has been promoting a README.txt that /is not like anything core has ever done/, as seen in the links to examples or as "an increasing list of modules" (which all happen to be maintained or contributed to by the same person, thus making the claim slightly disingenuous).
I submit that the README.txt file this person promotes is entirely wrong.
Why? Simply because it looks absolutely nothing like core's equivalent and, in the absence of a standard, "doing what core does" is the guide. Therefore, as a counter claim, I submit:
- README.txt (and other .txt files) should look like core's INSTALL.txt.
- CHANGELOG.txt should be inspired by core (core, due to its size, shouldn't list issue numbers for every little thing that it fixes but, for modules, this is actually a very good thing).
Some examples of modules (all ones I have contributed to, or maintain) that follow core's guidelines:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/bot/README....
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/bot/CHANGEL...
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/casetracker...

Comments
+1 for this proposal on
+1 for this proposal on README.txt
I didn't realise modules should also include a CHANGELOG.txt, though core does, and conrtib should really follow core. So I'm not against this one either.
Cheers,
Stella
With that said, contrib
With that said, contrib modules, IMO, should NOT have a MAINTAINERS.txt, for much the same reason as the "module CHANGELOGs.txt should be different than core": "Finally, there's not a whole lot of rationale to have a CREDITS.txt and a MAINTAINER.txt in a contrib module - certainly, yes, it's "like core", but core is a lot bigger and maintained by far more people, which justifies their existence. Move the contents of your versions into your README.txt and get rid of 'em" -- chx and my http://www.drupaltoughlove.com/review/printer-friendly-pages.
It works.
cough contribisnotcore cough... In the example above, INSTALL.txt from core is compared to a README.txt from contrib - that's like comparing apples and oranges.
Given these arguments along with my experience in contrib, I cannot see a reason why this README.txt structure, layout and contents should be wrong. Morbus, if you know better, then start with fair criticism instead of complaining, please. ;) There is always room for improvement.
Daniel F. Kudwien
unleashed mind
Daniel F. Kudwien
netzstrategen
So to turn examples into guidelines ...
I've got half a mind to say we are all grown up enough to use HTML layouts for documentation in this century ... but that discussion will probably hurt, and yes, I occasionally open up the install instructions in a text shell ;-)
Anyway, I'm also in favor of the core/morbus examples.
...
Verbatim code/commands indented?
Reference URLS always unannotated on their own lines?
What are the expected sections?
I kinda liked full-width or at least fixed-width --- dividers, but I don't mind.
... can we start leaving out the normal 'installation' download/unzip/enable instructions unless there are pre-requisites?
No subheadings? If I need subheadings, I usually refer to another document, a bundled HTML.
LOL - sun, please.
LOL - sun, please. Suggesting "I've made more modules than you" as an indication of a stronger argument is entirely irrelevant (and yes, linking to my project page is indicative of that statement) - it's about as useful as me saying I've been a Drupal member two years longer than you, and run a site with chx anally ripping apart errors in modules. A five minute glance at admin_menu shows some stylistic "do what core does" errors I wouldn't have made already (@file needs to be one line, your "admin/settings/admin_menu" help needs a [p] around it).
Anyways. I'm not commenting on the content of your docs, but on its stylistic format.
I'm not comparing "INSTALL.txt" to "README.txt" - I'm comparing the format of core's largest documentation file (being INSTALL.txt, because there IS NO README.txt) to the format of a module's largest documentation file (being README.txt, since there's little need for anything else). The apples and oranges comparison is apt if I were comparing content, but I'm not - I'm comparing formatting.
I'll happily concede that "Most contributed modules do not need to re-explain common installation instructions again." However, note that your 6.x version of admin_menu links to a page that only describes Drupal 5 and 4.7 module installation instructions. When I, the module creator, and not the Drupal documentation team, am the primary method of support for a module, I would like utter control over all my documentation. (Yes, the instructions are nearly exactly the same for Drupal 6.x, but it's not very friendly when the first thing a user asks is "where's the install docs for 6?" and then blindly hopes that the 5.x version will work).
"Modules that require further installation steps can add them before or after the common steps." Yes, exactly. No complaint there. Well, accept that your extra steps use two carets "Administer >> User management >> Permissions >> admin_menu" when a) core only uses one and b) the "common installation instructions" use only one.
Why "-- SUMMARY --" and not core's format of "WORD\n===="?
Why document something that doesn't matter, such as the "None" for "Requirements"?
Why include HTML [code]/[/code] in the .txt file when it's plain text, not HTML?
Again, my key complaint is not the content of the documentation you've written, but rather, the /format/ of the documentation you've written. What was the logical reasoning besides choosing a different visual format to the ones seen and used within all of core's default text files?
Why "-- SUMMARY --" and not
Because I hate to repeatedly type a character. Even more important, "underlining" a heading is not suitable for any possible syntax/macro processor. Think Markdown, or any other syntax. Also, using "underlines" would mean that you require a specific number of characters in a heading at least. Example?
FAQ===
Markdown uses
# Headingbut such a formatting is not clearly visible in a document like README.txt.
Simple: Because end-users ask this question in the issue queue otherwise.
For the same reasons as above: End-users do not always understand where a code snippet starts and where it ends. So there has to be a delimiter. And <code> is not only one that end-users understand, but would also be compatible when README.txt would be output as a (syntax processed) HTML page.
Aside from that, I recommend
Daniel F. Kudwien
unleashed mind
Daniel F. Kudwien
netzstrategen
Erm. Actually, Markdown
Erm. Actually, Markdown supports Setext headers, and Setext has been around for quite a long time - as far as I can recall, it was one of the first defined text-file formats, in use as far back as 1992. "Any other syntax" tends to refer to wiki-based syntaxes which, due to the traditional lack of monospaced fonts in the textarea, right, navigated to a single character prefix. I'm not sure, however, that wiki-based syntax mentalities for our text files is the right approach. (With that said, I'd be perfectly fine on standardizing on Markdown or Setext for our .txt files.)
So you promote using Drupal Handbooks to replace the install documentation, but not using Drupal core's own handling for module dependency (which a user CAN'T ignore) to replace a REQUIREMENTS header? Or were people asking about JavaScript based requirements?
I disagree with this one - I'm of the mind that a module should ship with all the documentation that is required for its operation. One shoudn't be locked out of learning how to use a module if a) they're not on the Internet (working on a dev site on the plane), or b) drupal.org is suffering technical problems. I'm all for "Using bullet lists in each section. Keeping the information short and simple." though - I heartily agree that the chief barrier to documentation is /reading it/. The more concise documentation is, the better.
Regarding your proposed headings: CONTACT/CREDITS, in my opinion, should be merged into SUMMARY. The contents of CONTACT/CREDITS tends to be small, and doesn't really need its own section, and IMO, contact information should go near the top of the file (Nearly every "thing" I can think of always has contact info near the top, not at the bottom: emails, blogs, articles, etc.). And, I'm assuming that, if a heading doesn't apply, it is considered optional (ie., a new module wouldn't really have a TROUBLESHOOTING or FAQ, since there is no precedence yet)?
Chapters
Well, I could live with Markdown/Setext, too. Actually, I originally tested a few styles and finally chose the
--- HEADING ---style, because I found it to be the most distinguishable (and headings should be distinguishable in text files, too). Also, I wanted to prevent little mistakes like the one I found in lightbox2's README:Inline Content Support=======================
Really, if I read through core's INSTALL.txt or lightbox2's README.txt, I repeatedly need to look up the section I'm currently reading to know which part of the docs I am actually reading. Maybe it's just me, but I have hard times to find the section heading then.
Yes. The requirements section is basically always copied from the project page, where one could read it, too. I often find myself looking into this chapter (again) after extracting a module, just to be sure that I have downloaded all required modules and fulfilled any other requirements, even though I eventually read them on the project page just before. That is, because admin/build/modules takes ages to load on many sites and I try to avoid reloading that page at all costs. However, it's also about major versions of modules. See Image Assist for example: A fresh new 2.x version is in development, which requires additional modules (Views, Token...), but I do not want to list them on the project page and confuse 1.x users yet. So, "read the README.txt to be sure you fulfill the exact requirements of the module you downloaded!"
I totally agree with you. My point is simply to keep the docs short, but precise. Another example: Have a look at the text files shipped with Domain Access module - I have to read a bunch of bloated pages, just to find out that all I have to do is foo and bar, and I'm done. Don't want to blame Ken for this (does an awesome job with this module), but I have noted the actual installation steps separately in the meantime, just to avoid reading them again -- which is the worst effect that can happen to a documentation.
Well, that depends on the module. For example, Image Assist had a lot of maintainers and major contributors over the years, which I want to list (the minimum way of saying Thank you). Also, I usually want to list those institutional parties who made or allowed major contributions/improvements or contributed financially.
But then, I'm changing the perspective again: The end-user is NOT interested in this information in the first place. In reality, it has the least precedence. Users want to learn how to prepare, install, configure, customize, and troubleshoot a module - and after all of that (fails or inspires them), they might want to know the author, resp. current maintainer(s). Providing this information at the top makes it harder to find the important information.
Well - you should reply to all those support requests in my issue queues then. ;) By clearly delimiting code snippets, you can skip those silly and bloating (recall: see above) instructions, where a code begins and ends, aso. Another advantage is that code can be copied & pasted as is, without unnecessary indentation, resp. already having the proper indentation like the surrounding target code (if that applies).
Daniel F. Kudwien
unleashed mind
Daniel F. Kudwien
netzstrategen
Forgot something. Yeah, I'm
Forgot something.
Yeah, I'm not a fan of the use of [code]. Core doesn't use it for the SQL statements one must issue, instead relying on an indent and clear documentation on what to do with the forthcoming indent. I find that cleaner than adding [code]. I don't put a huge amount of weight in the "but an HTML preprocessor will understand it!" cos nothing like that has ever happened, and there are too many other things that an HTML preprocessor WOULDN'T understand (menu items, paths, function calls should be [code], headings should be H1, etc.). If we want the text files to be repurposed in other formats, then we should switch wholesale to a Markdown or Setext, where a backtick (`) would indicate code sections (and could also be used inline).
I usually have a section
I usually have a section called "Known Issues" for certain functionality that isn't cross browser compatible (just js and css stuff), or known module conflicts that can't be fixed from within my module. I guess this might go under the FAQ section in the new proposed section list.
I'm already using core's style for documenting my README.txt. I find it easier to read than sun's proposal, sorry sun!
Example of what I'm currently doing: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/lightbox2/R...
+1 for having a CONTENTS section for outlining the sections included within the README.txt
Gah, yes! I forgot about
Gah, yes! I forgot about CONTENTS. +1 for that too.
Of course, I have to
Of course, I have to disagree on a TOC. My rule of thumb is:
If this text file needs a TOC, then it is simply too large. Consider moving parts of the docs into handbook pages.
We are not trying to write RFCs, or are we? Books usually have a table of contents, but for 2-3 pages of instructions, they are just adding cruft. Additionally, if installation instructions need to be detailed, contrib modules are free to separate them out into a INSTALL.txt.
Daniel F. Kudwien
unleashed mind
Daniel F. Kudwien
netzstrategen
sun, I'm having a tough time
sun, I'm having a tough time "agreeing to disagree" - I'm not sure I can pick
out what you're really saying with all the (to me, at least) contradictions.
You disagree on a TOC, but the use of TOCs in these README's are not to indicate that the text file is "too large", but rather to give an overview of what is available in the documentation. Surely, as one who jests about his support queue, you should see some value in a user opening up your README and /immediately/ seeing that there is a "Troubleshooting" and "FAQ" section when, normally, said user would have to scroll through documentation that they may not, at the moment, care about.
As for the heading style, yeah, I'd have to agree: "it's just you" ;). Statistically speaking, the -- STYLE -- headlines are three lines (assuming two newlines before each section), and the other headlines are four lines (same assumption). Because the fourth line is a set of repeatable characters, which stretches across the length of the header (errors notwithstanding), there is more visual "weight" (how many times do you see ----------- in a file versus the 7-bit ASCII equivalent of an emdash: --), more horizontal whitespace (number of lines), and more vertical whitespace (the number of empty columns) than your variant (which, "it's just me", but gets lost for me quite easily). (And, to be semantically annoying, -- STYLE -- is equivalent to header style 2, which shouldn't exist without a header style 1, which your docs don't have.)
I would also contend that having a TOC increases awareness of headers.
I repeatedly need to look up the section I'm currently reading to know which part of the docs I am actually reading.You're really suggesting that your header format creates an increased awareness of which section someone is in? That's crazy. (I wouldn't even make that same argument about the alternative, and my preferred, header - there's just no basis to it.)I find it also quite difficult to understand your "Yes" to my question about requirements. That totally threw me off - I didn't think you'd actually say "Yes"!. I'm just gonna have to skip over this one and say "Ok, I don't agree.". What I think we can agree on, however, is the need for a REQUIREMENTS section to detail, for example, third party software that can't be shipped with the module (non-GPL, jQuery libraries, GPL-stored-elsewhere, etc.); naturally, core has a REQUIREMENTS so no problemo there.. However, I'd like to make the use of "REQUIREMENTS: None" entirely optional - you can continue to use if it you'd like, but it's not something traditionally recommended. Agree?
As for CONTACT/CREDITS, how about we agree to call it CREDITS? This allows you to maintain your CREDITS as you see fit, but also allows me three possibilities: a) contact info in the SUMMARY; no CREDITS, b) contact info in the SUMMARY; previous maintainers, contributors in the CREDITS, c) CREDITS only. Since the SUMMARY is a free-form bit of text, there's nothing specifically stopping me from putting contact info there. This would keep us both happy, even though I 100% disagree on a few of your statements related to contact info.
I also disagree with your basis for the use of [code]. If you're basing the usage on "my users don't know where code begins or ends", then I contend that you're then assuming that your users DO, in fact, know what [code] is (which makes it even more confusing when you mix the use of [code] as a delimiter with other HTML elements, such as admin_menu's use of [param] in TROUBLESHOOTING, which also destroys any notion of an HTML preprocessor, since [pre], not [code], would keep the [param] in the context you're intending).
As for your comments about indentation, I call foul - you can never assume the user's indentation state: someone could be doing the silly CSS indenting mentioned in the other CSPO topic, the [param] you include (mentioned above) would almost always require some indentation, indenting doesn't matter to any of the places in which you'd copy paste code (CSS, HTML, PHP, JS), and if you're instructing users to modify your source code with custom PHP or JS, then it's actually a better service to let the indentation be wrong so that users can see exactly what they've changed from your raw/released code. You're really not saving the users anything whatsoever by claiming indentation as friendliness.
You agree that modules should ship with complete documentation, but continue to assert that one should "move the docs to the handbook", in cases of commonality (inferred from your "tricked you, docs aren't here, they're at [URL]" installation instructions) or length (as a counter to the [misunderstood] CONTENTS).
The point in a standardized README is not to "write better docs" - that's something that many other documents purport to teach. The point is to make a user's expectation about your README the same as everyone else's README: standalone and stylistically the same (visually, header-wise, etc.). Since the first README-style we can assume a Drupal user to read would be core's INSTALL.txt, all matching documentation should match those stylistic trappings.
Progress
CONTENTS
--------
* Table of contents
* Headings
* Requirements
* Code snippets
* External content
* CVS keywords
TABLE OF CONTENTS
-----------------
* Good arguments for a TOC. Makes sense, although I would add that a TOC should be optional for short READMEs that do not span over multiple pages (hard to measure, I know).
Headings
========
* As mentioned before, I'd be open to adapt a new style for headings. I guess I preferred the --- HEADING --- style, because all chapter contents use bullet lists. Hence, they are visually indented, too.
* Core uses uppercase letters.
* Core uses hivens (instead of equal signs).
-- REQUIREMENTS --
* There is still my point about different major versions. Listing that a module has no requirements lets end-users know that they do not need to prepare anything else for the module (version) they've just downloaded. Today, most modules I download have dependencies or any other requirements, so I expect some for any module. If the README.txt explicitly states that there are no dependencies, then I know I'm prepared to install that module.
* Also, many modules implement optional integration features for other modules, which should be listed in the requirements, too. Otherwise, they would be noted somewhere in between the lines later on.
CODE SNIPPETS
-------------
* Yes, PRE should be used instead of CODE. However, CODE would be more intuitive for end-users. I fear that Markdown's back-tick is easily overlooked. Just indenting code snippets led to support requests.
* Any other ideas?
EXTERNAL CONTENT
----------------
* Common installation steps, which do not differ for all modules, should not be repeated in each and every README.txt. Instead, just provide a link for novice users, and add any special steps before or after the common step(s).
* Advanced and optional configuration or customization steps that need further explanation are better served as handbook pages, because they provide better formatting options. A good example are the handbook pages about advanced configuration of Panels 2 [1]. Such documentation should be linked from the README.txt, but it would make not much sense to include it in a text file.
CVS KEYWORDS
============
* I'd vote for a CVS Id standard in text files, too. I've seen the following styles, but I still have in mind that text documentation files might be processed for HTML output (which is just a matter of time), so only the last of them would work out (under the assumption that CVS Ids should not be displayed in HTML output/API documentation).
/* $Id: README.txt,v 1.12.2.8 2008/04/06 15:08:18 sun Exp $ /
// $Id: README.txt,v 1.12.2.8 2008/04/06 15:08:18 sun Exp $
# $Id: README.txt,v 1.12.2.8 2008/04/06 15:08:18 sun Exp $
$Id: README.txt,v 1.12.2.8 2008/04/06 15:08:18 sun Exp $
<!-- $Id: README.txt,v 1.12.2.8 2008/04/06 15:08:18 sun Exp $ -->
Also, the CVS Id keyword should be placed at the top of a file, to be consistent with all other files in Drupal.
[1] http://drupal.org/node/206185
Last, but not least, following core is right in most cases. However, I do not blindly follow core's style, if there is no standard yet. In this case, core has evolved over time and because of that, core can be out-dated. Just because someone might read core's INSTALL.txt first (which I did not), does not mean that contrib can do better.
Of course, as opposed to above example, text files should wrap at 80 chars.
Daniel F. Kudwien
unleashed mind
Daniel F. Kudwien
netzstrategen
i think the audience of
i think the audience of contrib modules readme's is going to be completely different to the readers of core readmes. (users vs devs)
taking the assumption that 90% of the 'market' are dumb in a particular field, and only 10% know anything in that field (with 1% being the outright genuises), then writing the main readme for the devs is intimidating the 90% mass.
for example, contrib users will need to know what the module does in terms of menus/permissions exposed, what the module does (if someone browses contrib modules section of drupal and dl's 30 modules that sound interesting, they could forget what a particular module does), as well as any special setup instructions, and conflicts (known issues).
i do agree that the docs supplied with the module should be all the instructions that's needed - seeing the readme as one line of: "setup instructions here: 'd.o/node/foo'" makes the life of the developer easier but awkward for the user. however, that doesn't mean that it has to be a blow by blow breakdown of how the module works and justifications for making it work that way, which an interested dev could infer from reading the well commented code. however, referring to a page on do for further non-essential, secondary comments, tips would be useful.
i think the toc is a double edged sword. it's useful to outline what's in the file, but, becomes tiresome if EVERY file was in the same format. but, i also think that the user can scroll down and see the headers so know that there's a troubleshooting content section. i think a toc is overly formalised.
contact info should be in a 'current maintainer' imo: section/one-liner. maybe at the (near to) bottom of the file as your average user isn't going to be contacting you, or even need to know that you made it, so importance slips down. infact does this even need to be in the readme? how about the module.info?
also a link to the project page (did i dl it from do/projects/foobar or do/projects/foo_bar or do/projects/foo-bar ....) would be appreciated.
something i haven't seen mentioned is the diction to be used. non-programming terms should be avoided where possible to allow non-technical users to comprehend and make use of it. verbosity should be kept to a minimum. when writing think "is this word really needed"
eg. i've annoted the bot install intro as someone with low technical ability (modules should still be usable for them):
"The bot.module is not like other Drupal modules [obviously, there's only one bot.module!] and requires a bit more
effort than normal to get going [oh no, am i good enough to install it?do i really need/want this module?]. Unlike a regular Drupal page load [wtf], an
IRC bot has to run forever and [ever and ever?], for reasons best explained elsewhere [what/where? do i need to know, should i google? can i do this?], this
entails running the bot through a shell, NOT through web browser access."
to
"You need shell access to use the bot.module because it has to execute all the time. Before starting installation, please check with your host that this is acceptable. You must not run the bot module from a web browser."
and from what i've learnt, a lot of users aren't even going to be reading the readme, just enabling the module and expecting it to work, so i'd like to suggest that for any special instructions, the user should be pointed to the readme in the module description on the module page (if not currently installed / enabled)
thanks for reading!
There's been no talk of
There's been no talk of diction because, as I've stressed a few times, this has nothing to do with what's being said in the README but, rather, how the README stylistically looks.
Use existing standards!
I really like the idea of using a structured text markup - it could be Markdown or anything really (...I don't care which). This would allow us to easily write scripts to dynamically pull READMEs and INSTALLs into the documentation pages as HTML if desired, without needing to write a bunch of ugly regexps to deal with all sorts of exceptions to some invented 'standard' format.
[edit: reworded after a better reading of the above]
+ Contrib API
Well, yes, this is also my vision. If there will be contrib.api.drupal.org, that was able to benefit from this standard, too.
Daniel F. Kudwien
unleashed mind
Daniel F. Kudwien
netzstrategen
Use existing standards!
agreed 100%
It would be good to apply this all throughout Drupal. For example .info files should be based on a pre-existing standard as well.
No one is reading this.
Have we reached any sort of
Have we reached any sort of consensus on this? What issues are outstanding?
First draft
I've added a documentation page that takes a stab at standardizing README files, and provides a reference for beginner developers creating them for the first time. https://drupal.org/node/2181737
--
David Needham
Team Lead of Training at Datadog
surely we need a "USAGE" / "HOW TO USE" section
Surely we need a "USAGE" / "HOW TO USE" section?
It seems to me that there is a big missing section in the current README, that is, how to actually use the module. OK, you've made sure you've added the Requirements, properly followed the Installation procedure, and the Configuration procedure, you know who Maintains it, but there's not the slightest indication of how to actually USE the module!
For example, think of the Rules or the Views module. You can install it, but then what? You need some guidelines as to what/how you use it. Often this will be a link to Drupal.org page. For some it may be as simple as "go to url ?q=/this_module_thing and select the values you want".
Adding "How To Use" to the README standard
This is exactly my thought. I was recently updating some docs for a module and another contributor recommended modifying the docs to more closely follow the standard. I was very surprised to discover that there is no heading in the standard that deals with actual day-to-day use of the module. I see this as a usability/findability issue. Installation & configuration are one-time/setup issues. If I am a new user of a module, I would not expect to find information about how to use the module within either of those sections.
I'd recommend adding a Usage heading to the README standard, at least as an optional feature.