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

document the process(es) in which APIs are available #7843

Merged
merged 4 commits into from
Nov 3, 2016
Merged

Conversation

zeke
Copy link
Contributor

@zeke zeke commented Nov 1, 2016

The docs linter currently contains a seeds file that lists all APIs and some extra metadata for each. It looks like this:

module.exports = [
  {
    name: 'clipboard',
    process: {main: true, renderer: true}
  },
  {
    name: 'crashReporter',
    process: {main: true, renderer: true}
  },
  {
    name: 'nativeImage',
    process: {main: true, renderer: true}
  },
  {
    name: 'NativeImage',
    process: {main: true, renderer: true},
    parentDoc: 'native-image',
    instanceName: 'image'
  }
 // etc
]

We eventually want to get rid of this file and enable the linter to infer everything it needs to know solely from the contents of /docs/api.

So... let's document the process(es) in which each API is available within the markdown docs themselves. I've staged a few files with what seems like a reasonable way to annotate this.

Before updating every doc, I want to get feedback on the idea and implementation. What do you think, @electron/maintainers?

@enlight
Copy link
Contributor

enlight commented Nov 2, 2016

What about these metadata fields?

parentDoc: 'native-image',
instanceName: 'image'

@zeke
Copy link
Contributor Author

zeke commented Nov 2, 2016

parentDoc will no longer be necessary once each API has its own markdown file.

instanceName was a shortcut but can actually be inferred from instance methods in existing docs, e.g. win from win.isMaximized()

Planning to tackle those separately from this PR.

@@ -2,6 +2,8 @@

> Perform copy and paste operations on the system clipboard.

Processes: [Main](../tutorial/quick-start.md#main-process), [Renderer](../tutorial/quick-start.md#renderer-process)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer Processes -> Process

@zeke zeke changed the title [WIP] document the process(es) in which APIs are available document the process(es) in which APIs are available Nov 3, 2016
@zeke
Copy link
Contributor Author

zeke commented Nov 3, 2016

Ready for 👁 👁

@kevinsawicki

@@ -2,6 +2,9 @@

> Retrieve information about screen size, displays, cursor position, etc.

Process: [Main](../tutorial/quick-start.md#main-process),
[Renderer](../tutorial/quick-start.md#renderer-process)
Copy link
Contributor

@kevinsawicki kevinsawicki Nov 3, 2016

Choose a reason for hiding this comment

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

Super duper minor, but looks like most places in the diff put both processes on a single line, but this one (and shell.md) split it over two lines.

Copy link
Contributor

@kevinsawicki kevinsawicki left a comment

Choose a reason for hiding this comment

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

LGTM

@zeke zeke merged commit ef9d8fe into master Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants