Skip to content

Commit

Permalink
fix(docs): rebuild docs with new gatsby theme
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjdavidson committed Nov 18, 2023
1 parent 6a62ef7 commit 4eee08a
Show file tree
Hide file tree
Showing 47 changed files with 20,810 additions and 19,736 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16']
node-version: ['18']

# Steps represent a sequence of tasks that will be executed as part of the job
# - Checkout gatsby branch
# - Update authentication for Github Package Registry @kenjdavidson/base16-scss
# - Build gh-pages using action
steps:
- name: Building documentation for ${{ github.ref_name }}
- name: Checking out project ${{ github.ref_name }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
Expand Down
72 changes: 66 additions & 6 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,69 @@
# Project dependencies
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variable files
.env*

# gatsby files
.cache/
# Build directory
public/
static/admin/*.bundle.*
public

# Mac files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
21 changes: 21 additions & 0 deletions docs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 João Pedro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
28 changes: 5 additions & 23 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@

# Basic setup for gatsby-theme-apollo
# React Native Bluetooth Classic Docsite

This repo builds a simple version of the Gatsby theme for [Apollo docs](https://github.com/apollographql/gatsby-theme-apollo/tree/master/packages/gatsby-theme-apollo-docs)
Document site for the React Native Bluetooth Classic library.

The setup was derived from this helpful "hello world" [example](
https://codesandbox.io/s/gatsby-theme-apollo-docs-hello-world-bywp2?file=/package.json) by @trevorblades
## Usage

## Build steps
<Add steps here>
Documentation is based on the Rocketdocs theme for Gatsby:

## Issues
https://github.com/jpedroschmitz/rocketdocs/blob/main/examples/gatsby-theme-docs

* My test setup based on the theme README was throwing errors. I will need to build up to that example from this basic example.
* component errors
The example in the read me requires version tags in your git commits, and other additional steps. This simplified version is enought to get started. The features branch adds component shadowing and sidebars.

* needed to make dummy mdx and md files
The code was throwing an error that seemed to be resolved by the presence of both mdx and md files.

* I had trouble adding the theme with Yarn on MacOSX and needed to add puppeteer first with a Chromium flag

```
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn add puppeteer
```
OR
```
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install puppeteer
```
Empty file removed docs/gatsby-browser.js
Empty file.
83 changes: 44 additions & 39 deletions docs/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,54 @@
module.exports = {
pathPrefix: '/react-native-bluetooth-classic',
trailingSlash: 'always',
siteMetadata: {
siteTitle: `Bluetooth Classic Docs`,
defaultTitle: `Bluetooth Classic Docs`,
siteTitleShort: `RNBluetooth Docs`,
siteDescription: `Documentation site for React Native Bluetooth Classic library`,
siteUrl: `https://kenjdavidson.com/react-native-bluetooth-classic`,
siteAuthor: `@kenjdavidson`,
siteImage: `/banner.png`,
siteLanguage: `en`,
themeColor: `#8257E6`,
basePath: `/`,
},
plugins: [
{
resolve: 'gatsby-theme-apollo-docs',
resolve: `@rocketseat/gatsby-theme-docs`,
options: {
root: __dirname,
siteName: 'React Native Bluetooth Classic',
description: "Communicate with Bluetooth Classic devices on Android and IOS",
defaultVersion: '1.0.0-rc.1',
logoLink: '/react-native-bluetooth-classic',
sidebarCategories: {
null: [
'index',
'api-overview'
],
'React Native': [
'react-native/rn-bluetooth-classic',
'react-native/rn-bluetooth-device'
],
'Android': [
'android/index',
'android/rn-bluetooth-classic-package',
'android/rn-bluetooth-classic-module',
'android/connection-acceptor',
'android/connection-connector',
'android/device-connection'
],
'IOS': [
'ios/index'
],
'Expo': [
'expo/index'
],
'Guides': [
'guides/hex-encoding-decoding'
]
}
}
configPath: `src/config`,
docsPath: `src/docs`,
homePath: `src/home`,
yamlFilesPath: `src/yamlFiles`,
repositoryUrl: `https://github.com/jpedroschmitz/rocketdocs`,
baseDir: `examples/gatsby-theme-docs`,
gatsbyRemarkPlugins: [],
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `React Native Bluetooth Classic`,
short_name: `RN Bluetooth Classic`,
start_url: `/`,
background_color: `#ffffff`,
display: `standalone`,
icon: `static/favicon.png`,
},
},
`gatsby-plugin-sitemap`,
// {
// resolve: `gatsby-plugin-google-analytics`,
// options: {
// trackingId: `YOUR_ANALYTICS_ID`,
// },
// },
{
resolve: `gatsby-plugin-typography`,
resolve: `gatsby-plugin-canonical-urls`,
options: {
pathToConfigModule: `src/utils/typography`,
siteUrl: `https://kenjdavidson.com/react-native-bluetooth-classic`,
},
},

]
`gatsby-plugin-offline`,
],
};
Loading

0 comments on commit 4eee08a

Please sign in to comment.