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
Porting electron-api-demos to Electron Fiddle examples in docs #20442
Comments
I would like to work on this. Can this be assigned to me? |
@97amarnathk Feel free to submit a PR for any demo (see #20441 for an example). I'll keep the meta-issue with assignees as the PRs flow in. |
@erickzhao Where do I find the HTML files related to synchronous communication? |
@97amarnathk You can find all relevant HTML files included in the For more info on how |
@erickzhao I have submitted #20451 for Synchronous Messages. |
Hey @erickzhao, had a question for you. I am working on adding the manage window section in which the renderer is referencing a local html file by path (modal.html). I can't add additional files to Fiddle to be referenced. What's the workaround? |
@erickzhao I have submitted #20480 for 'Create a new Window' i can grab another one as soon as this pull gets merged. Thanks for checking it out :) |
@erickzhao I added a PR for getting app info. |
@ericbrumer Raised PR for context menu Also, didn't find any |
Hmmm 👉🏼#20468 |
Hey @yashints,
I will close my PR and I guess I would have to go through all the linked PRs to get an idea of what's already taken. |
Sorry for the confusion, will update the list ASAP and get to reviewing some PRs today :) |
@erickzhao , I provided a PR for app information and not clipboard. Could you update the Issue description accordingly? |
@erickzhao I need to find out how to include assets (icons, templates, etc) in Fiddle examples, any hints? |
@yashints Previous patterns simply generated the image from the Data URL See: https://github.com/electron/fiddle/blob/master/static/show-me/tray/main.js |
Thanks, what about html templates? like modals |
@yashints I talked about this a bit in the Create Window PR, but as a solution, loading an external URL (e.g. |
NP, I will create my PR with an external link then |
Refs #20442 Adds the basic notification and notification with custom image examples from electron-api-demos into runnable Fiddle examples. Gist links to Fiddles (same as code submitted in this PR): Basic Notification: https://gist.github.com/102945f83f559e7944797175d8fd8af4 Notification with image: https://gist.github.com/2688bf4bfc27ce02f5d74224828eb928 Co-Authored-By: Erick Zhao <erick@hotmail.ca>
@erickzhao is it okay if i get started on another pull or should i wait for my previous one to be reviewed? |
@wedob13 I'd say to go for it! I've been lagging behind on reviewing the PRs lately. |
…on of opening all outbound links (#20763)
…her app, including all 3 files main.js, index.html, renderer.js (#20718)
This is pretty much done in 2022 :) |
Context
This meta-issue addresses a need to bridge the gap between our website's online docs,
electron-api-demos
, and Electron Fiddle.What's
electron-api-demos
?As the name indicates,
electron-api-demos`
is a collection of examples for Electron APIs wrapped in an application. Each demo contains a executable example of the API along with sample code and additional explanations.What's Electron Fiddle?
Electron Fiddle is a code playground allowing developers to tinker around with small experiments that can later be exported into full-fledged Electron applications. The interface allows users to create and run small Electron apps with a single
main.js
,renderer.js
, andindex.html
.Motivation
electron-api-demos
into Fiddle-friendly examples is a big step into ultimately having API code samples available in the docs as runnable Fiddles.Current Progress
electron/electron repo
(see feat: add support for launch examples from the Electron docs fiddle#203). However, there are currently no examples!Task
We will be attempting to port over all of the
electron-api-demos
examples in the codebase. For context on how API demos are structured, see the docs here.The task is to ultimately convert each demo into an Electron Fiddle sample that's equivalent in functionality. Please include the explanatory text from the HTML files as well. Note that many of these demos are tightly coupled in logic, and a single PR can be submitted for multiple demos within a Section.
The easiest way to do so is to pick an example in
electron-api-demos
, recreate the example in Electron Fiddle (using theelectron-api-demo
source code as a starting point), save the Fiddle locally into a folder, and move that example into/docs/fiddles/[CATEGORY]/[SECTION]/[DEMO]
.Example Fiddle
See the following PR for an example of this task (Asynchronous Messages demo): #20441
Code style
Code should follow the StandardJS style guidelines. To format your code, run the following snippet in your directory.
Folder structure
Add the contents of your Fiddle (
main.js
,renderer.js
, andindex.html
but notpackage.json
) into a new/docs/fiddles/[CATEGORY]/[SECTION]/[DEMO]
folder in your fork ofelectron/electron
For a handy graph on what category/section/demo mean:
PR requirements
master
branch.Assignees
Since this is a meta-issue that will require many PRs from contributors, we will attempt to proceed in a first-come-first-serve fashion. Examples will be marked as claimed as soon as a PR is opened for them.
In the interest of focusing on getting each PR reviewed and merged, please only open one PR at a time before opening another.
List of Demos
Create a new window @wedob13 docs: New fiddle example 'Create a new window' #20480Create a frameless window @kristofkalocsai docs: added windows -> create frameless window example #20591Customize menus @yashints docs: Adds Customize Menu section Fiddle example #20468Create an application menuCreate a context menuKeyboard shortcutsRegister a global keyboard shortcut @yashints docs: add Menu Shortcuts Fiddle example #20466Open path in file manager @kristofkalocsai docs: Added Native User Interface -> Open path in file manager Fiddle example #20589Open external links @alanionita feat: #20442 adds fiddle for opening external links... #20763Desktop notifications @harryi3t docs: add notification examples #20528Basic notificationNotification with imageUse system dialogs @yashints docs: Adds Use system dialogs Fiddle example #20473Open a file or directoryError dialogInformation dialogSave dialogDrag and drop filesDragging files @yashints docs: Added Drag and drop files Fiddle example #20472Asynchronous messages @erickzhao docs: add Asynchronous Messages Fiddle example #20441Synchronous messages @97amarnathk docs: add Synchronous Messages Fiddle example #20451Get app information @97amarnathk docs: add app information example #20487Get version information @RikTheunis docs: add system get version info Fiddle example #20536Get system information @jh3y docs: add fiddle for get system information #20662Clipboard @RikTheunis docs: add clipboard Fiddle examples #20445CopyPasteLaunch app from URL in another app @alanionita feat: adds the fiddle for launching an app from URL #20442 #20718Take a screenshot @harryi3t docs: add example for taking screenshot #20531The text was updated successfully, but these errors were encountered: