Skip to content

Commit ec54eff

Browse files
committed
Initial update
1 parent 3fd464b commit ec54eff

18 files changed

+4695
-2
lines changed

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,49 @@
1-
# hackmd
2-
Unofficial desktop client for HackMD.io. It's an open source Electron-based app.
1+
# HackmdDesktop
2+
3+
Desktop app for [HackMD][hackmd] packaged with [Electron][electron].
4+
5+
If you don't like the [official app](https://github.com/hackmdio/hackmd-desktop), try out this app.
6+
7+
This Electron-based app is written by the codes which are different from the official app.
8+
9+
Linux
10+
![](screenshot-linux.png)
11+
12+
Windows
13+
![](screenshot-win.png)
14+
15+
Mac
16+
![](screenshot-mac.png)
17+
18+
## Install
19+
20+
The softwares are portable, just unpack the zip file then run it.
21+
22+
Go to [Release][release] to download the packages for all OS.
23+
24+
## Optional: Create Electron Development
25+
26+
```sh
27+
git clone https://github.com/a-lang/hackmd.git
28+
cd hackmd
29+
npm install
30+
```
31+
32+
## Optional: Build the distribution files
33+
34+
Build the application for specified platform:
35+
36+
```sh
37+
npm run start
38+
npm run dist:linux64
39+
npm run dist:macos
40+
npm run dist:win
41+
```
42+
43+
## License
44+
Active Record is released under the [MIT license][license]
45+
46+
[hackmd]: https://hackmd.io
47+
[electron]: http://electron.atom.io
48+
[license]: https://opensource.org/licenses/MIT
49+
[release]: https://github.com/a-lang/hackmd/releases

browser.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'use strict'
2+
const ipc = require('electron').ipcRenderer
3+
4+
function isKeep() {
5+
return window.location.hostname === 'hackmd.io'
6+
}
7+
8+
function injectCss(rule) {
9+
document.styleSheets[0].insertRule(rule, 0)
10+
}
11+
12+
function handleDOMLoaded() {
13+
if (!isKeep()) return
14+
15+
if (process.platform === 'darwin') {
16+
injectCss(`
17+
#ognwrapper {
18+
-webkit-app-region: drag;
19+
}
20+
`)
21+
22+
injectCss(`
23+
#ognwrapper form,
24+
#ognwrapper [role="menu"],
25+
#ognwrapper [role="button"] {
26+
-webkit-app-region: no-drag;
27+
}
28+
`)
29+
30+
injectCss(`
31+
#ognwrapper > :first-child > :nth-child(2) {
32+
padding-left: 75px;
33+
}
34+
`)
35+
}
36+
37+
/* Not Showing the Scrollbar */
38+
/*
39+
injectCss(`
40+
::-webkit-scrollbar {
41+
display: none !important;
42+
}
43+
`)
44+
*/
45+
}
46+
47+
function handleClick(event) {
48+
const node = event.target
49+
50+
if (node.nodeName === 'A' && node.target === '_blank') {
51+
event.preventDefault()
52+
ipc.send('clicklink', node.href)
53+
}
54+
}
55+
56+
function handleNavigate(event, hash) {
57+
window.location.hash = hash
58+
}
59+
60+
window.addEventListener('DOMContentLoaded', handleDOMLoaded, false)
61+
window.addEventListener('click', handleClick, false)
62+
ipc.on('navigate', handleNavigate)

build/128x128.png

18.3 KB
Loading

build/256x256.png

41.2 KB
Loading

build/32x32.png

3.17 KB
Loading

build/64x64.png

7.28 KB
Loading

build/icon.icns

337 KB
Binary file not shown.

build/icon.ico

361 KB
Binary file not shown.

build/icon.png

104 KB
Loading

config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict'
2+
const Config = require('electron-config')
3+
4+
module.exports = new Config({
5+
defaults: {
6+
lastWindowState: {
7+
height: 768,
8+
width: 1024
9+
}
10+
}
11+
})

0 commit comments

Comments
 (0)