Commit graph

25 commits

Author SHA1 Message Date
Joshua Chen
ad88f5cc87
test: improve test coverage; multiple internal refactors (#6912) 2022-03-14 21:53:57 +08:00
Joshua Chen
3a4b9b4c30
refactor: install eslint-plugin-regexp (#6906)
* refactor: install eslint-plugin-regexp

* simplify

* simplify

* fix
2022-03-13 18:32:17 +08:00
Joshua Chen
4db0c620de
refactor: enable a few TS flags (#6852)
* refactor: enable a few TS flags

* refactor

* revert to working version

* fix

* better

* change
2022-03-06 13:09:10 +08:00
Joshua Chen
f903422617
refactor: unify error handling behavior (#6755)
* refactor: unify error handling behavior

* revert

* normalize paths

* test...

* change

* does this work...

* fix...

* maybe fix

* maybe fix

* fix

* fix...
2022-02-25 15:07:13 +08:00
Joshua Chen
45f6f8b869
chore: fix ESLint warnings, restrict export all syntax (#6605)
* chore: fix ESLint warnings, forbid export all syntax

* fix...

* reorder
2022-02-04 21:57:10 +08:00
Joshua Chen
1cefb643dd
refactor: enforce named capture groups; clean up regexes (#6524)
* refactor: enforce named capture groups; clean up regexes

* fixes

* fix
2022-02-01 17:43:15 +08:00
Joshua Chen
aa446b7a9c
chore: clean up ESLint config, enable a few rules (#6514)
* chore: clean up ESLint config, enable a few rules

* enable max-len for comments

* fix build
2022-01-31 10:31:24 +08:00
Nick Schonning
521eb119a7
chore: add cSpell for spell checking (#6456)
* chore: Add cSpell for spell checking

* chore: exclude map files and remove dups

* chore: exclude more binary files

* chore: remove MD headings

* Update .cspell.json

* fix a few spellings

* fix more

* fix

Signed-off-by: Joshua Chen <sidachen2003@gmail.com>

* fix a few

* oops

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2022-01-25 09:40:02 +08:00
Joshua Chen
a79c23bc45
test(utils, mdx-loader, core): improve coverage (#6303)
* test(utils, mdx-loader, core): improve coverage

* windows...

* fix
2022-01-10 15:00:51 +08:00
Joshua Chen
24d65d9bdd
refactor(utils): reorganize functions; move authors file resolution to utils (#6229)
* refactor(utils): reorganize functions; move authors file resolution to utils

* More refactor
2021-12-31 11:55:42 +08:00
Joshua Chen
770418f8d2
refactor: unify log format with new logger utility (#5994)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2021-12-20 17:24:59 +01:00
Joshua Chen
4b2152a964
refactor: clear a few ESLint warnings (#5808)
* refactor: clear a few ESLint warnings

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix
2021-10-28 12:47:40 +08:00
Joshua Chen
3f1f8255a2
chore: upgrade Prettier + regenerate lock file (#5611)
* Bump deps

* Run prettier

* Format docs

* Minor refactor

* Collapse objects

* Fix type

* Update lock file
2021-09-30 12:54:17 +02:00
Alexey Pyltsyn
b62a12bfc6
chore: upgrade dependencies (#5608)
* chore: upgrade dependencies

* Revert github-slugger

* Fixes

* Update snapshots

* Update Babel deps
2021-09-24 16:36:41 +02:00
Alexey Pyltsyn
578470a24c
fix: ignore code block lines when create excerpt (#5495) 2021-09-22 10:15:46 +02:00
Joshua Chen
462b1cf2bc
style(v2): reduce number of ESLint warnings (#4993)
* Initial work

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* More fixes

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Update packages/docusaurus-theme-classic/src/theme/ThemedImage/index.tsx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>

* Update packages/docusaurus-theme-bootstrap/src/theme/ThemedImage/index.tsx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>

* Fix

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Replace versionPathPart with function

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Prefer non-null assertions

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Substitute for-of with forEach

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fill `catch` block with placeholder comment

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Ignore local require

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Revert global require change

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Tighten eslint disable range

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Make eslint ignore examples and more tolerating to templates

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Use reduce to handle doc items sequentially

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Revert "Use reduce to handle doc items sequentially"

This reverts commit c7525d463b.

* Address change requests

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-06-24 18:12:48 +02:00
Alexey Pyltsyn
41d9288e3d
refactor(v2): cleanup console output (#4979)
* refactor(v2): cleanup console output

* fix jest issue

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-06-16 11:37:28 +02:00
Sébastien Lorber
57806798c5
fix(v2): fix contentTitle issues when markdown h1 title contains code blocks (#4882)
* attempt to fix contentTitle issues when markdown h1 title contains inline code blocks

* mention hide_title frontmatter only prevents frontmatter.title from being added in the dom (not a markdown # title in content)

* alwayss insert MainHeading under the div.markdown container for consistency

* ensure MainHeading has no useless id

* revert https://github.com/facebook/docusaurus/pull/4859 as it's now useless: docMeta.title contains the text/frontmatter title in priority over the contentTitle

* fix docs test after revert

* improve markdownParser and fix tests

* fix docs tests

* markdownParser: restore option to remove contentTitle (mostly for blog plugin)

* use removeContentTitle for blog
2021-06-03 17:45:19 +02:00
Alexey Pyltsyn
644f148a8b
fix(v2): remove Markdown heading id from excerpt (#4862) 2021-06-02 16:20:53 +02:00
Nam Hoang Le
404b4dba8b
fix(v2): markdown title parser should ignore all forms of MDX import statements (#4735)
Co-authored-by: Nam Hoang Le <nam.hoang.le@mgm-tp.com>
2021-05-06 11:50:21 +02:00
Nam Hoang Le
8c39826496
fix(v2): optimize markdown parser regex (fix #4726) (#4729)
* fix(v2): optimize markdown parser regex

* Change test description

Co-authored-by: Nam Hoang Le <nam.hoang.le@mgm-tp.com>
2021-05-05 19:47:29 +02:00
Sébastien Lorber
8ebbc17c7b
fix(v2): fix title logic (meta vs heading) + ignore fixed anchor id syntax (#4688)
* parseMarkdownContentTitle should ignore {#my-anchor-id} syntax

* use frontMatter.title in priority for page meta title

* parseMarkdownString should ignore fixed anchor ids syntax

* docs: make the distinction between headingTitle + metaTitle more clear + add useful todo

* docs: make the distinction between headingTitle + metaTitle more clear + add useful todo

* writeHeadingIds should ignore top-level md title like "# Title"
=> we are not supposed to create anchor links for h1 headers

* update tests

* fix doc tests
2021-04-27 15:44:46 +02:00
Alexey Pyltsyn
4835222c16
fix(v2): ignore imports when h1 heading parsing (#4646) 2021-04-20 15:20:38 +02:00
Alexey Pyltsyn
808b0fa62a
fix(v2): parse headings directly after h1 properly (#4641) 2021-04-19 10:10:24 +02:00
Sébastien Lorber
4efe6824b3
feat(v2): various markdown string parsing improvements/fixes (#4590)
* extract createExcerpt code in separate file + add bad test

* almost working markdown parsing refactor

* complete parseMarkdownString refactor

* fix tests

* fix blog test issue

* fix docusaurus utils imports
2021-04-09 17:09:33 +02:00