Skip to content

Commit 2efe2c8

Browse files
ihabadhamclaude
andcommitted
Fix multiple H1 headings in documentation for improved search indexing
Continue fixing H1 heading issues by addressing files with multiple H1s. Demoted duplicate H1s to H2 throughout documentation while maintaining proper heading hierarchy (H1→H2→H3→H4). Files changed: - tutorial.md: Demoted 6 H1s (Table of Contents, Installation, HMR, Deployment, Going Further, Conclusion) - rails-engine-integration.md: Changed "Github Issues" H1 to H2 - hmr-and-hot-reloading-with-the-webpack-dev-server.md: Fixed 2 H1s with proper hierarchy - i18n.md: "Notes" H1 to H2 - react-and-redux.md: "Redux Reducers" H1 to H2 - react-router.md: "Server Rendering Using React Router V4" H1 to H2 - rspec-configuration.md: 2 H1s to H2s - generator-details.md: "Understanding the Organization..." H1 to H2 - redux-store-api.md: "More Details" H1 to H2 - view-helpers-api.md: "More details" H1 to H2 - style.md: "Git Usage" H1 to H2 Rationale: Multiple H1s per document confuse Algolia search ranking, screen readers, and violate accessibility standards. Each document should have exactly one H1 as the main title. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 03b1acd commit 2efe2c8

File tree

11 files changed

+33
-33
lines changed

11 files changed

+33
-33
lines changed

docs/advanced-topics/rails-engine-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ As far as solving the assets issue, `lib/tasks/assets.rake` in `react_on_rails`
3232

3333
Another solution would be to detach this rake task from the `rails assets:precompile` task. This can be done by adding `REACT_ON_RAILS_PRECOMPILE=false` to your environment. If you do so, then React assets will have to be bundled separately from `rails assets:precompile`.
3434

35-
# Github Issues
35+
## Github Issues
3636

3737
- [Integration with an engine #342](https://github.com/shakacode/react_on_rails/issues/342)
3838
- [Feature: target destination option for the install generator #459](https://github.com/shakacode/react_on_rails/issues/459)

docs/api-reference/generator-details.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Then you may run
3939

4040
Another good option is to create a simple test app per the [Tutorial](../getting-started/tutorial.md).
4141

42-
# Understanding the Organization of the Generated Client Code
42+
## Understanding the Organization of the Generated Client Code
4343

4444
The generated client code follows our organization scheme. Each unique set of functionality is given its own folder inside of `app/javascript/app/bundles`. This encourages modularity of _domains_.
4545

@@ -51,7 +51,7 @@ Inside the generated "HelloWorld" domain you will find the following folders:
5151

5252
You may also notice the `app/lib` folder. This is for any code that is common between bundles and therefore needs to be shared (for example, middleware).
5353

54-
## Redux
54+
### Redux
5555

5656
If you have used the `--redux` generator option, you will notice the familiar additional redux folders in addition to the aforementioned folders. The Hello World example has also been modified to use Redux.
5757

docs/api-reference/redux-store-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ This method has the same API as the controller extension. **HOWEVER**, we recomm
9898

9999
Place this view helper (no parameters) at the end of your shared layout so ReactOnRails will render the redux store hydration data. Since we're going to be setting up the stores in the controllers, we need to know where on the view to put the client-side rendering of this hydration data, which is a hidden div with a matching class that contains a data props. For an example, see [spec/dummy/app/views/layouts/application.html.erb](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/app/views/layouts/application.html.erb).
100100

101-
# More Details
101+
## More Details
102102

103103
- [lib/react_on_rails/controller.rb](https://github.com/shakacode/react_on_rails/tree/master/lib/react_on_rails/controller.rb) source
104104
- [lib/react_on_rails/helper.rb](https://github.com/shakacode/react_on_rails/tree/master/lib/react_on_rails/helper.rb) source

docs/api-reference/view-helpers-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,6 @@ See the [React on Rails Pro Configuration](https://github.com/shakacode/react_on
158158

159159
---
160160

161-
# More details
161+
## More details
162162

163163
See the [lib/react_on_rails/helper.rb](https://github.com/shakacode/react_on_rails/tree/master/lib/react_on_rails/helper.rb) source.

docs/building-features/hmr-and-hot-reloading-with-the-webpack-dev-server.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ If you are **_not_** using server-side rendering (**_not_** using `prerender: tr
1414
then you can follow all the regular docs for using the `bin/shakapacker-dev-server`
1515
during development.
1616

17-
# Server Side Rendering with the Default shakacode/shakapacker bin/shakapacker-dev-server
17+
## Server Side Rendering with the Default shakacode/shakapacker bin/shakapacker-dev-server
1818

1919
If you are using server-side rendering, then you have a couple of options. The
2020
recommended technique is to have a different Webpack configuration for server
2121
rendering.
2222

23-
## If you use the same Webpack setup for your server and client bundles
23+
### If you use the same Webpack setup for your server and client bundles
2424

2525
If you do use the `webpack-dev-server` for prerendering, be sure to set the
2626
`config/initializers/react_on_rails.rb` setting of
@@ -40,9 +40,9 @@ If you don't configure these two to false, you'll see errors like:
4040
- `ReferenceError: window is not defined` (if `hmr` is true)
4141
- `TypeError: Cannot read property 'prototype' of undefined` (if `inline` is true)
4242

43-
# Client-Side rendering with HMR using react-refresh-webpack-plugin
43+
## Client-Side rendering with HMR using react-refresh-webpack-plugin
4444

45-
## Basic installation
45+
### Basic installation
4646

4747
To enable the HMR functionality, you have to use `./bin/shakapacker-dev-server`
4848

docs/building-features/i18n.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ By default, the locales are generated as JSON, but you can also generate them as
9292
)
9393
```
9494

95-
# Notes
95+
## Notes
9696

9797
- See why using JSON can perform better compared to JS for large amounts of data [https://v8.dev/blog/cost-of-javascript-2019#json](https://v8.dev/blog/cost-of-javascript-2019#json).
9898
- See [Support for Rails' i18n pluralization #1000](https://github.com/shakacode/react_on_rails/issues/1000) for a discussion of issues around pluralization.

docs/building-features/react-and-redux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
See [Sharing State Between Components](https://react.dev/learn/sharing-state-between-components).
66

7-
# Redux Reducers
7+
## Redux Reducers
88

99
The `helloWorld/reducers/index.jsx` example that results from running the generator with the Redux option may be slightly confusing because of its simplicity. For clarity, what follows is a more fleshed-out example of what a reducer might look like:
1010

docs/building-features/react-router.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ For a fleshed out integration of React on Rails with React Router, check out [Re
2828

2929
- [react-webpack-rails-tutorial/client/app/bundles/comments/routes/routes.jsx](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/client/app/bundles/comments/routes/routes.jsx)
3030

31-
# Server Rendering Using React Router V4
31+
## Server Rendering Using React Router V4
3232

3333
Your Render-Function may not return an object with the property `renderedHtml`. Thus, you call
3434
`renderToString()` and return an object with this property.

docs/building-features/rspec-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
_Click [here for minitest](../building-features/minitest-configuration.md)_
44

5-
# If your Webpack configurations correspond to Shakapacker's default setup
5+
## If your Webpack configurations correspond to Shakapacker's default setup
66

77
If you're able to configure your Webpack configuration to be run by having your Webpack configuration
88
returned by the files in `/config/webpack`, then you have 2 options to ensure that your files are
@@ -20,7 +20,7 @@ config.build_test_command = "NODE_ENV=test RAILS_ENV=test bin/shakapacker"
2020
Which should you use? If you're already using the `Shakapacker` way to configure Webpack, then
2121
you can keep things simple and use the `Shakapacker` options.
2222

23-
# Checking for stale assets using React on Rails
23+
## Checking for stale assets using React on Rails
2424

2525
Because you will probably want to run RSpec tests that rely on compiled Webpack assets (typically, your integration/feature specs where `js: true`), you will want to ensure you don't accidentally run tests on missing or stale Webpack assets. If you did use stale Webpack assets, you will get invalid test results as your tests do not use the very latest JavaScript code.
2626

docs/getting-started/tutorial.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ By the time you read this, the latest may have changed. Be sure to check the ver
2222
- [https://rubygems.org/gems/react_on_rails](https://rubygems.org/gems/react_on_rails)
2323
- [https://www.npmjs.com/package/react-on-rails](https://www.npmjs.com/package/react-on-rails)
2424

25-
# Table of Contents
25+
## Table of Contents
2626

2727
- [Installation](#installation)
2828
- [Setting up your environment](#setting-up-your-environment)
@@ -42,9 +42,9 @@ By the time you read this, the latest may have changed. Be sure to check the ver
4242
- [RubyMine performance tip](#rubymine-performance-tip)
4343
- [Conclusion](#conclusion)
4444

45-
# Installation
45+
## Installation
4646

47-
## Setting up your environment
47+
### Setting up your environment
4848

4949
Trying out **React on Rails** is super easy, so long as you have the basic prerequisites.
5050

@@ -54,7 +54,7 @@ Trying out **React on Rails** is super easy, so long as you have the basic prere
5454
- **yarn:** We use [yarn classic](https://classic.yarnpkg.com/) as our node package manager.
5555
- You need to have either [Overmind](https://github.com/DarthSim/overmind) or [Foreman](https://rubygems.org/gems/foreman) as a process manager.
5656

57-
## Create a new Ruby on Rails App
57+
### Create a new Ruby on Rails App
5858

5959
Then we need to create a fresh Rails application as follows.
6060

@@ -72,7 +72,7 @@ cd test-react-on-rails
7272

7373
Note: You can use `--database=postgresql` option to use Postgresql for the database.
7474

75-
## Add the Shakapacker and react_on_rails gems
75+
### Add the Shakapacker and react_on_rails gems
7676

7777
We recommend using the latest version of these gems. Otherwise, specify the
7878
exact versions of both the gem and npm packages. In other words, don't use
@@ -86,7 +86,7 @@ bundle add shakapacker --strict
8686
Note: The latest released React On Rails version is considered stable. Please use the latest
8787
version to ensure you get all the security patches and the best support.
8888

89-
## Run the Shakapacker generator
89+
### Run the Shakapacker generator
9090

9191
```bash
9292
bundle exec rails shakapacker:install
@@ -100,7 +100,7 @@ git commit -am "Initial commit"
100100

101101
Alternatively, you can use `--ignore-warnings` in the next step.
102102

103-
## Run the React on Rails Generator
103+
### Run the React on Rails Generator
104104

105105
```bash
106106
rails generate react_on_rails:install
@@ -118,7 +118,7 @@ rails generate react_on_rails:install --redux
118118

119119
If you prefer to use React Hooks instead of Redux, run the basic installer without the `--redux` flag.
120120

121-
## Setting up your environment variables
121+
### Setting up your environment variables
122122

123123
Add the following variable to your environment:
124124

@@ -128,7 +128,7 @@ EXECJS_RUNTIME=Node
128128

129129
Then run the server with one of the following options:
130130

131-
## Running the app
131+
### Running the app
132132

133133
```bash
134134
./bin/dev # For HMR
@@ -138,7 +138,7 @@ Then run the server with one of the following options:
138138

139139
Visit [http://localhost:3000/hello_world](http://localhost:3000/hello_world) and see your **React On Rails** app running!
140140

141-
# HMR vs. React Hot Reloading
141+
## HMR vs. React Hot Reloading
142142

143143
First, check that the `hmr` and the `inline` options are `true` in your `config/shakapacker.yml` file.
144144

@@ -154,7 +154,7 @@ If you want to go further with HMR, take a look at these links:
154154

155155
React on Rails will automatically handle disabling server rendering if there is only one bundle file created by the Webpack development server by `shakapacker`.
156156

157-
# Deployment
157+
## Deployment
158158

159159
Now that you have React on Rails working locally, you're ready to deploy to production!
160160

@@ -171,9 +171,9 @@ These guides cover:
171171
- Environment variables
172172
- Troubleshooting common deployment issues
173173

174-
# Going Further
174+
## Going Further
175175

176-
## Turning on Server Rendering
176+
### Turning on Server Rendering
177177

178178
You can turn on server rendering by simply changing the `prerender` option to `true`:
179179

@@ -217,9 +217,9 @@ For more details on server rendering, see:
217217
- [Client vs. Server Rendering](../core-concepts/client-vs-server-rendering.md)
218218
- [React Server Rendering](../core-concepts/react-server-rendering.md)
219219

220-
## Optional Configuration
220+
### Optional Configuration
221221

222-
### Moving from the Rails default `/app/javascript` to the recommended `/client` structure
222+
#### Moving from the Rails default `/app/javascript` to the recommended `/client` structure
223223

224224
ShakaCode recommends that you use `/client` for your client side app. This way a non-Rails, front-end developer can be at home just by opening up the `/client` directory.
225225

@@ -235,7 +235,7 @@ mv app/javascript client
235235
source_path: client
236236
```
237237
238-
### Custom IP & PORT setup (Cloud9 example)
238+
#### Custom IP & PORT setup (Cloud9 example)
239239
240240
In case you are running some custom setup with different IP or PORT you should also edit Procfile.dev. For example, to be able to run on free Cloud9 IDE we are putting IP 0.0.0.0 and PORT 8080. The default generated file `Procfile.dev` uses `-p 3000`.
241241

@@ -245,14 +245,14 @@ web: rails s -p 8080 -b 0.0.0.0
245245

246246
Then visit https://your-shared-addr.c9users.io:8080/hello_world
247247

248-
### RubyMine performance tip
248+
#### RubyMine performance tip
249249

250250
It's super important to exclude certain directories from RubyMine or else it will slow to a crawl as it tries to parse all the npm files.
251251

252252
- Generated files, per the settings in your `config/shakapacker.yml`, which default to `public/packs` and `public/packs-test`
253253
- `node_modules`
254254

255-
# Conclusion
255+
## Conclusion
256256

257257
- Browse the docs on [our documentation website](https://www.shakacode.com/react-on-rails/docs/)
258258

0 commit comments

Comments
 (0)