Closed chenxsan closed 3 years ago
:heavy_check_mark: Deploy Preview for eslint ready!
:hammer: Explore the source changes: f5ba27af6511465c5eebb77dd6f31a5c63491b74
:mag: Inspect the deploy log: https://app.netlify.com/sites/eslint/deploys/60daf1cd7b420b00077ca582
:sunglasses: Browse the preview: https://deploy-preview-856--eslint.netlify.app
Thanks for the PR!
But it will become a problem if we're going to browser the documentation on Github because Github would generate double - for the aforementioned header text and that process is not customizable. This discrepancy would be a pain for users either on website or on Github because one of the two versions will have a broken link.
We don't necessarily have to support browsing the documentation on GitHub, but another benefit of syncing header ids is testing. We're editing documentation in eslint/eslint repo, but we don't have the eslint.org preview there. If the ids are synced, we can test the links in GitHub's viewer ("View file" on a PR) and be confident that they'll work well on eslint.org.
Aside from https://eslint.org/docs/user-guide/command-line-interface, where basically all ids will change, there are not many other changes:
TODO
- [ ] fix those links with
#-
instead of#--
as they could be broken onceslugify
gets updated.- [ ] remove the superfluous whitespace mentioned in Docs: fix multiple broken links eslint#14743 (comment) so its id can stay the same as before.
Would you like to prepare PR (or PRs) to fix that before the next release (which will be this Friday)?
TODO
- [ ] fix those links with
#-
instead of#--
as they could be broken onceslugify
gets updated.- [ ] remove the superfluous whitespace mentioned in Docs: fix multiple broken links eslint#14743 (comment) so its id can stay the same as before.
Would you like to prepare PR (or PRs) to fix that before the next release (which will be this Friday)?
I think I can file a pull request tonight or tomorrow night.
Merged after the v7.30.0 release.
Thanks for contributing!
As discussed in https://github.com/eslint/eslint/pull/14743 with @mdjermanovic.
But that issue is sort of messy now, so I'll explain in details for why updating the
slugify
function here.Problems
The current implementation would replace
--
in headers' ids with-
, which means with header text like--resolve-plugins-relative-to
we will have header id-resolve-plugins-relative-to
on website.Generally it's not a big deal as long as we use the id of the single
-
version when linking to those headers. E.g.,But it will become a problem if we're going to browser the documentation on Github because Github would generate double
-
for the aforementioned header text and that process is not customizable. This discrepancy would be a pain for users either on website or on Github because one of the two versions will have a broken link.Solution
We just stop replacing
--
with-
to keep consistency between the website and github.Side effects
As the
slugify
function was introduced 11 months ago, we would expect some links to break inevitably.But it's tolerable as we assessed here:
And some of them are fixable once this pull request gets merged. See todo later.
TODO
#-
instead of#--
as they could be broken onceslugify
gets updated.