Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: All Markdown in track definitions should lint properly #150

Closed
coriolinus opened this issue Nov 26, 2020 · 11 comments
Closed

lint: All Markdown in track definitions should lint properly #150

coriolinus opened this issue Nov 26, 2020 · 11 comments
Labels
cmd: lint kind: feature User-facing enhancement

Comments

@coriolinus
Copy link
Member

In particular, fragments such as introdcution.md, instructions.md, and the like, should have no issues reported by markdownlint or a comparable linter. In particular, that implies these properties:

  • All files begin with a level-1 title
  • No title has a level more than 1 greater than the previous title

Why?

  • It's easier for file authors to ensure their files are valid if they can run a lint locally
  • Ensuring a consistent style makes things faster for everyone
  • There's already been some discussion about what makes a Markdown document valid

Why not?

  • We need to change the site templates, which right now inject their own titles
  • We need to batch-update all existing markdown files
  • We need to apply a (pretty trivial) transformation to the markdown files to normalize the headings when they're injected into a larger file

Even so

In my opinion, the benefits outweigh the drawbacks. We have some temporary pain while we update existing files, but from then on, it becomes easier to work with markdown to ensure that the editing experience is smooth and the rendered content is consistent.

@iHiD
Copy link
Member

iHiD commented Jan 28, 2021

Sorry @coriolinus. I missed this. I'll move it to a different repo (as this is closing) and reply next week.

@iHiD iHiD transferred this issue from exercism/v3 Jan 28, 2021
@iHiD
Copy link
Member

iHiD commented Feb 3, 2021

@coriolinus For your first rule, are you happy to change it to

  • Any initial title must be level-1 title

Not all documents should have a heading, but if they do, I'm ok with that heading always being a #.

@coriolinus
Copy link
Member Author

Honestly, my goal is to stop markdownlint from complaining. There are at least two different markdownlint implementations, but they share that rule: 1 2.

It's not obvious to me which templates don't work properly with a top-level header. What would be an example?

@iHiD
Copy link
Member

iHiD commented Feb 3, 2021

Yeah, so basically every file would need that top level heading removed from it before it's rendered. That already happens in lots of places in the UI, where the docs are used for content but not headings.

Take as an example:

The heading on the website is unrelated to the content in the document. In v3 this becomes more acute as things like READMEs are generated from lots of files being pieced together, with various headings conditionally inserted.


So a proposal that would work for me is that we say every document must start with # but that all # will always be removed before being rendered. I could probably get behind that, although it'll potentially mean some cleanup of existing files (but a lot of that is happening anyway with the evolution of exercises in v3)

@coriolinus
Copy link
Member Author

So, in the rendered contact page, there is in fact a header directly above the content. I don't know if that's hardcoded right now or what, but long-term, it seems to me that just rendering that header from the markdown file wouldn't cause huge issues.

Still, I'd rather incremental improvements over all-or-nothing. Would it work for you if the policy were: every document must start with #, but that some # may be removed pre-rendering? As a practical matter, we could universally trim them at least at first, but this wording of the policy means that we can incrementally move to rendering the headers properly.

@iHiD
Copy link
Member

iHiD commented Feb 3, 2021

So, in the rendered contact page, there is in fact a header directly above the content. I don't know if that's hardcoded right now or what

It's hardcoded yes. A blog is maybe another good example, where the header is separated from the content by quite a lot of "noise" (e.g. a video) in v3, so it can't be just parsed as the markdown. In that example,

it seems to me that just rendering that header from the markdown file wouldn't cause huge issues.

it probably wouldn't here, but in other places, it wouldn't work.

To be clear, I don't mind stripping the headers out at the website level. I just don't really want different rules for different files, as that gets really complex quickly at the website end. So as long as we have a "global' rule, I'm ok.


In parallel to posting here, I've also spent some time bouncing this 1-1 with a few people (easier than doing it in here where it would probably have degraded into people taking "sides").

I can get consensus for:

  • All docs start with a level-1 title. This is removed before it gets into the "Exercism" website/CLI/etc. So level-1 headings are there purely there for consumers on GH.
  • No title has a level more than 1 greater than the previous title
  • Use h2 - h4 for semantic headings. (I don't think we need more than 3 layers of nesting)
  • We add this to linting rules in conflglet etc

I think there are three categories of docs that get "used" in Exercism:

  1. Problem Specs docs (e.g. description.md)
  2. Website Copy docs (e.g. contact.md)
  3. Track docs (e.g. TESTS.md)
  • 1 can be handled by crowd-sourcing people checking the descriptions. We can put a project together for this and ask people for help. It's a relatively trivial job to do each individual one, so good low-hanging fruit for contributors.
  • 2 is trivial - I'll do it.
  • 3 is going to be largely addressed by the ensuing chaos of Document practice exercise files docs#36 (still WIP - comments welcome) anyway, so we can work it out as part of that.

@coriolinus If you're happy with this, I'll put together a "clean" issue and check no-one majorly objects, and then we can update the docs etc, and Erik can do his thing of script-PRing everything :)

Thanks for raising this :)

@coriolinus
Copy link
Member Author

coriolinus commented Feb 3, 2021 via email

iHiD added a commit to exercism/docs that referenced this issue Feb 3, 2021
This adds a markdown specification document. Please see exercism/configlet#150 (comment) for the rationale of these choices.
@iHiD
Copy link
Member

iHiD commented Feb 3, 2021

Added here: exercism/docs#38 🙂

@iHiD
Copy link
Member

iHiD commented Feb 3, 2021

ErikSchierboom added a commit to ErikSchierboom/fsharp that referenced this issue Feb 4, 2021
ErikSchierboom added a commit to ErikSchierboom/fsharp that referenced this issue Feb 4, 2021
ErikSchierboom added a commit to ErikSchierboom/fsharp that referenced this issue Feb 4, 2021
iHiD added a commit to exercism/docs that referenced this issue Feb 4, 2021
* Create markdown specification document

This adds a markdown specification document. Please see exercism/configlet#150 (comment) for the rationale of these choices.

* Update contributing/standards/markdown.md

Co-authored-by: Sascha Mann <git@mail.saschamann.eu>

* Link to Markdown standards in linting rules

* Update contributing/standards/markdown.md

Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>

Co-authored-by: Sascha Mann <git@mail.saschamann.eu>
Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
ErikSchierboom added a commit to ErikSchierboom/fsharp that referenced this issue Feb 5, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 (comment) for the rationale of these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
ErikSchierboom added a commit to ErikSchierboom/fsharp that referenced this issue Feb 5, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 (comment) for the rationale of these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
ErikSchierboom added a commit to ErikSchierboom/fsharp that referenced this issue Feb 5, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 (comment) for the rationale of these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
ErikSchierboom added a commit to ErikSchierboom/fsharp that referenced this issue Feb 5, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 (comment) for the rationale of these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD added a commit to exercism/docs that referenced this issue Feb 5, 2021
* Create markdown specification document

This adds a markdown specification document. Please see exercism/configlet#150 (comment) for the rationale of these choices.

* Update contributing/standards/markdown.md

Co-authored-by: Sascha Mann <git@mail.saschamann.eu>

* Add markdown one-line-per-line layout rule

* Update contributing/standards/markdown.md

Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>

* Update contributing/standards/markdown.md

Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>

* Add linting rules (#45)

* Add linting rules

* Update contributing/standards/markdown.md

Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>

Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>

Co-authored-by: Sascha Mann <git@mail.saschamann.eu>
Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
ErikSchierboom added a commit to ErikSchierboom/csharp that referenced this issue Feb 9, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
ErikSchierboom added a commit to ErikSchierboom/csharp that referenced this issue Feb 9, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
ErikSchierboom added a commit to ErikSchierboom/csharp that referenced this issue Feb 9, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
ErikSchierboom added a commit to ErikSchierboom/csharp that referenced this issue Feb 12, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/io that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/j that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/kotlin that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/lfe that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/lua that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/mips that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/nix that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/objective-c that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/ocaml that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/plsql that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/pony that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/powershell that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/purescript that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/racket that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/reasonml that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/scheme that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/sml that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/solidity that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/swift that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/system-verilog that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/vbnet that referenced this issue May 4, 2021
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/vimscript that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
iHiD pushed a commit to exercism/x86-64-assembly that referenced this issue May 4, 2021
* [v3] Add level one headings to Markdown files.

All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).

* [v3] Markdown sub-headings must be parent level incremented by one.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
@ee7 ee7 changed the title All Markdown in track definitions should lint properly lint: All Markdown in track definitions should lint properly May 9, 2021
@ee7
Copy link
Member

ee7 commented May 9, 2021

@ErikSchierboom are we happy to close this now that we have #249 and exercism/docs/building/markdown/markdown.md?

I haven't checked that all the points raised in this issue are addressed in those places.

@ErikSchierboom
Copy link
Member

Yes.

@ee7 ee7 closed this as completed May 9, 2021
@ee7 ee7 added cmd: lint kind: feature User-facing enhancement labels May 10, 2021
topstack1226 added a commit to topstack1226/typescript that referenced this issue Jan 10, 2023
All Markdown files should, from this point on, start with a level one heading.
See exercism/configlet#150 for the rationale behind these changes.

The full specification can be found [here](https://github.com/exercism/docs/blob/main/contributing/standards/markdown.md).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd: lint kind: feature User-facing enhancement
Projects
None yet
Development

No branches or pull requests

4 participants