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

[CLOSED] Support Quick Docs (Web Platform Docs) in HTML #8910

Open
core-ai-bot opened this issue Aug 30, 2021 · 27 comments
Open

[CLOSED] Support Quick Docs (Web Platform Docs) in HTML #8910

core-ai-bot opened this issue Aug 30, 2021 · 27 comments

Comments

@core-ai-bot
Copy link
Member

Issue by MarcelGerber
Thursday Nov 27, 2014 at 18:28 GMT
Originally opened as adobe/brackets#10036


Enables Quick Docs for HTML.
Data is still from Web Platform Docs, while HTML data is in html.json and CSS data in css.json.

As there's docs for both tags and attributes, the behaviour is different based on the cursor position.

  • If the cursor's on a (supported) tag like div, docs for the tag will be shown.
  • If the cursor's on a (supported) attribute like tag (but not on its value!), docs for the attribute will be shown.
  • If the cursor's on a unsupported attribute, docs for the tag will be shown (if supported).

Also, there's a new fullscreen-summary class applied when there's only a summary to display and nothing else (this can happen for CSS as well, but only for very few properties). But HTML docs only consist of a summary and thus, it would look odd if it was only half-screen.
Also, the summaries are mostly only consisting of one or two lines (that's what a summary is for) and in fact, that's really short. So I guess the main benefit of Quick Docs in HTML is having the "Read more" link for most users (to get things like Examples, syntax, ... that we can't access via their API). But for some users, like for those learning HTML, even such a short summary can be really helpful.

image

For #9566.


MarcelGerber included the following code: https://github.com/adobe/brackets/pull/10036/commits

@core-ai-bot
Copy link
Member Author

Comment by nethip
Friday Apr 03, 2015 at 19:03 GMT


@ryanstewart Would you mind taking a look at what this PR is doing and tell us we want this in?

@core-ai-bot
Copy link
Member Author

Comment by humphd
Wednesday Jul 22, 2015 at 15:38 GMT


We're using this in Bramble, and we noticed that there's no support for img in html.json, despite the fact that it exists.

    "html/elements/i": {
      "SUMMARY": "<p>The <strong>i</strong> element indicates that the contained text is in an alternate voice, mood, or language from the surrounding text. ",
      "URL": "https://docs.webplatform.org/wiki/html/elements/i"
    },
    "html/elements/iframe": {
      "SUMMARY": "<p>The <strong>iframe</strong> element (&lt;iframe&gt;) introduces a new nested browsing context. ",
      "URL": "https://docs.webplatform.org/wiki/html/elements/iframe"
    },

The docs are at https://docs.webplatform.org/wiki/html/elements/img. If what I'm seeing in html.json is right, that file is pretty old: "DATETIME":"Thu, 27 Nov 2014 17:20:38 GMT.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Wednesday Jul 22, 2015 at 16:25 GMT


Oh that's weird. The Web Platform API returns an empty summary for this and only this page ("html/elements/img":{"printouts":{"Summary":[]},"fulltext":"html/elements/img","fullurl":"//docs.webplatform.org/wiki/html/elements/img"}, part of the bloody mess from https://docs.webplatform.org/w/api.php?action=ask&format=json&query=%20%5B%5BPath%3A%3A~html/elements%2F*%5D%5D%7C%3FSummary%7Cprettyprint%3Dno%7Climit%3D1000000)`@`WebPlatform

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Saturday Jul 25, 2015 at 10:44 GMT


@renoirb As you seem to be working on the Web Platform Docs, could you maybe have a look into why html/elements/img doesn't have a summary (in the API output linked above) whereas every other HTML element has one?
Thanks a lot!

@core-ai-bot
Copy link
Member Author

Comment by prafulVaishnav
Wednesday Sep 16, 2015 at 08:24 GMT


@MarcelGerber API return ja version summary for elements too. As we are not using it, is there any way to not get it? 3 unit tests are failing. Can you please look into that.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Wednesday Sep 16, 2015 at 13:12 GMT


@prafulVaishnav We do use the elements.

@core-ai-bot
Copy link
Member Author

Comment by renoirb
Wednesday Sep 16, 2015 at 14:44 GMT


I'm not fully aware of wha's in use on WebPlatform systems by Brackets. Are you now using rendered HTML and the API or only one of them? I'm asking because a major overhaul is in the works and I might remove completely MediaWiki from the equation. It'll instead use contents from a git repo written in Markdown (see https://github.com/webplatform/docs repo), and converted into static pages (see https://github.com/webatform/generator-docs repo).

I'm doing my best to carry over metadata but I am limited in the time I can spend working on this project. A lot had to be done and I am about to have no time left to work on it.

Problem is that I can't work much longer on the conversion as my position at the W3C ended and we decided to focus on keeping content and history to a simpler system. API wasn't a priority.

If I could find a format that could still work for Brackets, maybe I could fold a Metalsmith generator pass and have a static-file based response body digestible by Brackets.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Wednesday Sep 16, 2015 at 18:06 GMT


@renoirb Thanks for your answer!
In Brackets, we use rendered HTML that has been created by a script that makes use of the MediaWiki API (https://github.com/MarcelGerber/update-wpd-docs). So, Brackets itself does not rely on your API, but we need it to pull updates from.

From that side, it's supposedly not an issue to switch our generator script over to GitHub-hosted Markdown files (I guess Metalsmith is capable of extracting the summary out of Markdown, isn't it?)

@core-ai-bot
Copy link
Member Author

Comment by renoirb
Wednesday Sep 16, 2015 at 18:14 GMT


Oh, thanks for the reminder@MarcelGerber about the cache pass you do and the repo. It makes sense!

As for where you get the data, you do like I did; use MediaWiki API Parser to give a JSON string that contains the HTML it would render. I wish I discovered that earlier. That's what I based my work on https://github.com/webplatform/mediawiki-conversion too.

This makes me wonder now how I could help you get the data instead. If you look at how i'm converting content into Markdown you'll see that I could extract some stuff up into front matter.

Each page becomes a folder with a file index.md. That way, if we have a japanese version, the folder will also contain a ja.md file.

With that being said, I thought to create a meta.yaml that would contain some stuff I am pasting into the front matter. You could then use that as a source to read data from instead. The YAML source could then be converted into JSON via Metalsmith generate pass.

What do you think?

PS: Original idea of moving to front matter was to enable us to eventually make an ElasticSearch index and structure data for use during HTML generation pass.

---
title: border-radius
attributions:
  - 'Mozilla Developer Network [![cc-by-sa-small-wpd.svg](/assets/thumb/8/8c/cc-by-sa-small-wpd.svg/120px-cc-by-sa-small-wpd.svg.png)](http://creativecommons.org/licenses/by-sa/3.0/us/): [[Border-radius](https://developer.mozilla.org/en-US/docs/CSS/border-radius) Article]'
  - 'Microsoft Developer Network: [[Windows Internet Explorer API reference](http://msdn.microsoft.com/en-us/library/ie/hh828809%28v=vs.85%29.aspx) Article]'
code_samples:
  - 'http://gist.github.com/5495188'
overview_table:
  '[Initial value](/css/concepts/initial_value)': '`0`'
  'Applies to': 'All elements, except the table element when border-collapse is collapse'
  '[Inherited](/css/concepts/inherited)': 'No'
  Media: visual
  '[Computed value](/css/concepts/computed_value)': 'As specified by individual properties'
  Animatable: 'Yes'
  '[CSS Object Model Property](/css/concepts/cssom)': '`borderRadius`'
  Percentages: 'Refer to the corresponding dimension (width or height) of the border box.'
readiness: 'Ready to Use'
standardization_status: 'W3C Candidate Recommendation'
summary: 'The border-radius CSS property allows authors to round the corners of an element. The rounding can be different per-corner, and it could have different horizontal and vertical radii, to produce elliptical curves.'
tags:
  - CSS
  - Properties
todo_broken_links:
  note: 'During import MediaWiki could not find the following links, please fix and adjust this list.'
  links:
    - dom/defaultSelected
uri: css/properties/border-radius

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Wednesday Sep 16, 2015 at 18:20 GMT


Making clever use of the GH API and some other clever tricks, I guess I can make it work with the new Markdown content as well.

@core-ai-bot
Copy link
Member Author

Comment by renoirb
Wednesday Sep 16, 2015 at 18:20 GMT


Maybe I should use the #ask API and serialize it in some way too. But its going beyond where I have time to work on.

Could you help me there and do similar work for other parts of the site?

If you could create sets of JSON or YAML files for each folder that has metadata to extract from SMW, that would be much helpful!

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Wednesday Sep 16, 2015 at 18:32 GMT


@renoirb Maybe we can continue this discussion on Slack (https://brackets-slack.herokuapp.com).

So, I don't really know what exactly you want me to do, even though I'd like to help.
Wouldn't it be more helpful to have the JSON/YAML files reflect the actual contents we have in the repo? (They are likely the same now, but will change in the future I guess)

@core-ai-bot
Copy link
Member Author

Comment by Denisov21
Sunday May 15, 2016 at 16:33 GMT


Hi,
Can you move this to Breackets Realise 1.7?

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Sunday May 15, 2016 at 19:43 GMT


I'm also honestly thinking about switching over to MDN docs, as they are more recent, more thorough, and more commonly used.

What do you think,@nethip@Denisov21?

@core-ai-bot
Copy link
Member Author

Comment by nethip
Monday May 16, 2016 at 18:33 GMT


@MarcelGerber 👍 for switching to MDN.

@core-ai-bot
Copy link
Member Author

Comment by Denisov21
Monday May 16, 2016 at 18:42 GMT


@MarcelGerber Okay for me. Good idea!

Inviato da smartphone Sony Xperia™

---- Marcel Gerber ha scritto ----

I'm also honestly thinking about switching over to MDN docs, as they are more recent, more thorough, and more commonly used.

What do you think,@nethip@Denisov21?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@core-ai-bot
Copy link
Member Author

Comment by swmitra
Thursday Feb 16, 2017 at 07:38 GMT


@MarcelGerber I don't see any pending action in this PR.
Do we need to update the html.json? Also is it web-scrapped from MDN html meta data?
If we can retain the committed documentation without immediate update, then I will merge this PR 😄

@core-ai-bot
Copy link
Member Author

Comment by humphd
Friday Feb 17, 2017 at 16:23 GMT


fwiw, we wrote an MDN based version of this a long time ago as a separate extension: https://github.com/mozilla/brackets/tree/master/src/extensions/extra/MDNDocs

@core-ai-bot
Copy link
Member Author

Comment by renoirb
Saturday Feb 18, 2017 at 11:52 GMT


On a related note;

On Feb 17, 2017 11:24, "David Humphrey" [email protected] wrote:

fwiw, we wrote an MDN based version of this a long time ago as a separate
extension: https://github.com/mozilla/brackets/tree/master/src/
extensions/extra/MDNDocs


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
adobe/brackets#10036 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AASH7B_ltLPmZcw_30K4s0aOsyw3r_HVks5rdcmugaJpZM4DBh9j
.

@core-ai-bot
Copy link
Member Author

Comment by renoirb
Saturday Feb 18, 2017 at 11:56 GMT


[[ Hit send too quickly ]]

On a related note.

Notice: The WebPlatform project has been discontinued when the Stewards
partnership http://www.webplatform.org/blog/2012/10/one-small-step/ agreement
ended in September 2015. This site has been frozen, and the assets we
have created will remain.

Also, for compatibility data at Mozilla, you should have a look at
BrowserCompat project.

https://browsercompat.herokuapp.com

It's a nice project to expose compat data and specs status over JSONAPI
format.

On Feb 17, 2017 11:24, "David Humphrey" [email protected] wrote:

fwiw, we wrote an MDN based version of this a long time ago as a separate
extension: https://github.com/mozilla/brackets/tree/master/src/
extensions/extra/MDNDocs


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
adobe/brackets#10036 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AASH7B_ltLPmZcw_30K4s0aOsyw3r_HVks5rdcmugaJpZM4DBh9j
.

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Sunday Feb 19, 2017 at 15:28 GMT


@humphd Nice!

Some questions, things I noticed:

  • is it a drop in replacement of Webplatform docs? If so we could rename it to try to preserve the git history
  • are the api you are using for scraping documented somewhere?
  • should we retain our unit tests? (It seems to me you don't have any)
  • IMO the app for the scraping shouldn't be part of the distribution. So we could create a new repo (maybe at brackets-userland org) or see what we can do with the build system (avoid to copy it for the dist or create a specific task or something...)

@adobe/brackets-committers any thought?

@core-ai-bot
Copy link
Member Author

Comment by saurabh95
Thursday Mar 09, 2017 at 13:57 GMT


@humphd I tried running the app and I was able to generate html.json and css.json, but in css.json it gives only url and summary, and currently we have the description of values supported for a particular attribute as well, so is there a way to get info about the values of a particular css attribute?

@core-ai-bot
Copy link
Member Author

Comment by humphd
Thursday Mar 09, 2017 at 16:01 GMT


cc@JordanTheriault, who worked on the code originally. @saurabh95 I think what we have now is really best viewed as a prototype, and it's not been well maintained. I suspect that we could extend it to do what's needed, perhaps one of my current students would be interested in working on it. NOTE: we don't currently ship/use it in Thimble, we still use the WebPlatformDocs with the extra html patch that@MarcelGerber wrote once upon a time.

@core-ai-bot
Copy link
Member Author

Comment by renoirb
Thursday Mar 09, 2017 at 16:14 GMT


On a related note.

W3C system Team actually did flip the switch off from WebPlatform Docs'
MediaWiki instance (what was driving the site).

All of it is now only static HTML hosted on GitHub pages reading from
converted to Markdown history. -- I wrote the migration

This is to nail the point that WebPlatform is on its own. W3C and all
sponsors won't support it any further.

Unless a comunity emerges. That's outside of the scope of this ticket.

We should close this issue.

Renoir

Renoir Boulanger
https://renoirboulanger.com/ https://renoirboulanger.com/#is@renoirb
https://github.com/renoirb
Check my availability: https://freebusy.io/[email protected]
Meet me: https://appear.in/renoirb
~

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Friday Apr 07, 2017 at 18:47 GMT


@saurabh95 it doesn't seem the tests were ported on the new code.
Maybe you can close this and open a new PR with the tests?

@core-ai-bot
Copy link
Member Author

Comment by saurabh95
Saturday Apr 08, 2017 at 04:19 GMT


Yeah, will do that

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Sunday Apr 09, 2017 at 12:21 GMT


These changes were merged as part of adobe/brackets#13268 and adobe/brackets#13285.
Closing.
Thanks@MarcelGerber

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

No branches or pull requests

1 participant