🚀textManagerの制作
議題
可能な限りシンプルな記述で行それぞれにIDを与えるにはどうすればいいか?
アイデアの扱いと、書き終えた原稿の扱いを統一的にする?
着想から執筆(発表)までの流れをシームレスに扱えるようにする?
そもそもこれはどんなツールなのか?
Gemeniと相談しながら、まずは基本セットを揃える
code:bash
mkdir textManager
cd textManager
npm init -y
npm install electron
アプリケーションのエントリーポイント
code:main.js
const { app, BrowserWindow } = require('electron');
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
},
});
win.loadFile('index.html');
}
app.whenReady().then(createWindow);
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
初期のpackage.jsonでは、 "main": "index.js",になっているので、上のファイルをindex.jsにするか、あるいはpackage.jsonの記述を"main": "main.js",に変更する
code:index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>My Outliner App</title>
</head>
<body>
<h1>My Outliner App</h1>
<div id="outliner"></div>
<script src="renderer.js"></script>
</body>
</html>
機能用のJS
code:render.js
const outliner = document.getElementById('outliner');
実行
code:bash
npx electron .
今日はここまで。
アイデア