Alexey Pyltsyn
60599552e4
fix: avoid extra default active class on doc sidebar item ( #5316 )
2021-08-10 15:21:39 +02:00
Alexey Pyltsyn
928ba75da4
fix: unbreak highlighting regular navbar links ( #5319 )
2021-08-10 12:30:48 +02:00
Michal Sänger
18151879d2
feat: add Czech translation for docusaurus-theme-classic ( #5314 )
2021-08-08 00:07:32 +03:00
Joshua Chen
28e25992ab
feat: new init template classic-typescript ( #5233 )
...
* Add typescript template
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Update template
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Complete CLI
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Remove d.ts file
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Refactor
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Revert lock file changes
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Regenerate lock
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add stylelint ignore
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix tsconfig
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Attempt to use symlink
* More symlinks
* Link all markdown
* Link source files
* Change to relative links
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix blogs
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix link
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Link config
* Documentation
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add option to index
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add option
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix copying
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Provide suffix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Always have colored output
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Remove return signature
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Update generate examples
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Update lock
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix tsconfig
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Use latest docusaurus
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Update lock
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add type def
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* init: make classic first in list + mark as recommended + minor refactors
* remove types.d.ts
* add "yarn typecheck" script
* Minor tweaks
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Generate example for TS
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add comment
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* No emit when running tsc
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* FIx generate examples
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Remove compiler options
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* This looks better
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Use new tsconfig
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-06 19:11:36 +02:00
Sébastien Lorber
cabb768473
feat: blog posts support /YYYY/MM/DD/blog-post/index.md pattern + blog frontmatter can reference relative images ( #5309 )
...
* POC of blog post folder
* add parseBlogFileName with tests + refactor and extract processBlogSourceFile in separate method
* improve blog date pattern doc + link from content plugin guides to API ref docs
* Some FrontMatter fields should be able to reference relative image assets, converted to Webpack require calls and exposed as frontMatterAssets
* remove log
2021-08-06 17:51:59 +02:00
wan-nyan-wan
34e9080232
fix: docusaurus serve logs wrong port if 3000 is taken ( #5311 )
2021-08-06 17:16:34 +02:00
Alexey Pyltsyn
081db7b35c
fix: remove unexpected whitespaces in CSS bundle ( #5308 )
2021-08-06 11:59:59 +02:00
Sébastien Lorber
916b82119b
feat: mdx loader fallback, allow importing mdx docs from anywhere ( #5299 )
...
* move deep filepath test
* split markdownPageExample.md
* re-org dogfooding content
* Add mdx partials fallback synthetic plugin by default
* test commit
* hide changelog title as it's already included in the partial file
* trigger CI
* fix changelog sidebar label
2021-08-06 11:32:22 +02:00
Joshua Chen
780e924a9e
fix: fix constant value import ( #5297 )
...
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-08-05 14:54:09 +02:00
Joshua Chen
0a668366c2
refactor: properly type docs version ( #5284 )
...
* Type docs version
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Move non-null assertions
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Test again
2021-08-05 10:52:35 +02:00
Alexey Pyltsyn
bc6c67720a
fix: make successful build if missing favicon ( #5290 )
2021-08-05 10:43:14 +02:00
Alexey Pyltsyn
2c0b82e7ab
fix: apply proper class for active doc item on mobiles + avoid duplicated classes ( #5264 )
...
* fix: apply proper class for active doc item on mobiles
* Fixes after review
2021-08-04 15:29:10 +02:00
Massoud Maboudi
8e9b829d98
refactor: improve Farsi default translations ( #5280 )
2021-08-04 10:09:11 +03:00
Federico Aloi
22d3299b47
fix: improve Spanish translation ( #5275 )
2021-08-03 21:30:37 +03:00
Sébastien Lorber
bb825faf1c
fix: ability to link md files with relative paths when paths contain space ( #5270 )
...
* fix md linkify function when spaces in paths
* fix linkify
2021-08-02 18:02:01 +02:00
Joshua Chen
bd46de18f9
fix: fix wrong regex that removes extra letters from swizzled component names ( #5268 )
2021-08-02 11:44:45 +02:00
Alexey Pyltsyn
8a198ef20a
fix: show secondary menu if even there is no main one ( #5262 )
2021-08-02 11:16:32 +02:00
Joshua Chen
650f989dbb
fix: fix various TS errors ( #5261 )
...
* Fix import errors
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Oops
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Mark contentLoaded async
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-08-02 11:02:43 +02:00
Joshua Chen
9e615eff02
refactor: reduce ESLint warnings / better typing ( #5242 )
...
* Fix code block children type
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add return type
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add types
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix return types
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix details type
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix type
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-07-29 17:59:38 +02:00
Sébastien Lorber
fc64c12e41
chore(v2): prepare v2.0.0-beta.4 release ( #5238 )
...
* chore(v2): prepare v2.0.0-beta.4 release
* update publish
* v2.0.0-beta.4
2021-07-28 22:54:41 +02:00
Joshua Chen
4bc6a63756
fix: navbar item validation done correctly ( #5202 )
...
* Initial work
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix again
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More fix (Joi is so hard!)
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* This should pass now
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Such pain
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Minor tweaks
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More test cases
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Minor tweaks
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Errr... this should be better
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Redo isOfType
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Make things more concise
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Remove TODO
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Rename isOfType
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Slight refactor
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More error messages
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More test cases
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-28 22:20:48 +02:00
Alexey Pyltsyn
c935fe2a37
feat(v2): add back to top button ( #4912 )
...
* feat(v2): add back to top button
* Test on mobiles
* Use clean-btn class
* Fix case
* clearer useScrollPosition() hook
* fix useScrollPosition typing + dangerous 0 fallback value + refactor a bit backToTop button
* useless fallback
* Handle both browsers with/without native smooth scrollBehavior support
* fix SupportsNativeSmoothScrolling using document on SSR
* revert to smoothScrollTopPolyfill usage
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-28 22:10:17 +02:00
陈杨文
bb0c9eed0d
fix(v2): parse frontMatter.date ( #5232 )
...
Signed-off-by: wener <wenermail@gmail.com>
2021-07-28 19:32:14 +02:00
Sébastien Lorber
b3e89d2a86
feat: docusaurus.new + improved StackBlitz playground ( #5235 )
...
* Upgrade playground shortcut domain to docusaurus.new
* update generateExamples
* update generateExamples + re-generate with stackblitz config
* test
* test
* test
* test
* test
* update examples
* upgrade lockfile
* fix yarnlock
* fix yarnlock
2021-07-28 19:27:58 +02:00
Sébastien Lorber
4cfbfa11ee
chore: Upgrade infima 29 ( #5234 )
...
Co-authored-by: Massoud Maboudi <massoud.maboudi@gmail.com>
2021-07-28 17:58:09 +02:00
Alexey Pyltsyn
ce847d664c
fix(v2): remove top margin from first element inside doc article ( #5230 )
2021-07-28 16:35:31 +02:00
Alexey Pyltsyn
a72ed73d2d
fix(v2): keep mobile TOC after hydration ( #5229 )
2021-07-28 15:34:45 +02:00
antonvasilev52
a7618c7758
refactor(v2): fix small typo in Russian translation ( #5228 )
2021-07-28 02:33:45 +03:00
Sébastien Lorber
dc4664b489
feat: details/summary theme / MDX component ( #5216 )
...
* Details component
* polish arrow animation
* fix text selection bug
* fix some edge cases + polish
* example of overriding baseClassName
* Move Details component to theme-common
* make component work even when JS is disabled or failed to load
* update arrow transform
* Details component: better handling of no-JS fallback mode: avoid delaying arrow navigation when JS (see review)
* prefix css vars with --docusaurus
* improve css arrow styling
* slightly change details/summary design
* better md doc + include quotes and details in doc
2021-07-27 18:45:12 +02:00
Alexey Pyltsyn
798f634007
chore(v2): update Infima to alpha 28 ( #5222 )
2021-07-27 16:09:20 +02:00
Alexey Pyltsyn
938e5a906f
refactor(v2): update Russian translation ( #5224 )
...
* refactor(v2): update Russian translation
* Wording
2021-07-27 16:00:11 +02:00
Massoud Maboudi
6f366f4b45
refactor(v2): improved Farsi default translations ( #5217 )
...
* improved the Farsi translation
* removed the __description lines
* removed the __description lines
* improved the translation
2021-07-27 10:50:31 +02:00
Sébastien Lorber
8621ae2910
fix: upgrade Docsearch to avoid layout shift ( #5214 )
...
* upgrade algolia docsearch
* alpha 39
2021-07-24 18:40:09 +02:00
Sébastien Lorber
a7a5ea3466
refactor: make code block shadows consistent with new admonitions ( #5215 )
2021-07-23 18:11:40 +02:00
Sébastien Lorber
083037d7a5
refactor: redesign admonitions/callouts/quotes ( #5193 )
...
* prepare admonitions redesign
* Docusaurus admonition cleanup
* cover more edge cases in Docusaurus admonitions page: interleaving code blocks and links
* cover more edge cases in Docusaurus admonitions page: interleaving code blocks and links
* update Infima with new alerts
2021-07-23 17:10:38 +02:00
Joshua Chen
24156efcfb
feat: docs plugin options sidebarCollapsible + sidebarCollapsed ( #5203 )
...
* Add prop
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add `collapsible` option to sidebar item
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Add eslint-ignore
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Move new page
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Allow in autogenerated
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix tests
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Move config options to plugin-docs
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Make non-collapsible items always expanded
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* docs versioning cli should receive a single options object
* Update cli.test.ts
* revert validateCategoryMetadataFile change
* remove theme usage of themeConfig.sidebarCollapsible
* better handling of sidebar item category inconsistencies + add warning message
* Update snapshot
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Handle plugin option inconsistencies
* improve doc for new sidebarCollapsible doc options
* remove warning in fixSidebarItemInconsistencies as it will be annoyed for versioned sites, as "collapsed" is already persisted in sidebar json files
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-23 14:24:36 +02:00
Sébastien Lorber
700a82aefe
feat: multiple playground choices ( #5207 )
...
* poc of using netlify functions for playground redirections
* push
* cleanup
* restore files
* fix netlify functions?
* fix netlify functions?
* implement serverless functions for playgrounds with persistent cookie
* move new.docusaurus.io to monorepo packages
* move new.docusaurus.io to monorepo packages
* lockfile
* push
* catch-all redirect
* Translate/Interpolate: add better error message if not used correctly
* Add /docs/playground page
* Add some additional doc
2021-07-22 21:10:36 +02:00
Michel Weststrate
ddc0f46b73
fix: cli upgrade helper fail when no package.dependencies
( #5204 )
...
* Fix handling of empty `dependencies` section.
In Flipper, https://github.com/facebook/flipper/blob/master/website/package.json , all our dependencies live in `devDependecies` of our `package.json`. As a result `dependencies` is not set, causing a crash when running `yarn start`:
```
/Users/mweststrate/fbsource/xplat/sonar/website/node_modules/@docusaurus/core/bin/docusaurus.js:50
const siteDocusaurusPackagesForUpdate = Object.keys(sitePkg.dependencies)
^
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at Object.<anonymous> (/Users/mweststrate/fbsource/xplat/sonar/website/node_modules/@docusaurus/core/bin/docusaurus.js:50:50)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
at internal/main/run_main_module.js:17:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
Setting `"dependencies": {}`, works as work around, but this patch fixes the crash, and makes sure the deps are upgraded as well if they live in `devDependencies` instead of `dependencies`.
* formatting fix
2021-07-22 16:13:57 +02:00
Sébastien Lorber
4d06f26c1f
fix(v2): Fix MDX docs being considered as partials when siteDir match the _ prefix convention ( #5199 )
...
* Add _ to dogfood docs folder to cover against edge case
* Fix edge case with MDX partials when site / content dir contains a _ prefix
* add globUtils tests
* proper dogfooding folder re-organization, all content plugins being used
* refactor dogfooding folder + expose /tests page index
* fix page plugin ignoring options.routeBasePath
2021-07-21 14:13:51 +02:00
Alexey Pyltsyn
12cea5eefe
refactor(v2): increase content area if blog sidebar is off ( #5171 )
...
* refactor(v2): increase content area if blog sidebar is off
* Replace render prop with children to simplicity sake
* Revert to previous layout
2021-07-20 14:11:08 +02:00
Alexey Pyltsyn
88de3a5106
fix(v2): wrap dropdown item to missing li element + remove extra attributes ( #5179 )
...
* fix(v2): wrap dropdown item to li element
* Remove extra attrs
* Fix types
* Exclude type/position from parent component
* Fix for positon
* Avoid cloneElement
* Update packages/docusaurus-theme-classic/src/theme/NavbarItem/index.tsx
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2021-07-19 19:17:45 +02:00
Alexey Pyltsyn
44225a3df9
fix(v2): pass all props to CodeBlock component ( #5183 )
2021-07-16 14:55:19 +02:00
Alexey Pyltsyn
54e4b02666
fix(v2): add base URL to content attribute of head tags PWA ( #5185 )
2021-07-16 11:56:00 +02:00
Joshua Chen
633c2f60dd
fix(v2): Fix type for navlink label ( #5176 )
...
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-07-15 15:40:39 +02:00
Alexey Pyltsyn
f7b5e90390
refactor(v2): automatically add base URL to PWA head tags ( #5169 )
...
* refactor(v2): automatically add base URL to PWA head tags
* Add baseUrl only if necessary
2021-07-15 15:38:14 +02:00
Sébastien Lorber
8bdb3da233
feat(v2): generalize usage of _ prefix convention to exclude content files/folders ( #5173 )
...
* create a swizzleWarning partial for shared text
* Generalize usage of _ prefix convention to exclude content files/folders
* add api doc
* MDX loader should not expect metadata/frontmatter on MDX partial files
2021-07-15 13:21:41 +02:00
Sébastien Lorber
0851e0e5bf
fix(v2): hide mobile collapsible doc toc if no headings ( #5172 )
2021-07-15 09:51:23 +02:00
Sébastien Lorber
818fb3956b
refactor(v2): mobile dropdown navbar: expand when subitem become active ( #5168 )
2021-07-14 19:42:47 +02:00
Joshua Chen
007e901354
feat(v2): allow any type of NavbarItem
to be passed in a navbar dropdown ( #5072 )
...
* Initial work
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More elegant `eslint-disable`
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix typing
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Allow doc links in dropdown
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Allow more dropdowns to use linklike items
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Finalize
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Dogfood
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Disallow nested dropdowns
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Better typing
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Complete type fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Use flatmap
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Patch
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Test
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Try fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Style change
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Revert (to test)
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Hmmm
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* I know what's wrong
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Does this work?
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Nope
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Wrong class name
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Pass prop to render dropdown item differently
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* This looks better
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Tests passed
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Separate dropdown from default
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Pourquois?
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Better prop typing
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Make code simpler
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* There's some extra className
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Test
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More test
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* A-ha!
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Test again?
* Add backward compatibility
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Incorporate my type fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Resolve conflict
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* minor refactor
* minor refactors
* allow usage of ES2019 in browser code
* revert NavLink rename
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-14 18:19:08 +02:00
Sébastien Lorber
677e53d4db
perf(v2): lazy collapsibles, reduce html output and build times ( #5136 )
...
* Allow collapsible to be lazy
* cleanup comments
* CollapsibleLazy little bug
2021-07-14 16:18:52 +02:00