Skip to content

Commit

Permalink
docs: upgrade docusaurus to v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sAleksovski committed Jan 5, 2024
1 parent c5a43ce commit d63547c
Show file tree
Hide file tree
Showing 13 changed files with 4,012 additions and 2,075 deletions.
2 changes: 1 addition & 1 deletion docs/docs/api/widget-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ const styles = StyleSheet.create({

## Types

Check the types in the [Public API](public-api/interfaces/WidgetPreviewProps.md) documentation
Check the types in the [Public API](public-api/interfaces/WidgetPreviewProps) documentation
153 changes: 0 additions & 153 deletions docs/docusaurus.config.js

This file was deleted.

151 changes: 151 additions & 0 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';

import { themes } from 'prism-react-renderer';

const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;

const config: Config = {
title: 'React Native Android Widget',
tagline: 'Build Android Widgets with React Native',
url: 'https://sAleksovski.github.io/',
baseUrl: '/react-native-android-widget',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.png',
trailingSlash: false,

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'sAleksovski', // Usually your GitHub org/user name.
projectName: 'react-native-android-widget', // Usually your repo name.

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

plugins: [
[
'docusaurus-plugin-typedoc',
{
entryPoints: ['../src/index.ts'],
tsconfig: '../tsconfig.json',
out: 'public-api',
disableSources: true,
readme: 'none',
sort: 'required-first',
visibilityFilters: {
private: false,
},
},
],
[
'@docusaurus/plugin-client-redirects',
{
createRedirects(existingPath) {
if (!existingPath.endsWith('/')) {
return `${existingPath}/`;
}

return undefined; // Return a falsy value: no redirect created
},
},
],
],

presets: [
[
'classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/sAleksovski/react-native-android-widget/tree/master/docs/',
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
gtag: {
trackingID: 'G-S7YD6GC3T0',
},
} satisfies Preset.Options,
],
],

themeConfig: {
image: 'img/og-image.png',
metadata: [
{
name: 'keywords',
content: [
'react native widget',
'react native widgets',
'react native android widget',
'expo widget',
'expo widgets',
'react native expo widget',
'react-native-android-widget',
].join(','),
},
],
navbar: {
title: 'React Native Android Widget',
logo: {
alt: 'React Native Android Widget Logo',
src: 'img/logo.png',
},
items: [
{
type: 'doc',
docId: 'index',
position: 'left',
label: 'Docs',
},
{
type: 'doc',
docId: 'public-api/index',
position: 'left',
label: 'Public API',
},
{
position: 'right',
href: 'https://www.buymeacoffee.com/sAleksovski',
className: 'header-buymeacoffee-link',
},
{
href: 'https://github.com/sAleksovski/react-native-android-widget',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [],
copyright: `Copyright © ${new Date().getFullYear()} Stefan Aleksovski. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['java'],
},
announcementBar: {
id: 'star-on-github', // Increment on change
content:
'⭐️ If you like React Native Android Widget, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/sAleksovski/react-native-android-widget">GitHub</a>',
},
colorMode: {
respectPrefersColorScheme: true,
},
},
};

export default config;
30 changes: 16 additions & 14 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^2.4.0",
"@docusaurus/plugin-client-redirects": "2.4.0",
"@docusaurus/preset-classic": "^2.4.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@docusaurus/core": "^3.1.0",
"@docusaurus/plugin-client-redirects": "^3.1.0",
"@docusaurus/preset-classic": "^3.1.0",
"@mdx-js/react": "^3.0.0",
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.4.0",
"docusaurus-plugin-typedoc": "^0.18.0",
"typedoc": "^0.23.22",
"typedoc-plugin-markdown": "^3.14.0",
"typescript": "^4.9.4"
"@docusaurus/module-type-aliases": "^3.1.0",
"@docusaurus/tsconfig": "^3.1.0",
"@docusaurus/types": "^3.1.0",
"@types/react": "^18.2.29",
"docusaurus-plugin-typedoc": "^0.22.0",
"typedoc": "^0.25.6",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "~5.2.2"
},
"browserslist": {
"production": [
Expand All @@ -43,6 +45,6 @@
]
},
"engines": {
"node": ">=16.14"
"node": ">=18.0"
}
}
7 changes: 4 additions & 3 deletions docs/sidebars.js → docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
import { SidebarsConfig } from '@docusaurus/plugin-content-docs';

const sidebars: SidebarsConfig = {
default: [
{
type: 'doc',
Expand Down Expand Up @@ -105,4 +106,4 @@ const sidebars = {
*/
};

module.exports = sidebars;
export default sidebars;
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import clsx from 'clsx';
import React from 'react';
import styles from './styles.module.css';

Expand Down Expand Up @@ -33,7 +32,7 @@ const FeatureList = [

function Feature({ Svg, title, description }) {
return (
<div className={clsx('col col--4')}>
<div className="col col--4">
<div className="text--center">
<Svg className={styles.featureSvg} role="img" />
</div>
Expand Down
Loading

0 comments on commit d63547c

Please sign in to comment.