Skip to content

Commit

Permalink
Merge pull request #74 from qilin-editor/feature-exportas
Browse files Browse the repository at this point in the history
Implement export as HTML and PDF
  • Loading branch information
Bartozzz authored Apr 25, 2018
2 parents c1b6165 + 18c33df commit 7e03095
Show file tree
Hide file tree
Showing 10 changed files with 353 additions and 181 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
build
cache
qpm/src
temp.html

# Logs
logs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Github Releases](https://img.shields.io/github/downloads/qilin-editor/qilin-app/latest/total.svg)](https://github.com/qilin-editor/qilin-app/releases)
<br>

**Qilin** is a *free*, *open-source* and *fully hackable* text editor developed for exact sciences in mind. It fully supports [`KaTeX`](https://khan.github.io/KaTeX/) and [`AsciiMath`](http://asciimath.org/). Qilin works on each desktop platform - it is based on `Chromium` and `Node.js`, licensed under the *[MIT license](#license)*. Qilin is extensible via several [plugins and themes](https://github.com/qilin-editor/qilin-manager).
**Qilin** is a *free*, *open-source* and *fully hackable* text editor developed for exact sciences in mind. It fully supports [`KaTeX`](https://khan.github.io/KaTeX/) and [`AsciiMath`](http://asciimath.org/). Qilin works on each desktop platform - it is based on `Chromium` and `Node.js`, licensed under the *[MIT license](#license)*. Qilin is extensible via several [plugins and themes](https://github.com/qilin-editor/qilin-manager). Created documents can be exported as **HTML**, **PDF** and **Markdown**.

![Qilin editor](https://i.imgur.com/VOGLGv5.png)
</div>
Expand Down
236 changes: 120 additions & 116 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,118 +1,122 @@
{
"name": "me.laniewski.qilin",
"main": "qpm/src/index.html",
"version": "0.4.0-alpha",
"private": true,
"author": "Łaniewski Bartosz <laniewski.bartozzz@gmail.com> (http://laniewski.me/)",
"license": "MIT",
"description": "Text editor for exact sciences with built-in LaTeX/KaTeX/AsciiMath support",
"repository": {
"type": "git",
"url": "https://github.com/qilin-editor/qilin-app.git"
},
"bugs": {
"url": "https://github.com/qilin-editor/qilin-app/issues"
},
"chromium-args": "--mixed-context --enable-experimental-web-platform-features",
"window": {
"min_height": 600,
"min_width": 1000,
"title": "Qilin",
"frame": false,
"toolbar": false
},
"dependencies": {
"classnames": "^2.2.5",
"highlight.js": "latest",
"keymage": "^1.1.3",
"markdown-it": "^8.4.1",
"markdown-it-abbr": "^1.0.4",
"markdown-it-anchor": "^4.0.0",
"markdown-it-block-embed": "^0.0.3",
"markdown-it-emoji": "^1.4.0",
"markdown-it-maths": "1.0.8",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-it-table-of-contents": "^0.3.3",
"markdown-it-task-lists": "^2.1.1",
"material-icons-react": "^1.0.0",
"mobx": "^4.1.1",
"mobx-react": "^5.0.0",
"opn": "^5.3.0",
"prop-types": "^15.6.1",
"qilin-components": "0.0.132",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-router-dom": "^4.2.2",
"react-split-pane": "^0.1.77",
"typography": "^0.16.6",
"typography-theme-github": "^0.15.10",
"wireframe-framework": "latest"
},
"devDependencies": {
"autoprefixer": "^8.2.0",
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.4",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^0.28.11",
"eslint": "^4.18.2",
"eslint-config-prettier": "^2.9.0",
"eslint-config-standard": "^11.0.0",
"eslint-loader": "^2.0.0",
"eslint-plugin-flowtype": "^2.46.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-standard": "^3.0.1",
"extract-text-webpack-plugin": "next",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"json-loader": "^0.5.4",
"node-sass": "^4.8.3",
"nw": "^0.29.3",
"nw-builder": "^3.5.1",
"nw-dev": "^3.0.1",
"postcss-loader": "^2.1.3",
"precss": "^3.1.2",
"resolve-url-loader": "^2.3.0",
"sass-loader": "^6.0.7",
"style-loader": "^0.20.3",
"stylelint": "^9.2.0",
"stylelint-config-standard": "^18.2.0",
"url-loader": "^1.0.1",
"webpack": "^4.5.0",
"webpack-cli": "^2.0.14",
"webpack-dev-server": "^3.1.2"
},
"scripts": {
"prepare-qpm": "cd qpm && npm install",
"prepare": "export NODE_ENV=production && npm run eslint && npm run stylelint && node_modules/.bin/webpack --progress && npm run prepare-qpm",
"watch": "export NODE_ENV=development && node_modules/.bin/webpack --progress --watch & npm run nw",
"start": "npm run prepare && npm run nw",
"build": "npm run prepare && node bin/compile",
"eslint": "node_modules/.bin/eslint --ext .js --ext .jsx src --fix",
"stylelint": "node_modules/.bin/stylelint 'src/styles/**/*.scss' --fix",
"clear": "rm -rf build cache qpm/node_modules qpm/src",
"nw": "node_modules/.bin/nw . --nwjs_build_type=sdk"
},
"maintainers": [
{
"name": "Bartosz Łaniewski",
"email": "laniewski.bartozzz@gmail.com",
"web": "http://www.laniewski.me"
}
]
"name": "me.laniewski.qilin",
"main": "qpm/src/index.html",
"version": "0.4.0-alpha",
"private": true,
"author":
"Łaniewski Bartosz <laniewski.bartozzz@gmail.com> (http://laniewski.me/)",
"license": "MIT",
"description":
"Text editor for exact sciences with built-in LaTeX/KaTeX/AsciiMath support",
"repository": {
"type": "git",
"url": "https://github.com/qilin-editor/qilin-app.git"
},
"bugs": {
"url": "https://github.com/qilin-editor/qilin-app/issues"
},
"chromium-args":
"--mixed-context --enable-experimental-web-platform-features",
"window": {
"min_height": 600,
"min_width": 1000,
"title": "Qilin",
"frame": false
},
"dependencies": {
"classnames": "^2.2.5",
"highlight.js": "latest",
"keymage": "^1.1.3",
"markdown-it": "^8.4.1",
"markdown-it-abbr": "^1.0.4",
"markdown-it-anchor": "^4.0.0",
"markdown-it-block-embed": "^0.0.3",
"markdown-it-emoji": "^1.4.0",
"markdown-it-maths": "1.0.8",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-it-table-of-contents": "^0.3.3",
"markdown-it-task-lists": "^2.1.1",
"material-icons-react": "^1.0.0",
"mobx": "^4.1.1",
"mobx-react": "^5.0.0",
"opn": "^5.3.0",
"prop-types": "^15.6.1",
"qilin-components": "0.0.132",
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-router-dom": "^4.2.2",
"react-split-pane": "^0.1.77",
"typography": "^0.16.6",
"typography-theme-github": "^0.15.10",
"wireframe-framework": "latest"
},
"devDependencies": {
"autoprefixer": "^8.2.0",
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.4",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^0.28.11",
"eslint": "^4.18.2",
"eslint-config-prettier": "^2.9.0",
"eslint-config-standard": "^11.0.0",
"eslint-loader": "^2.0.0",
"eslint-plugin-flowtype": "^2.46.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-standard": "^3.0.1",
"extract-text-webpack-plugin": "next",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"json-loader": "^0.5.4",
"node-sass": "^4.8.3",
"nw": "^0.29.3",
"nw-builder": "^3.5.1",
"nw-dev": "^3.0.1",
"postcss-loader": "^2.1.3",
"precss": "^3.1.2",
"resolve-url-loader": "^2.3.0",
"sass-loader": "^6.0.7",
"style-loader": "^0.20.3",
"stylelint": "^9.2.0",
"stylelint-config-standard": "^18.2.0",
"url-loader": "^1.0.1",
"webpack": "^4.5.0",
"webpack-cli": "^2.0.14",
"webpack-dev-server": "^3.1.2"
},
"scripts": {
"prepare-qpm": "cd qpm && npm install",
"prepare":
"export NODE_ENV=production && npm run eslint && npm run stylelint && node_modules/.bin/webpack --progress && npm run prepare-qpm",
"watch":
"export NODE_ENV=development && node_modules/.bin/webpack --progress --watch & npm run nw",
"start": "npm run prepare && npm run nw",
"build": "npm run prepare && node bin/compile",
"eslint": "node_modules/.bin/eslint --ext .js --ext .jsx src --fix",
"stylelint": "node_modules/.bin/stylelint 'src/styles/**/*.scss' --fix",
"clear": "rm -rf build cache qpm/node_modules qpm/src",
"nw": "node_modules/.bin/nw . --nwjs_build_type=sdk"
},
"maintainers": [
{
"name": "Bartosz Łaniewski",
"email": "laniewski.bartozzz@gmail.com",
"web": "http://www.laniewski.me"
}
]
}
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div id="app"></div>
<div style="-webkit-app-region: no-drag;"></div>

<input style="display: none;" type="file" id="saveFile" nwsaveas="qilin.md" />
<input style="display: none;" type="file" id="openFile" />
<input style="display: none;" type="file" id="saveFile" accept=".md,.html,.pdf" nwsaveas="qilin.md" />
<input style="display: none;" type="file" id="openFile" accept=".md,.html" />
</body>
</html>
2 changes: 1 addition & 1 deletion src/scripts/bootstrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Provider } from "mobx-react";
import App from "./components/App";
import stores from "./stores";

import "./shortcuts/FileShortcuts";
import "./shortcuts";

render(
<Provider {...stores}>
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class AppWindow extends Component {
theme: MobxPropTypes.observableObject
};

window = nw.Window.get();

closeWindow = () => {
this.window.close(true);
};
Expand Down
24 changes: 24 additions & 0 deletions src/scripts/shortcuts/CoreShortcuts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// @flow
import manifest from "../../../package";

/**
* Opens a new Qilin application in a separate render process.
*
* @see http://docs.nwjs.io/en/latest/References/Manifest%20Format/#window-subfields
* @see http://docs.nwjs.io/en/latest/References/Window/#windowopenurl-options-callback
*
* @param {Event} event
* @param {Object} ctx
* @return {void}
*/
export function newWindow(event: Event, ctx: Object): void {
event.preventDefault();
event.stopPropagation();

nw.Window.open("qpm/src/index.html", {
...manifest.window,
inject_js_start: manifest.inject_js_start,
inject_js_end: manifest.inject_js_end,
new_instance: true
});
}
Loading

0 comments on commit 7e03095

Please sign in to comment.