You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If some rules about naming files are ensured (eg. by path [folder]/en-US/some-markdown-file.md or by file [folder]/some-markdown-file.en-US.md), something very common in software development, it will be easier use this plugin with zero config.
Proposal
Add a new config parameters to enhace it.
Draft:
"language-resolver": null: a regex pattern or a function to extract the lang slug using visited tree/file info.
"default-language": "en-US": fallback language, when is not supported by Intl webapi or other Collator package.
Use remark-frontmatter plugin could be the best option to extract this info if some microblogging static generators like Jekyll, Hugo, ... are used in the project. So... another param??
The text was updated successfully, but these errors were encountered:
davorpa
changed the title
IDEA: Configure language depending on info provided by visited file
IDEA: Configure collator language depending on info provided by visited file
Sep 10, 2021
Defeat
Having a merelly
{ language: "your lang" }
as config object is a bit simple when remark is applied in a multilanguage project.remark-lint-alphabetize-lists/lib/alphabetical-list-items.js
Line 17 in ee5f968
If some rules about naming files are ensured (eg. by path
[folder]/en-US/some-markdown-file.md
or by file[folder]/some-markdown-file.en-US.md
), something very common in software development, it will be easier use this plugin with zero config.Proposal
Add a new config parameters to enhace it.
Draft:
"language-resolver": null
: a regex pattern or a function to extract the lang slug using visited tree/file info."default-language": "en-US"
: fallback language, when is not supported byIntl
webapi or other Collator package.Use
remark-frontmatter
plugin could be the best option to extract this info if some microblogging static generators like Jekyll, Hugo, ... are used in the project. So... another param??"use-frontmatter": true
An example of
language-resolver
can be found at fpb-lint-cli: https://github.com/vhf/free-programming-books-lint/blob/b72812e3cf51e0dce322a30d465f50ee618f3d0c/lib/lint.js#L59-L70The text was updated successfully, but these errors were encountered: