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

enhancement (docs): Improvements to retext-spell #25290

Open
tesseralis opened this issue Jun 25, 2020 · 34 comments
Open

enhancement (docs): Improvements to retext-spell #25290

tesseralis opened this issue Jun 25, 2020 · 34 comments

Comments

@tesseralis
Copy link
Collaborator

@tesseralis tesseralis commented Jun 25, 2020

Overview

This issue is an overview of improvements to standardizing the spelling and formatting of words in our docs. Fixing these involves going to dictionary.txt and removing unneeded entries.

  1. put filenames like .htaccess in code blocks
  2. put code like inferInputObjectStrctureFromNodes in code blocks
  3. put names of packages (including gatsby plugins like gatsby-source-filesystem) in code blocks
  4. Standardize names of libraries and brands (for example, GraphQL instead of Graphql or graphQL)
  5. some image alt text in tutorial pages are just file names (e.g. ![with-layout2](with-layout2.png))
  6. Add remark-mdx and remove imported components from the dictionary

Note:

  • if the lowercased word in dictionary.txt then both words are valid
  • if only the Capitalized word in dictionary.txt than the lowercased is forbidden
  • to forbid a word or only allow the lowercased word then mark the word with an asterisk (Example: see #25681 for webpack)

Upstream Changes

The following involve changes to retext itself and requires raising issues to that library:

  1. Improve handling of words with numbers in them. "1000px" should be treated as the tokens "1000" and "px".
  2. Improve handling of words-joined-with-dashes. These should be treated as individual words.
  3. Syntax for hashtags

Current Activities

@tesseralis
Copy link
Collaborator Author

@tesseralis tesseralis commented Jun 25, 2020

@robintom
Copy link

@robintom robintom commented Jun 25, 2020

Hi @tesseralis could you please assign this to me? I have been looking to do some open source contributions.

And I am somewhat confused on this issue, would you be able to provide more context for this?

@muescha
Copy link
Collaborator

@muescha muescha commented Jun 25, 2020

@robintom since this issue is like an "umbrella" issue: the best is if you take only one small change at a time (for example put one package in code fences). this is more easy to approve a pull request.

anounce here which change you will do, so others can take an other one.

@FocalChord
Copy link
Collaborator

@FocalChord FocalChord commented Jun 26, 2020

@muescha Hey I will be working on this issue. In particular this part:

  • put filenames like .htaccess in code blocks

Should I open a PR for this particular part and then reference this issue?

See my PR below. Is that alright? (It is my first time contributing so let me know :))

@muescha
Copy link
Collaborator

@muescha muescha commented Jun 26, 2020

@FocalChord great! - i updated the issue text

@FocalChord
Copy link
Collaborator

@FocalChord FocalChord commented Jun 26, 2020

@muescha So for each other sub-issue do I make a seperate branch and then seperate PR?

Also when does the PR get merged in?

@muescha
Copy link
Collaborator

@muescha muescha commented Jun 26, 2020

Hint: searching for text which is not already in code fences in files with RegEx (and File Mask *.md*)

[^`]some-thing[^`] 
[^`]\.htaccess[^`] // with dots

BTW: in WebStorm it shows you a section "Usage in comments" if the text is already in code blocks :)

@muescha
Copy link
Collaborator

@muescha muescha commented Jun 26, 2020

yes - new branch and new PR

it takes some time to get merged, just be patient. the Gatsby team has to approve each PR and with smaller steps this is more easy to check :)

@FocalChord
Copy link
Collaborator

@FocalChord FocalChord commented Jun 26, 2020

@muescha Awesome! Thanks for this :) I'll work on the 2nd, 3rd, 4th bulletpoints soon.

@meyian
Copy link
Collaborator

@meyian meyian commented Jun 27, 2020

Hello @muescha and @FocalChord, I'm new here and I'd like to help. Since the list is being tackled one bullet point at a time, I was thinking I could start on bullet point no. 5.

some image alt text in tutorial pages are just file names (e.g. ![with-layout2](with-layout2.png))

If I understand the task correctly, there are two parts to this:

  • Delete "with-layout2" and other similar lines from dictionary.txt
  • Go through the docs and give better alt text for those images

Do I have the right idea? But before then, is this even a ticket that's looking for help, or should I wait for the next one?

@tesseralis
Copy link
Collaborator Author

@tesseralis tesseralis commented Jun 27, 2020

@meyian Yup! We'd want to add better alt text to the images in the tutorial.

@muescha
Copy link
Collaborator

@muescha muescha commented Jun 27, 2020

i would suggest (for expample for type 1) a PR should only remove one line per dictionary (or like in #25339 similar ones) so PR are small scoped and approved fast.

@muescha
Copy link
Collaborator

@muescha muescha commented Jun 27, 2020

somehow it not catches all places?

i run the lint for #25355 but in not catches for the NPM in:

- helps you leverage open source innovations in the React, NPM, and Gatsby communities for your web projects

update: this is because the heading is marked as SourceNode, i think because of the slashes:

├─29 ParagraphNode
│   └─0 SentenceNode
│       └─0 SourceNode "Backbone.js/Node.js/NPM"

but this get catched:

Node.js, then only a couple of years old, was gaining traction fast. For the first time, NPM enabled the easy sharing of JavaScript libraries. Consequently, the number of libraries exploded. With a server runtime and ecosystem developing around JS, more and more web development tools started being written in JavaScript.

@gdstewart
Copy link

@gdstewart gdstewart commented Jun 29, 2020

Hello! I wouldn't mind helping out too! I'd like to tackle 6 but I'm a bit confused about which imported components are being referred to, is it all imported components or only ones involving remark-mdx?

@kapil-raj
Copy link

@kapil-raj kapil-raj commented Jun 30, 2020

if I understand this correctly, for point 7 we need to edit the dictionary.txt and spilt the text characters from the numbers. Similarly for point 8, we need to split the words with dashes to separate individual words.
Can I work on this :)

@muescha
Copy link
Collaborator

@muescha muescha commented Jun 30, 2020

  1. try out if this working like this.

but:

  1. it is a more general change to the system and i think the hardest one...

(edit: because Markdown parser hier in the comment changed the numbers from 6 to 8 if it is one line behind the seven)

@kapil-raj
Copy link

@kapil-raj kapil-raj commented Jun 30, 2020

okay, I'll start working on these.

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 3, 2020

an other bug:

the spell checker not reach the table content - for example i forbid *AgilityCMS in dictionary, but it not found it in a title in a table cell:

| [AgilityCMS](https://agilitycms.com/) | [guide](/docs/sourcing-from-agilitycms/) | [docs](/packages/@agility/gatsby-source-agilitycms/) | [starter](/starters/agility/agility-gatsby-starter/) |

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 3, 2020

ok - it seems that a table cell is never checked because of:
https://github.com/syntax-tree/mdast-util-to-nlcst/blob/a05338c5aa287885cfa473b4099d51ca42629c64/index.js#L10

var ignore = ['table', 'tableRow', 'tableCell']

i will investigate how it can be done ....

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 4, 2020

suggested solution:

Maybe using remark-rehype and then rehype-retext is better?

i get it done, will file a PR in next days...

@FocalChord
Copy link
Collaborator

@FocalChord FocalChord commented Jul 8, 2020

@muescha I have done a few more issues above :)

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 8, 2020

@FocalChord thanks a lot :)

@meyian
Copy link
Collaborator

@meyian meyian commented Jul 11, 2020

Hello, I had two questions:

@muescha I realize you renamed my pull request. Is getting the right format for pull requests something I can learn?

Then, I pushed some changes to docs/tutorial/part-three/index.md and the build failed, because

warning  `uncentered` is misspelt; did you mean `uncensored`?  uncentered  retext-spell

Would the fix for this be as simple as adding the word "uncentered" to dictionary.txt? Or how else should I address this?

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 11, 2020

PR Title

there are some recommendations for PR titles:

https://www.gatsbyjs.org/contributing/managing-pull-requests/#commit-and-pr-title

i unified a little bit the titles of related PRs of this issue to make it more easy to identify them for the review team.

Uncentered

yes i see it is a new unknown word which you added to the PR, if you are sure that is not a spelling error (like in this case) and not a file name/function name/variable name/package name (put them in code fences) then you can add it to the dictionary.txt.

@marcysutton
Copy link
Contributor

@marcysutton marcysutton commented Jul 17, 2020

I added uncentered to the dictionary as discussed above to keep that PR moving, and it's merged now. Is there anything else left to do on this issue, or can we close it?

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 17, 2020

@marcysutton there are much more entries to clean up in the dictionary.txt, i only placed "current activities to the umbrella issue, because there are 2194 lines in dictionary to check...

@Hina-softwareEngineer
Copy link

@Hina-softwareEngineer Hina-softwareEngineer commented Jul 19, 2020

Hi, I am a beginner and want to contribute here. I am confused. Can someone guide me?

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 21, 2020

@Hina-softwareEngineer you are welcome

Overview

you can start with the docs about contributing and the section Repo Setup

contribution to this issue

  • for this issue you look for only one entry in the dictionary.txt
  • remove this wrong entry or fix this one entry.
  • then run the yarn script lint:docs and see where there are the problems and then fix it (see also Docs Contributions)

@gatsbyjs/learning did i forget an instruction?

@meyian
Copy link
Collaborator

@meyian meyian commented Jul 25, 2020

I just created a PR which removed several words at once, because the first word "allfile-query" appeared in two docs files. In cleaning up the alt text of these files, they had three other wrong dictionary.txt words in common, so I thought it made the most sense to clean up both these files at once and remove any words from dictionary.txt that no longer exist in the docs after this cleanup. I hope I had the right idea, but feel free to let me know if this PR needs splitting up.

@tesseralis: I wanted to edit the Current Activities section in the main comment above and add the new words I was working on, but I wasn't sure if having a PR opened means I check the box next to my entry, or that's only for if the work has been merged in. How does it work?

(Edit: Also, in my PR, I used the "official" camelCase spelling of the word allFile, and now that the linter has run, it's complaining about allFile not being "allfile". What would be the ideal situation in this case. Should I rename allFile to allfile, or would a new dictionary entry be needed to handle the camelCase spelling?)

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 25, 2020

very good!

yes you can edit it :)

  • an empty checkbox means it is not merged.
  • checked entries are merged into the repo

(i just followed the other "Umbrella" Issues (like [Umbrella] TypeScript Migration (Help wanted!) #21995), but to list all dictionary entries here for claiming a word would be a little to much...)

@muescha
Copy link
Collaborator

@muescha muescha commented Jul 25, 2020

allFile

  • i see are all the allFile in your PR are code fences

i tested:

  • this is a "bug" or a feature? - in descriptions the code fences are not recognized and thats why they are not ecluded from checking :/
  • but i think it is a feature, because the alt text can not "enhanced" by markdown stuff (in the github preview of the file the code fences are removed from the image alt text)
@muescha
Copy link
Collaborator

@muescha muescha commented Jul 25, 2020

i would suggest to reword the descriptions so that code fences are not needed
/cc @tesseralis what you suggest?

@meyian
Copy link
Collaborator

@meyian meyian commented Aug 2, 2020

@muescha Okay, no problem. I reworded the alt texts to remove the code fences and the references to "allFile".

@meyian
Copy link
Collaborator

@meyian meyian commented Aug 8, 2020

With PR #26304, all the incorrect alt texts in dictionary.txt have been replaced, I believe. I used the regex !\[.*-.*\]\(.*\) to search through the repo for all kebab-case filenames in alt texts, and all the entries that appeared in dictionary.txt have been removed in the various PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants
You can’t perform that action at this time.