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

Link to MDN API docs from intellisense #12

Closed
mjbvz opened this issue Aug 29, 2017 · 7 comments
Closed

Link to MDN API docs from intellisense #12

mjbvz opened this issue Aug 29, 2017 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@mjbvz
Copy link

mjbvz commented Aug 29, 2017

From @Tyriar on February 23, 2016 17:10

It would be very convenient to have links to API documentation (MDN?) directly within intellisense for HTML, CSS and JS.

image

(Currently HTML descriptions is pulled from the spec)

Copied from original issue: microsoft/vscode#3358

@aeschli aeschli added this to the Backlog milestone Nov 24, 2017
@aeschli aeschli added feature-request Request for new features or functionality and removed feature-request html labels Nov 24, 2017
@erikadoyle
Copy link

erikadoyle commented Feb 9, 2018

Here's a way to grab the full directory of MDN's HTML reference:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element$children?expand

By pulling that down, you can query the JSON for individual tag summaries and page URLs. FYI the payload also includes localized pages, so you'll want to account for that in your query.

You can also form similar query strings for other areas:

CSS
https://developer.mozilla.org/en-US/docs/Web/CSS$children?expand

DOM APIs
https://developer.mozilla.org/en-US/docs/Web/API$children?expand

JavaScript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference$children?expand

@connorshea
Copy link

It may be a better idea to use the browser-compat-data repo to find documentation links for each HTML element. You can find the full list of elements at https://github.com/mdn/browser-compat-data/tree/master/html/elements

The BCD is already used by the CSS language server and has been proposed to be used in #22 and #30.

@octref
Copy link
Contributor

octref commented Oct 4, 2018

/cc @atopal

@octref
Copy link
Contributor

octref commented Oct 4, 2018

Re @connorshea, this is something I talked to Mozilla about and look forward to adding. We'll most likely use mdn/data instead of mdn/browser-compat-data for this, and start from CSS.

octref added a commit that referenced this issue Jan 15, 2019
Changes:

- Feature: HTML attribute completion documentation
- Rename: tagProvider -> dataProvider
- API: Now in sync with CSS LS API
- HTMLTagSpecification converted to serializable plain data structure
so does attributes and attribute values
- Remove Angular1/Ionic1 support
- Remove i18n for HTML tags, and manage them in a plain JSON-like file because
  - We don't have i18n support in LSP yet
  - There's no translation yet
  - The JSON-like file is typed and can be easily mainaintaed
  - We'll start pulling data from W3C HTML spec and MDN to do features
  such as short descriptions, browser support table adn syntax. Such
  plain JSON-like files are easy to auto-generate.
  - Unblocks #12, #30, #44

Fixes:

- Fix microsoft/vscode#2784
- Part of microsoft/vscode#63955 (no CompletionItem.documentation for attr value yet)
octref added a commit that referenced this issue Jan 15, 2019
Changes:

- Feature: HTML attribute completion documentation
- Rename: tagProvider -> dataProvider
- API: Now in sync with CSS LS API
- HTMLTagSpecification converted to serializable plain data structure
so does attributes and attribute values
- Remove Angular1/Ionic1 support
- Remove i18n for HTML tags, and manage them in a plain JSON-like file because
  - We don't have i18n support in LSP yet
  - There's no translation yet
  - The JSON-like file is typed and can be easily mainaintaed
  - We'll start pulling data from W3C HTML spec and MDN to do features
  such as short descriptions, browser support table adn syntax. Such
  plain JSON-like files are easy to auto-generate.
  - Unblocks #12, #30, #44

Fixes:

- Fix microsoft/vscode#2784
- Part of microsoft/vscode#63955 (no CompletionItem.documentation for attr value yet)
@octref octref changed the title Link to API docs from intellisense Link to MDN API docs from intellisense Apr 3, 2019
octref added a commit that referenced this issue Aug 20, 2019
octref added a commit that referenced this issue Aug 20, 2019
@octref octref closed this as completed in a6ee766 Aug 23, 2019
octref added a commit that referenced this issue Aug 23, 2019
Add back links and refer to MDN. FIx #12
@atopal
Copy link

atopal commented Aug 26, 2019

That's really awesome @octref! Many thanks for this. I was wondering if we could add a URL parameter, so we can see on the MDN side when requests come from this? It helps us justify spending time on our "make MDN content available outside of MDN" efforts when we can demonstrate usage and we can optimize content for this usage in the future. Either way: really happy to see this :)

@octref
Copy link
Contributor

octref commented Aug 26, 2019

@atopal Thanks for your help from MDN! We'll investigate how to do that: #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

6 participants