Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add examples section for navigation history #588

Closed
wants to merge 4 commits into from

Conversation

alicelovescake
Copy link
Member

This PR:

  • Add example section for navigation history
  • Add fiddle example

Note: getAllEntries does not work until this PR is merged, so we can hold on merging or remove the history portion of the example

@alicelovescake alicelovescake requested a review from a team as a code owner July 1, 2024 03:21
@alicelovescake alicelovescake self-assigned this Jul 1, 2024
@MarshallOfSound MarshallOfSound temporarily deployed to electronjsorg-new-pr-588 July 1, 2024 03:21 Inactive
@MarshallOfSound MarshallOfSound temporarily deployed to electronjsorg-new-pr-588 July 1, 2024 03:43 Inactive
Copy link
Member

@dsanders11 dsanders11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these need to land in e/e, not this repo. Anything in docs/latest is overwritten with the latest from e/e when docs sync.

Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few formatting comments for the final PR on e/e

@@ -0,0 +1,61 @@
---
title: "Navigation history"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: "Navigation history"
title: "Navigation History"

The [NavigationHistory](latest/api/navigation-history.md) API allows you to manage and interact with the browsing history of your Electron application. This powerful feature enables you to create intuitive navigation experiences for your users.

### Accessing NavigationHistory
To use NavigationHistory, access it through the webContents of your BrowserWindow:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To use NavigationHistory, access it through the webContents of your BrowserWindow:
To use NavigationHistory, access it through the [webContents](../api/web-contents.md) of your [BrowserWindow](../api/browser-window.md):

Comment on lines +19 to +20
let mainWindow = new BrowserWindow({ width: 800, height: 600 })
let navigationHistory = mainWindow.webContents.navigationHistory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let mainWindow = new BrowserWindow({ width: 800, height: 600 })
let navigationHistory = mainWindow.webContents.navigationHistory
const mainWindow = new BrowserWindow({ width: 800, height: 600 })
const navigationHistory = mainWindow.webContents.navigationHistory

let navigationHistory = mainWindow.webContents.navigationHistory
```
### Key Features
#### Navigating Through History
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Navigating Through History
#### Navigating through history

To be consistent with other docs, all headings should be in sentence case

https://www.electronjs.org/docs/latest/styleguide

Comment on lines +38 to +39
#### Accessing History Entries
Retrieve and display the user's browsing history:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will fail lint. We'll need to add a newline in between each heading and content.

Suggested change
#### Accessing History Entries
Retrieve and display the user's browsing history:
#### Accessing History Entries
Retrieve and display the user's browsing history:

let mainWindow = new BrowserWindow({ width: 800, height: 600 })
let navigationHistory = mainWindow.webContents.navigationHistory
```
### Key Features
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Key Features

I would remove this heading since it doesn't add anything here

@alicelovescake
Copy link
Member Author

alicelovescake commented Jul 21, 2024

Moving this to e/e while adding everyone's feedback!
Draft PR => electron/electron#42980

Todo:

  • need to add update to sidebar.js once e/e is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants