[GH-ISSUE #66] style: sentence per line #57

Open
opened 2026-03-03 01:23:22 +03:00 by kerem · 11 comments
Owner

Originally created by @igalic on GitHub (Jul 21, 2017).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/66

A lot of VCS backed writing guidelines state: One sentence per line.
A proper editor configuration can make any line-length easy enough on the eyes. But for being able to read a VCS history to a prose text, this style makes most sense.

Is there any way this could be supported?

Originally created by @igalic on GitHub (Jul 21, 2017). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/66 A lot of VCS backed writing guidelines state: One sentence per line. A proper editor configuration can make any line-length easy enough on the eyes. But for being able to read a VCS history to a prose text, this style makes most sense. Is there any way this could be supported?
Author
Owner

@DavidAnson commented on GitHub (Jul 21, 2017):

Seems like this might fit in with #51 as a typography rule.

<!-- gh-comment-id:317040188 --> @DavidAnson commented on GitHub (Jul 21, 2017): Seems like this might fit in with #51 as a typography rule.
Author
Owner

@andrewrynhard commented on GitHub (Aug 17, 2019):

Is there a way to achieve this with markdownlint today? This issue is a bit dated.

<!-- gh-comment-id:522221166 --> @andrewrynhard commented on GitHub (Aug 17, 2019): Is there a way to achieve this with markdownlint today? This issue is a bit dated.
Author
Owner

@DavidAnson commented on GitHub (Aug 17, 2019):

I think that’s what this custom rule does: https://github.com/JoshuaKGoldberg/sentences-per-line

<!-- gh-comment-id:522250990 --> @DavidAnson commented on GitHub (Aug 17, 2019): I think that’s what this custom rule does: https://github.com/JoshuaKGoldberg/sentences-per-line
Author
Owner

@igalic commented on GitHub (Nov 7, 2019):

There's also https://sembr.org/ these days, which formalizes what i'm asking for…!

<!-- gh-comment-id:551033661 --> @igalic commented on GitHub (Nov 7, 2019): There's also https://sembr.org/ these days, which formalizes what i'm asking for…!
Author
Owner

@Alexander-Serov commented on GitHub (Jun 13, 2022):

I think that’s what this custom rule does: https://github.com/JoshuaKGoldberg/sentences-per-line

I see this issue from 2017 is still open (😀), so I would like to ask a question.
I see a custom rule has been provided above that allows one to achieve the desired behavior.
But it is still unclear to me how this can be integrated into a pre-commit config.
I have tried to provide the --rule argument in the pre-commit config or to provide "rules" or "customRules" property in the .markdownlint.json, but this seems to have no effect: my sentences are still formatted densely in each paragraph. Could you tell me what am I missing? Is there also a list of all options that .markdownlint.json accepts? I haven't been able to find an exhaustive list.

To provide more details, this is the last config of the .markdownlint.json that I have tried:

{
  "default": true,
  "first-heading-h1": false,
  "hr-style": false,
  "line-length": false,
  "no-duplicate-heading": false,
  "no-inline-html": {
    "allowed_elements": ["br", "sup", "sub", "img", "script"]
  },
  "ol-prefix": false,
  "rules": [
    "https://github.com/JoshuaKGoldberg/sentences-per-line/blob/master/index.js"
  ]
}

The pre-commit option I have tried:

  - repo: https://github.com/DavidAnson/markdownlint-cli2
    rev: v0.2.0
    hooks:
      - id: markdownlint-cli2
        name: markdownlint-cli2
        description: "Checks the style of Markdown/CommonMark files."
        entry: markdownlint-cli2
        language: node
        types: [markdown]
        minimum_pre_commit_version: 0.15.0
        args:
          [
            --rules="https://github.com/JoshuaKGoldberg/sentences-per-line/blob/master/index.js",
          ]

But no luck.
Thanks!

<!-- gh-comment-id:1153939952 --> @Alexander-Serov commented on GitHub (Jun 13, 2022): > I think that’s what this custom rule does: https://github.com/JoshuaKGoldberg/sentences-per-line I see this issue from 2017 is still open (😀), so I would like to ask a question. I see a custom rule has been provided above that allows one to achieve the desired behavior. But it is still unclear to me how this can be integrated into a pre-commit config. I have tried to provide the --rule argument in the pre-commit config or to provide "rules" or "customRules" property in the `.markdownlint.json`, but this seems to have no effect: my sentences are still formatted densely in each paragraph. Could you tell me what am I missing? Is there also a list of all options that `.markdownlint.json` accepts? I haven't been able to find an exhaustive list. To provide more details, this is the last config of the `.markdownlint.json` that I have tried: ``` { "default": true, "first-heading-h1": false, "hr-style": false, "line-length": false, "no-duplicate-heading": false, "no-inline-html": { "allowed_elements": ["br", "sup", "sub", "img", "script"] }, "ol-prefix": false, "rules": [ "https://github.com/JoshuaKGoldberg/sentences-per-line/blob/master/index.js" ] } ``` The pre-commit option I have tried: ``` - repo: https://github.com/DavidAnson/markdownlint-cli2 rev: v0.2.0 hooks: - id: markdownlint-cli2 name: markdownlint-cli2 description: "Checks the style of Markdown/CommonMark files." entry: markdownlint-cli2 language: node types: [markdown] minimum_pre_commit_version: 0.15.0 args: [ --rules="https://github.com/JoshuaKGoldberg/sentences-per-line/blob/master/index.js", ] ``` But no luck. Thanks!
Author
Owner

@DavidAnson commented on GitHub (Jun 13, 2022):

It looks like you mean to use .markdownlint-cli2.jsonc. Here's an example of how that is structured: https://github.com/DavidAnson/markdownlint-cli2/blob/main/test/markdownlint-cli2-jsonc-example/.markdownlint-cli2.jsonc

<!-- gh-comment-id:1154213037 --> @DavidAnson commented on GitHub (Jun 13, 2022): It looks like you mean to use `.markdownlint-cli2.jsonc`. Here's an example of how that is structured: https://github.com/DavidAnson/markdownlint-cli2/blob/main/test/markdownlint-cli2-jsonc-example/.markdownlint-cli2.jsonc
Author
Owner

@DavidAnson commented on GitHub (Jun 13, 2022):

@Alexander-Serov ... and documentation here: https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc

<!-- gh-comment-id:1154214021 --> @DavidAnson commented on GitHub (Jun 13, 2022): @Alexander-Serov ... and documentation here: https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc
Author
Owner

@aepfli commented on GitHub (Feb 13, 2023):

Although there is already https://github.com/JoshuaKGoldberg/sentences-per-line will there be a chance that this will get integrated into markdown-lint directly (mainly because we're using just the docker image from markdownlint-cli, and it is hard to integrate it without building an own docker-image)?

If yes, and if I have the okay from @JoshuaKGoldberg may I start integrating it into markdown-lint as an optional rule? I do see this requirement more and more often, and I think it would allow a lot of people to use that rule easier more.

I would also make the rule a little bit more configurable, eg. list-of-line-seperators, ignored-words, to make it easier and more flexible to be used, also for other languages, etc.

<!-- gh-comment-id:1427824981 --> @aepfli commented on GitHub (Feb 13, 2023): Although there is already https://github.com/JoshuaKGoldberg/sentences-per-line will there be a chance that this will get integrated into markdown-lint directly (mainly because we're using just the docker image from markdownlint-cli, and it is hard to integrate it without building an own docker-image)? If yes, and if I have the okay from @JoshuaKGoldberg may I start integrating it into markdown-lint as an optional rule? I do see this requirement more and more often, and I think it would allow a lot of people to use that rule easier more. I would also make the rule a little bit more configurable, eg. `list-of-line-seperators`, `ignored-words`, to make it easier and more flexible to be used, also for other languages, etc.
Author
Owner

@JoshuaKGoldberg commented on GitHub (Feb 13, 2023):

Yes, please do! I'd love to not have to maintain sentences-per-line. Moving it into core has been on my todo list for ages but I just haven't had the time. 😄

<!-- gh-comment-id:1427886697 --> @JoshuaKGoldberg commented on GitHub (Feb 13, 2023): Yes, please do! I'd love to not have to maintain `sentences-per-line`. Moving it into core has been on my todo list for _ages_ but I just haven't had the time. 😄
Author
Owner

@DavidAnson commented on GitHub (Feb 13, 2023):

FYI, there are no optional rules built into the library. That may be a policy I have to change someday, but so far everything in the library is on by default. There is a slight caveat here for a couple of rules that are enabled but do nothing in their default configuration. That would be the easiest path here, although I feel kind of like the spirit of this rule belongs as part of the "line length" rule since the two seem mutually exclusive. Unfortunately, I don't think they integrate cleanly from a configuration point of view.

<!-- gh-comment-id:1428315645 --> @DavidAnson commented on GitHub (Feb 13, 2023): FYI, there are no optional rules built into the library. That may be a policy I have to change someday, but so far everything in the library is on by default. There is a slight caveat here for a couple of rules that are enabled but do nothing in their default configuration. That would be the easiest path here, although I feel kind of like the spirit of this rule belongs as part of the "line length" rule since the two seem mutually exclusive. Unfortunately, I don't think they integrate cleanly from a configuration point of view.
Author
Owner

@aepfli commented on GitHub (Feb 14, 2023):

I created a draft pull request (#719 )- where I just played around yesterday and covered many topics. I even added a naive "optional" proposal. I marked the PR as a draft because I don't have much experience with JavaScript/Typescript, and some changes might be controversial (the text for the documentation needs improvement). But I am curious to hear what you think about it. what I should not do, or do instead :)
looking forward to some feedback

<!-- gh-comment-id:1429233963 --> @aepfli commented on GitHub (Feb 14, 2023): I created a draft pull request (#719 )- where I just played around yesterday and covered many topics. I even added a naive "optional" proposal. I marked the PR as a draft because I don't have much experience with JavaScript/Typescript, and some changes might be controversial (the text for the documentation needs improvement). But I am curious to hear what you think about it. what I should not do, or do instead :) looking forward to some feedback
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#57
No description provided.