The first intern project of HackMD: Sync the note between Gist and Markdown-it.
Deadline: 2019-07-15 00:00:00
Verion | |
---|---|
TypeScript | 3.5.2 |
Webpack | 4.35.2 |
Vue | 2.6.10 |
Ant-Design-Vue | 1.3.10 |
npm install
or npm i
npm run dev
for developmentnpm run build
for production
The code will be generated in dist/
directory
Open browser -> go to chrome://extensions/
-> Load unpacked -> Choose the dist/
directory -> Enjoy!
├── src
├── icnos -- Icons of the extension
├── lib
├── channel.ts -- Channel class.
├── client.ts -- Client interface.
├── datatype.ts -- Datatype definition
├── gistClient.ts -- Gist client class.
├── markdownClient.ts -- Markdown-it client class.
├── util
└── injectScript.ts -- Injection with custom logic.
├── background.js -- The transmitter to forward messages.
├── content.js -- The injection and initialization of whole SyncNote app
├── manifest.json -- Configuration file of extension
├── popup.html -- Popup page definition
├── popup.ts-- Popup page action definition
└── dist -- output directory generated from command "npm run build"
- Use webpack to build the extension
- Set up the typescript compile environment
- Set up the vue framework to build the popup page
- Set up the basic communication channel between background.js and content.js
- Start to build the basic communication channel between background/content/popup
- Refactor the content script and background script
- channel.ts -> gen instance in background script to deal with communication between tabs
- clien.ts -> gen instance in content script to deal with the page operation
- Develop with es2016 feature
- Add success/failed animation to label the availability of transfering
- Use Ant-Design to build the popup page
- Labeling the choosing/transfering tab on favicon
- Use javascript injection to access the CodeMirror to set change event
- Only Makrdown-it use port to communicate with background while transfering
- Comment the code