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

Renamed getHeaders() to getHeadings() #1107

Closed
wants to merge 3 commits into from
Closed

Conversation

natemoo-re
Copy link
Member

What kind of changes does this PR include?

  • New or updated content
  • Changes to the docs site code

Description

This PR deprecates getHeaders() documentation in favor of getHeadings(). According to the HTML spec, these are headings. The only part of the spec where the word "headers" appear is in the context of

tag. MDN also uses headings to refer the tags.

Depends on withastro/astro#4031

  • What does this PR change? Give us a brief description.
  • Did you change something visual? A before/after screenshot can be helpful.

1655482510

@netlify
Copy link

netlify bot commented Jul 23, 2022

Deploy Preview for astro-docs-2 failed.

Name Link
🔨 Latest commit 3132ef2
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/62f146d746ccd90008041564

@natemoo-re
Copy link
Member Author

Whoops, looks like there are some merge conflicts still. I'll take a stab at resolving these soon.

#### `getHeaders()`

An async function that returns the headers of the Markdown file. The response follows this type: `{ depth: number; slug: string; text: string }[]`.
:::caution[Deprecated]
The `getHeaders()` function has been renamed to `getHeadings()`. Please update your code to use `getHeadings()`.
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
The `getHeaders()` function has been renamed to `getHeadings()`. Please update your code to use `getHeadings()`.
The `getHeaders()` function has been renamed. To update an older project, please use `getHeadings()` instead.

Just a suggestion to be more explicit about which one to use. Similarly, a note about this should end up in the migration guide. (You could probably use this as-is there.)

@sarah11918 sarah11918 added the improve documentation Enhance existing documentation (e.g. add an example, improve description) label Jul 25, 2022
@sarah11918
Copy link
Member

@sarah11918
Copy link
Member

sarah11918 commented Aug 8, 2022

@natemoo-re I was easily able to resolve the conflict here, so I did, FYI.

Looks like now it's PageContent and RightSidebar that have some old merge conflict syntax in them?

@delucis
Copy link
Member

delucis commented Aug 12, 2022

A lot of these changes to site code have already been handled, so I’m going to close this and raise a new PR with just the docs content changes.

@delucis delucis closed this Aug 12, 2022
@delucis delucis mentioned this pull request Aug 12, 2022
@sarah11918 sarah11918 deleted the felixsanz/main branch December 13, 2022 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve documentation Enhance existing documentation (e.g. add an example, improve description)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants