chore: extend linting of code blocks in the docs (#40245)
* chore: extend linting of code blocks in the docs * chore: combine lint:markdownlint and lint:markdown scripts
This commit is contained in:
		
					parent
					
						
							
								d6bb9b40b0
							
						
					
				
			
			
				commit
				
					
						3d2a754531
					
				
			
		
					 71 changed files with 510 additions and 286 deletions
				
			
		| 
						 | 
				
			
			@ -27,22 +27,30 @@ To set the represented file of window, you can use the
 | 
			
		|||
 | 
			
		||||
## Example
 | 
			
		||||
 | 
			
		||||
```javascript fiddle='docs/fiddles/features/represented-file'
 | 
			
		||||
const { app, BrowserWindow } = require('electron')
 | 
			
		||||
```fiddle docs/fiddles/features/represented-file
 | 
			
		||||
const { app, BrowserWindow } = require('electron/main')
 | 
			
		||||
const os = require('node:os')
 | 
			
		||||
 | 
			
		||||
const createWindow = () => {
 | 
			
		||||
function createWindow () {
 | 
			
		||||
  const win = new BrowserWindow({
 | 
			
		||||
    width: 800,
 | 
			
		||||
    height: 600
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
app.whenReady().then(() => {
 | 
			
		||||
  const win = new BrowserWindow()
 | 
			
		||||
 | 
			
		||||
  win.setRepresentedFilename(os.homedir())
 | 
			
		||||
  win.setDocumentEdited(true)
 | 
			
		||||
 | 
			
		||||
  win.loadFile('index.html')
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
app.whenReady().then(() => {
 | 
			
		||||
  createWindow()
 | 
			
		||||
 | 
			
		||||
  app.on('activate', () => {
 | 
			
		||||
    if (BrowserWindow.getAllWindows().length === 0) {
 | 
			
		||||
      createWindow()
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
app.on('window-all-closed', () => {
 | 
			
		||||
| 
						 | 
				
			
			@ -50,12 +58,6 @@ app.on('window-all-closed', () => {
 | 
			
		|||
    app.quit()
 | 
			
		||||
  }
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
app.on('activate', () => {
 | 
			
		||||
  if (BrowserWindow.getAllWindows().length === 0) {
 | 
			
		||||
    createWindow()
 | 
			
		||||
  }
 | 
			
		||||
})
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
After launching the Electron application, click on the title with `Command` or
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue