Skip to content

Commit

Permalink
refactor(doc): update doc dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyDolle committed Feb 20, 2024
1 parent 54cd1a6 commit 6d37c44
Show file tree
Hide file tree
Showing 26 changed files with 3,974 additions and 2,103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Where `sizesValues` is an array of numbers, `sizeValue` is an item of `sizeValue

| font name | Generated style |
|----------------------------|------------------------------|
| fonts.size__sizesValue_ | { fontSize: _sizeValue_ } |
| fonts._colorsKey_ | { color: _colorsValue_ } |
| fonts.size__sizesValue_ | \{ fontSize: _sizeValue_ \} |
| fonts._colorsKey_ | \{ color: _colorsValue_ \} |

## Static fonts
Some fonts styles, such as the `fontWeight` property of a text style, don't require dynamic generation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The generated styles take the following form:

| background name | Generated style |
|---------------------------|-------------------------------------|
| backgrounds._colorName_ | { backgroundColor: _colorValue_ } |
| backgrounds._colorName_ | \{ backgroundColor: _colorValue_ \} |

These styles enable you to easily apply background colors to your components as needed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Where `widthsValues` and `radiusValues` are arrays of numbers, `widthValue` is a

| font name | Generated style |
|-------------------------------|-----------------------------------|
| borders.w__widthValue_ | { borderWidth: _widthValue_ } |
| borders.rounded__radiusValue_ | { borderRadius: _radiusValue_ } |
| borders._colorsKey_ | { borderColor: _colorsValue_ } |
| borders.w__widthValue_ | \{ borderWidth: _widthValue_ \} |
| borders.rounded__radiusValue_ | \{ borderRadius: _radiusValue_ \} |
| borders._colorsKey_ | \{ borderColor: _colorsValue_ \} |


## Static borders styles
Expand Down
29 changes: 14 additions & 15 deletions documentation/docs/04-Guides/04-Theming/04-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ keywords: [theme, theming, configuration, config, api, reference, api reference]

### ColorConfig

| Key | Type | Description |
|----------|------------------------|----------------------|
| `colors` | Record<string, string> | Define global colors |
| Key | Type | Description |
|----------|--------------------------|----------------------|
| `colors` | Record\<string, string\> | Define global colors |

### FontConfig

| Key | Type | Description |
|----------|------------------------|-------------------------------------------------|
| `sizes` | number[] | Define font sizes to generate associated style |
| `colors` | Record<string, string> | Define font colors to generate associated style |
| Key | Type | Description |
|----------|--------------------------|-------------------------------------------------|
| `sizes` | number[] | Define font sizes to generate associated style |
| `colors` | Record\<string, string\> | Define font colors to generate associated style |

### GuttersConfig

Expand All @@ -30,11 +30,11 @@ keywords: [theme, theming, configuration, config, api, reference, api reference]

### BordersConfig

| Key | Type | Description |
|----------|------------------------|------------------------------------------------------------|
| `widths` | number[] | Define sizes to generate associated styles (borderWidth) |
| `radius` | number[] | Define radius to generate associated styles (borderRadius) |
| `colors` | Record<string, string> | Define colors to generate associated styles (borderColor) |
| Key | Type | Description |
|----------|--------------------------|------------------------------------------------------------|
| `widths` | number[] | Define sizes to generate associated styles (borderWidth) |
| `radius` | number[] | Define radius to generate associated styles (borderRadius) |
| `colors` | Record\<string, string\> | Define colors to generate associated styles (borderColor) |

### NavigationColorsConfig

Expand Down Expand Up @@ -69,7 +69,7 @@ keywords: [theme, theming, configuration, config, api, reference, api reference]
| fonts | [`Fonts`](/docs/theming/api-reference#fonts) |
| backgrounds | [`Backgrounds`](/docs/theming/api-reference#backgrounds) |
| borders | [`Borders`](/docs/theming/api-reference#borders) |
| navigationTheme | [`NavigationTheme`](/docs/theming/api-reference#navigationTheme) |
| navigationTheme | [`NavigationTheme`](/docs/theming/api-reference#navigationcolorsconfig) |
| components | [`Components`](/docs/theming/api-reference#components) |

### Layout
Expand All @@ -89,7 +89,7 @@ The type of the generated styles is `Record<string, TextStyle>` but will be infe

### Backgrounds
Generated styles provided by the `backgrounds` section of the theme configuration assist in applying background color to your components.
The type of the generated styles is `Record<`bg_${string}`, {backGroundColor: string}>` but will be inferred by the `Backgrounds` type.
The type of the generated styles is `Record<`bg_$\{string\}`, {backGroundColor: string}>` but will be inferred by the `Backgrounds` type.

### Borders
Generated styles provided by the `borders` section of the theme configuration assist in applying border radius, width and color to your components.
Expand All @@ -100,4 +100,3 @@ Generated styles provided by the `navigationColors` section of the theme configu

### Components
Generated styles provided by the `components` file of the theme configuration assist in applying styles to specific components.

145 changes: 0 additions & 145 deletions documentation/docusaurus.config.js

This file was deleted.

137 changes: 137 additions & 0 deletions documentation/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
import type { Config } from '@docusaurus/types';
import { themes as prismThemes } from 'prism-react-renderer';

export default {
title: 'The React Native Boilerplate',
tagline: 'Simple, Lightweight and Scalable.',
url: 'https://thecodingmachine.github.io',
baseUrl: '/react-native-boilerplate/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/TOM-small.webp',
organizationName: 'thecodingmachine',
projectName: 'react-native-boilerplate',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
plugins: [
async function myPlugin() {
return {
name: 'docusaurus-tailwindcss',
configurePostCss(postcssOptions) {
// eslint-disable-next-line global-require,import/no-extraneous-dependencies
postcssOptions.plugins.push(require('tailwindcss'));
// eslint-disable-next-line global-require,import/no-extraneous-dependencies
postcssOptions.plugins.push(require('autoprefixer'));
return postcssOptions;
},
};
},
],
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/thecodingmachine/react-native-boilerplate/edit/main/website-documentation/docs',
},
blog: {
showReadingTime: true,
editUrl:
'https://github.com/thecodingmachine/react-native-boilerplate/edit/main/website-documentation/blog',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],

themeConfig: {
algolia: {
appId: '9PEYN0H12D',
indexName: 'rnboilerplate',
apiKey: '983439b6ebef49ed3394ecfa290f1c6a',
contextualSearch: true,
},
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
respectPrefersColorScheme: false,
},
navbar: {
title: 'React Native Boilerplate',
logo: {
alt: 'octopus tentacle logo',
src: 'img/TOM-small.webp',
},
items: [
{
type: 'doc',
docId: 'getting-started',
position: 'left',
label: 'Docs',
},
{ to: '/blog', label: 'Blog', position: 'left' },
{
to: 'https://github.com/thecodingmachine/react-native-boilerplate',
label: ' ',
className: 'header-github-link group',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Features',
items: [
{
label: 'Javascript or TypeScript ? You choose !',
to: '/docs/installation#using-the-boilerplate',
},
{
label: 'Navigation',
to: '/docs/navigate',
},
{
label: 'Data fetching',
to: '/docs/data-fetching',
},
{
label: 'Internationalization',
to: '/docs/internationalization',
},
{
label: 'Multi theming',
to: '/docs/theming/how-to-use',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
to: 'https://github.com/thecodingmachine/react-native-boilerplate',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} React Native Boilerplate, by TheCodingMachine. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
},
} satisfies Config;
Loading

0 comments on commit 6d37c44

Please sign in to comment.