eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
106 stars 125 forks source link

Official SWT snippet page links to no longer existing Snippet 329 #334

Open de-jcup opened 1 year ago

de-jcup commented 1 year ago

Describe the bug At https://www.eclipse.org/swt/snippets/ there is a snippet 329 mentioned: zoom HTML page content in a Mozilla Browser

The Snippet 329 is no longer available inside the git repository.

To Reproduce Just open the former mentioned page and click on the link - it does not work.

Expected behavior The link shall open the correct snippet, or the link shall be removed on the web page.

Phillipus commented 1 year ago

I found a version of it here:

https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet329.java?h=R4_7_maintenance

I don't think it works now

Phillipus commented 1 year ago

See:

https://github.com/eclipse-platform/eclipse.platform.swt/commit/18326ae5bb99e1bc2fe12f7d3b1b1b678c9b97b5

akurtakov commented 1 year ago

Snippet should be deleted from the page. Repo is here https://github.com/eclipse-platform/www.eclipse.org-swt if someone else wants to fix it.

Phillipus commented 1 year ago

I've updated the Snippets.md file. It gets hard to maintain two lists with the one at https://github.com/eclipse-platform/www.eclipse.org-swt

https://github.com/eclipse-platform/eclipse.platform.swt/pull/336

akurtakov commented 1 year ago

Well, a good fix might be removing the content on the page and put a simple "Content on this page is now maintained together with sources at LINK_TO_SNIPPETS.md"

de-jcup commented 1 year ago

Hm... looking at https://github.com/eclipse-platform/www.eclipse.org-swt/blob/master/snippets/index.php it seems to be manual written code?

Maintaining the overview pages in a manual way is IMHO a little bit cumbersome and could/can lead to problems/ forgotten changes etc.

Idea

If I would be in charge for maintaining this and this would happen often, I would prefer to have the meta information near the origin (snippet) code and generate the markdown or php /documentation files.

Here an example:

...
Snippet327.java
Snippet327.json
Snippet328.java
Snippet328.json
...

The corresponding meta data JSON file structure could look like

{
   "group" : "controls",
   "title" :  "This is snippet with xyz ... ",
   "preview" : "...link",
   "something-else" : "..."
}

By using a similar file name it would be clear which snippet is described, without setting it inside the file.

A simple generator could be written to create documentation and more. Those meta nformation files could be also used inside the Snippet-Explorer (e.g. automated grouping etc.)

If a developer changes or add some snippets he/she could directly change/create the JSON file and start the generator and deploy new version (or this could be automated as well).

akurtakov commented 1 year ago

Are you interested in contributing such automation? Let's say we don't care about php files and will just redirect to the github page for that.

de-jcup commented 1 year ago

@akurtakov : Sorry for the very late response - at the moment I am very busy and my own FOSS projects are suffering on the lack of time. So currently I have no time, but maybe later.