Commit graph

20 commits

Author SHA1 Message Date
duanwilliam
1abadbaeca
fix(v2): fix code block title parsing, support multiple metastring attributes (#4541)
* feat: lazy match classic theme code block title

* feat: allow single quotes for classic theme code block title

* refactor(v2): extract parseCodeBlockTitle function

extract `parseCodeBlockTitle` function to add tests for title parsing

* test(v2): add tests for parseCodeBlockTitle

* move code block title parser to theme-common

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-14 10:24:52 +02:00
Sam Zhou
83d043ecb3
chore(v2): Fix more linter warnings (#4450) 2021-03-18 18:05:09 +01:00
Alexey Pyltsyn
a4b409c93b
fix(v2): make code blocks more standalone (#4315)
* refactor(v2): make code blocks styles standalone

* Rework

* Revert font size in playground headers

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-03-04 18:22:34 +01:00
Sébastien Lorber
3d00613e5d
fix(v2): Code blocks should be LTR by default (#4277)
* use LTR code code blocks

* code blocks should be LTR
2021-02-23 18:47:07 +01:00
Alexey Pyltsyn
08fa318599
refactor(v2): add more translatable strings (#4219)
* refactor(v2): add more translatable strings

* Apply suggestions from code review

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

* Fixes

* Updates

* Localize direct link to heading

* typo + add french translations

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-02-18 11:29:51 +01:00
Sébastien Lorber
ab7951571e
feat(v2): Extract/translate hardcoded labels from classic theme (#4168)
* Translate theme hardcoded strings

* improve test
2021-02-03 20:06:26 +01:00
Bartosz Kaszubowski
ad31facb32
chore(v2): fix several lint warnings, add missing types, cleanup (#3844)
* fix several lint warnings, add missing types, cleanup

* fix EnumChangefreq issue

* better utilization of EnumChangefreq type

* update test snapshot
2020-11-30 16:42:58 +01:00
Alexey Pyltsyn
0331c55850
chore(v2): upgrade Infima to v0.2.0-alpha.17 (#3777) 2020-11-18 16:35:51 +01:00
Sébastien Lorber
abcd8cefd6
feat(v2): @docusaurus/theme-common (#3775)
* create base @docusaurus/theme-common package + fix Webpack client export aliases issue shadowing other theme-common package

* Move theme-classic/src/utils code to new @docusaurus/theme-common package

* add prettierignore

* fix bad test location for getDocusaurusAliases()
2020-11-18 16:00:51 +01:00
Alexey Pyltsyn
1dac7e33f7
fix(v2): add support for interleaving Markdown in code blocks (#3749)
* fix(v2): add support for interleaving Markdown in code blocks

* Improve check for array
2020-11-17 02:18:45 +03:00
Alexey Pyltsyn
049634a927
chore(v2): upgrade dependencies (#3727)
* chore(v2): upgrade dependencies

* Update loader-utils

* Update MDX packages

* Update Babel packages

* Various updates
2020-11-12 12:30:14 +01:00
Anh Hong
f8a6b391cd
refactor(v2): improve regex matching code-block title (#3685) 2020-11-05 12:33:08 +01:00
Alexey Pyltsyn
7c7e0c24f6
Revert "refactor(v2): improve regex matching code-block title (#3671)" (#3681)
This reverts commit 32425497f7.
2020-11-04 12:52:52 +01:00
Anh Hong
32425497f7
refactor(v2): improve regex matching code-block title (#3671) 2020-11-02 17:03:32 +01:00
Alexey Pyltsyn
cf99862d29
refactor(v2): clean up code blocks (#3654) 2020-10-29 09:27:44 +01:00
Alexey Pyltsyn
9f66545c8c
refactor(v2): make code blocks accessible from keyboard (#3649) 2020-10-28 17:51:21 +01:00
Alexey Pyltsyn
fe7267ae93
refactor(v2): make accessible copy code button from keyboard (#3588) 2020-10-15 17:03:48 +02:00
Shubham Kumar
0951eef2d7
refactor(v2): add useThemeConfig hook + cleanup useless theme default values (#3394)
* refactor(theme-classic): clean default or fallback values

* refactor(theme-classic): fix announcementbar undefined error

* refactor(theme-classic): fixed react hook warning error

* refactor(theme-classic): revert prism destruct

* create useThemeConfig and use it whenever possible

* validateThemeConfig => add [] as default value for almost all arrays

* fix tests

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-10-02 19:23:34 +02:00
Sam Zhou
bd9b6618c1
feat(v2): Provide typing to most of the theme-classic components (#3348)
* feat(v2): Provide typing to most of the theme-classic components

* Expose type to the end users and dogfood it in v2 website
2020-08-28 12:06:37 +02:00
Sam Zhou
5ccd24cc1f
feat(v2): Support swizzling TypeScript components (#2671)
* feat(v2): Support swizzling TypeScript components

* Add tsc --noEmit to tsc script in theme-classic

Now everything can pass the type checker! (although still a lot of any)

* Add tsconfig and types.d.ts to website

Improve developer experience.

As an example, I converted NotFound to tsx

* Apply type annotation suggestions

* Do not fallback to `getThemePath` if getTypeScriptThemePath is undefined

* Fix tsc

* Add module declaration for @theme-original/*

* Move babel cli to root package.json
2020-06-25 16:07:30 +02:00
Renamed from packages/docusaurus-theme-classic/src/theme/CodeBlock/index.js (Browse further)