Problem/Motivation

The current standards does not include Markdown as a documentation file type.

Benefits

If we adopted this change, the Drupal Project would benefit by ...

Three supporters required

  1. https://www.drupal.org/u/quietone (2025-01-29)
  2. https://www.drupal.org/u/baluertl (2025-01-29)
  3. https://www.drupal.org/u/ressa (2025-01-29)

Proposed changes

See the MR

Remaining tasks

  1. Create this issue in the Coding Standards queue, using the defined template
  2. List three supporters
  3. Create a Change Record
  4. Review by the Coding Standards Committee
  5. Coding Standards Committee takes action as required
  6. Tagged with 'Needs documentation edits' if Core is not affected
  7. Discussed by the Core Committer Committee, if it impacts Drupal Core
  8. Documentation updates
    1. Edit all pages
    2. Publish change record
    3. Remove 'Needs documentation edits' tag
  9. If applicable, create follow-up issues for PHPCS rules/sniffs changes

For a fuller explanation of these steps see the Coding Standards project page

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bkline created an issue. See original summary.

bkline’s picture

I would have offered a patch/PR, but the repository, linked as "Browse repository" on the project page, appears to be empty.

bkline’s picture

Issue summary: View changes
drunken monkey’s picture

Agreed, seems like a simple oversight. The “easier viewing on Windows” reasoning is also a bit strange if we then require Unix-style file endings (which the normal Windows editor will just ignore).

Suggested new text:

All documentation files should either have the file name extension ".txt", or be valid Markdown syntax and use the ".md" extension. Also, the file names for such files should be all-caps (for example, "README.txt" instead of "readme.txt") while the extension itself is all-lowercase (that is, "txt" instead of "TXT").

Examples: README.md, INSTALL.md, TODO.txt, CHANGELOG.txt, etc.

drunken monkey’s picture

Issue summary: View changes
Webbeh’s picture

Marking a parent issue on Markdown policy adoption that facilitate direction or movement on this issue.

damienmckenna’s picture

Priority: Normal » Major

+1 for mentioning use of Markdown syntax for README files so people stop pushing back on efforts to update project documentation because it is not inline with our coding standards.

Bumping the priority because the coding standards are 18 months behind the direction core set (#3192842: Make our README more welcoming by converting it into an "entrypoint" into the Drupal ecosystem).

damienmckenna’s picture

How about:

All documentation files should either be in plain text with the file name extension ".txt", or be valid Markdown syntax with the file name extension ".md". The base file names for such files should be all-caps (for example, "README.txt" instead of "readme.txt") while the extension itself is all-lowercase (e.g. "txt" instead of "TXT").

Examples: README.md, INSTALL.md, TODO.txt, CHANGELOG.txt, etc.

bkline’s picture

That language looks fine. Was the link to the Wikipedia article on Markdown dropped intentionally?

damienmckenna’s picture

That was accidental.

All documentation files should either be in plain text with the file name extension ".txt", or be valid Markdown syntax with the file name extension ".md". The base file names for such files should be all-caps (for example, "README.txt" instead of "readme.txt") while the extension itself is all-lowercase (e.g. "txt" instead of "TXT").

Examples: README.md, INSTALL.md, TODO.txt, CHANGELOG.txt, etc.

bkline’s picture

+1

damienmckenna’s picture

Status: Active » Reviewed & tested by the community

Let's RTBC it to get some attention to this as the lack of guidance on this is causing needless pushback.

avpaderno’s picture

The Drupal coding standards has a section about the Markdown coding standards. That should be linked, instead of the Wikipedia article.

bkline’s picture

@apaderno I would agree that at some future time after the dust has settled for the issues linked by that section and the section has some directly usable information (instead of just those links, which is all it has right now) linking to that section might be a good idea. Perhaps linking to both (that section as well as a source of general information about Markdown) would be appropriate when that state has been reached, as the original purpose of providing a link was to help anyone not familiar with Markdown, not to provide guidance on how Markdown should be used in Drupal. At the moment, however, going down the rabbit hole of the Markdown coding standards links leads to a very low useful-signal-to-noise ratio, from the point of view of either question ("What is Markdown?" and "Are there special considerations I should be aware of when using Markdown for documenting Drupal modules?").

damienmckenna’s picture

Agreed with #14; further improvements can be handled later once there's something to link to.

Webbeh’s picture

from the point of view of either question ("What is Markdown?" and "Are there special considerations I should be aware of when using Markdown for documenting Drupal modules?").

I think from this, https://www.drupal.org/node/2562925 could be expanded with that information and linked to the Wikipedia entry (or another URL of expertise, is there a Markdown spec documentation?). Is that an appropriate thing to begin populating documentation on that Coding Standards page now?

avpaderno’s picture

Is that an appropriate thing to begin populating documentation on that Coding Standards page now?

Without an issue that is marked as fixed from users who can mark it as fixed, the coding standards pages cannot be changed.

jonathan1055’s picture

Issue summary: View changes

I have updated the issue summary with the improvements from comments #8 and #10 and a slight reduction of unnecessary words for clearer reading.

The next thing to do will be to use the new Coding Standards issue template being trialed on #3387167: Add an issue template for the Coding Standards project. This contains the new process for getting standards agreed and documentation pages updated.

quietone’s picture

@jonathan1055, thanks for updating the IS.

I haven't found 'all-caps' in a dictionary so am suggesting a change. Also, I don't think the extension includes the '.' nor do I think the examples need to be given twice. So, how about this

Documentation files should either be in plain text with the file name extension "txt", or be valid Markdown syntax with the file name extension "md".

The base file name should be all upper case and the extension itself should be all-lowercase.

Examples: README.md, README.txt, INSTALL.md, TODO.txt, CHANGELOG.txt.

alex.skrypnyk’s picture

Status: Reviewed & tested by the community » Needs work

I have to agree with #13 and disagree with #14, sorry. I do not see a point to linking to Wikipedia and then, later, re-linking to D.O - this feels like following a process for the sake of the process. Majority of developers already know what Markdown is. If we want it to be formatted in a specific way according to Drupal standards, then we have a page for it in D.O. Although that page does not have much right now, it will be filled separately outside of this issue, which is not about the Markdown format but about the file naming conventions.

I'm putting this issue back to Needs work to discuss this more.

mohd sahzad’s picture

Assigned: Unassigned » mohd sahzad
mohd sahzad’s picture

Assigned: mohd sahzad » Unassigned
quietone’s picture

Issue summary: View changes

Updated to use the new coding standards issue template.

Are there changes to be made to "The Module documentation guidelines"?

bkline’s picture

#23 None of which I'm aware. What did you have in mind? This issue assumes that the implication in the module documentation guidelines (that the use of markdown for such documentation is appropriate) is correct.

I had no idea when I pointed out the discrepancy five years ago that it would turn out to be so controversial. 😉

quietone’s picture

Title: Conflict between coding standards and module documentation guidelines on file naming » Add Markdown to list of module documentation file types
Priority: Major » Normal
Issue summary: View changes
Status: Needs work » Active
Issue tags: -markdown, -file names, -Documentation

Yes, let's remove the link to Wikipedia. It could link to something else, but what; GitLab's flavor, CommonMark or something else? So, let's just remove the link all together..

baluertl’s picture

Issue summary: View changes

As an avid documentation person, I support the idea that such a sophisticated software ecosystem as Drupal must embrace and promote a more modern markup format for writing all our valuable documentation.

I can imagine even some automated tools to implement for converting current .txt files into .md files. And of course, the CommonMark initiative is the best option to promote for our community, I believe.

quietone’s picture

ressa’s picture

The README template links to these Markdown resources:

For a quick introduction to Markdown, see Markdown Guide's Basic Syntax or GitLab Flavored Markdown (GLFM) for a more comprehensive run-down. Please also review the Drupal Coding Standards for Markdown files prior to making changes.

https://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or...

I agree that Markdown should be used for documentation files, it's a wonderful format!

PS. Thanks for the link @quietone, I am adding as related, to connect these issues.

ressa’s picture

Status: Active » Needs work

With three supporters, I guess next step is writing a Change Record?

The Process for Changing Coding Standards

  1. Create an issue in the Coding Standards project queue using the provided Coding Standards issue template.
  2. At least two additional active community members (contrib module maintainers, active patch contributors, etc) need to agree to support the change in the form of a comment on the issue.
  3. The issue should have a change record. <<<< We are here

    [...]

From https://www.drupal.org/project/coding_standards

quietone’s picture

Issue summary: View changes

@ressa, yes, the change record is next.

quietone’s picture

Issue tags: +Needs change record
anicoto’s picture

Hi my name is Ana (@anilu) and we are at Drupalcon Atlanta mentored contribution workshop and are working in documentation for Media core module

derrekc’s picture

Hi -- my name is Derrek (@derrekc) and we are at DrupalCon ATL.
Mentored by @anilu

anicoto’s picture

Documentation to complete this ticket can be found in the ticket tags > about tags https://www.drupal.org/list-changes/drupal

derrekc’s picture

Issue summary: View changes

Here is the "Change Record" link:
https://www.drupal.org/node/3515822

avpaderno’s picture

Description:
Please modify the Drupal coding standards to bring them in line with the rest of the Drupal ecosystem, and reflect the encouragement of the use of markdown documentation files for Drupal projects.

That is not the description for a change record. A change record describes the change done; it does not ask to modify something.

avpaderno’s picture

See the existing Coding Standards change record, such as The "short ternary" operator "?:" must be used where the first operand of a ternary expression matches the condition, or Use UpperCamelCase for enum and enum case values, which are not created as Drupal core change records.

anicoto’s picture

Thanks @avpaderno, we are still working on this issue. We are at the mentoring room at Drupalcon Atlantla working on this. The change record is still in draft version but we have completed the requested change to the documentation in https://www.drupal.org/node/161085#readme

Thanks for the direction for next steps.

mserven’s picture

I am working on the at DC ATL 25 with derrekc; being mentored by anilu@

mtalai’s picture

I'm working on this issue with with @derrekc at ATL 25; being mentored by @anilu

jonathan1055’s picture

If any of the new people recently commenting and working on this issue would like to contribute here, then issue summary needs to have the "Benefts" section filled in. Currently it only has the original text from in the template:

If we adopted this change, the Drupal Project would benefit by ...

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs change record

Took another look at this today. @jonathan1055, is correct that completing that issue summary would help. However, and in hindsight, I don't think we need to go through the Coding Standards process because this is simply bring this documentation up to date with current practice. The full process is needed for changes to the standards not making corrections in the documentation.

I have created an MR for this and changing to NR.

drunken monkey’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good to me!

  • quietone committed 390f7b1b on main
    Issue #3012906 by bkline, damienmckenna, jonathan1055, drunkenmonkey,...

quietone’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

I have deleted the change record since it is not needed. And updated credit to include those from Drupalcon Atlanta who worked on the change record.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

jonathan1055’s picture

I tried to find this new page in the documentation site, I browsed looking for 'documentation' but could see nothing. Eventually I resorted to looking at the commit above, to see that it is in docs/php/coding.md so then I went back to the Doc site, opened the PHP section and still hade to scroll and search until I found it.

The paragraph is called 'File Names" but it only talks about documentaion pages, so its not really related to PHP at all. Maybe there should be a new top-level "Documentation" menu item for this kind of standard? The MR was only opened after most of the discussion above, and I'm sorry I did not get back to this issue and raise this question quickly. It's not a big problem. Do we have a general issue open for restructuring the menu, etc, or maybe there are other migration tasks still to be done first?

quietone’s picture

@jonathan1055, can you open a new issue for #49? Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.