commit 0accd3b9427282691d63c09cfdfaf848b7e46b5d
Author: guanpengchn <875499765@qq.com>
Date: Mon Mar 25 20:59:00 2019 +0800
feat(support markdown and normal) 支持了markdown和normal模式编辑简历
diff --git a/.gitignore b/.gitignore
new file mode 100755
index 0000000..4d29575
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,23 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# production
+/build
+
+# misc
+.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
diff --git a/README.md b/README.md
new file mode 100755
index 0000000..614f74c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,56 @@
+## 在线demo
+
+[Markdown简历排版工具](https://mdresume.github.io/)
+
+## 简历是什么
+
+简历的制作过程考验了一个人的两个能力,逻辑能力和细节能力。而不考验设计能力。
+
+## 逻辑能力
+
+- 描述工作内容请遵循[STAR法则](https://baike.baidu.com/item/STAR%E6%B3%95%E5%88%99/9056070?fr=aladdin)
+- 并列关系的文字请使用列表,比如:
+
+```
+- 熟悉JavaScript
+- 熟悉Python
+- 熟悉Git
+```
+
+- 视觉顺序:基本信息,工作相关信息,其他
+- 简历请全部放**有用信息**
+ - 不要写自我介绍
+ - 不要写年龄、生日、住址、爱好
+ - 如果有头像请放西服衬衫证件照
+
+## 细节能力
+
+- 英文请核对正确,注意大小写,比如`GitHub`,而非`github`,以官网为准
+- 不要直接放链接地址,应该以超链接的形式放到文字中,比如:[GitHub](https://github.com),而非 https://github.com
+- 时间建议统一格式为yyyy.mm - yyyy.mm,比如:2018.01 - 2018.12,而非 2018.1 - 2018.12
+- 中文始终保持一种字体,英文始终保持一种字体
+- [中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines)
+- 简历颜色最多三种,黑色、白色、主题色
+- 简历不要花哨,清除图标、进度条等附加元素
+- 字号不应该超过三种
+- 简历命名:岗位 姓名 电话
+- 了解、熟悉、精通等词汇谨慎使用,尤其是精通一词尽量不用
+- 应届生写清楚毕业时间
+
+## 特性
+
+- 只支持电脑编辑简历
+- 只支持一页简历,内容过多请附加作品集
+- 只支持导出pdf
+- 支持Markdown
+
+## 参考资料
+
+- 简历写不好通常是因为模板花哨,限制太少
+- 市面上的简历模板表面丰富多彩,实际有95%都是不可用的
+
+所有知名的简历排版网站列表如下:
+
+- [简历本](http://www.jianliben.com/)
+- [超级简历](https://www.wondercv.com/?locale=zh-CN)
+- [五百丁](http://www.500d.me/)
\ No newline at end of file
diff --git a/config/env.js b/config/env.js
new file mode 100644
index 0000000..b0344c5
--- /dev/null
+++ b/config/env.js
@@ -0,0 +1,93 @@
+'use strict';
+
+const fs = require('fs');
+const path = require('path');
+const paths = require('./paths');
+
+// Make sure that including paths.js after env.js will read .env variables.
+delete require.cache[require.resolve('./paths')];
+
+const NODE_ENV = process.env.NODE_ENV;
+if (!NODE_ENV) {
+ throw new Error(
+ 'The NODE_ENV environment variable is required but was not specified.'
+ );
+}
+
+// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
+var dotenvFiles = [
+ `${paths.dotenv}.${NODE_ENV}.local`,
+ `${paths.dotenv}.${NODE_ENV}`,
+ // Don't include `.env.local` for `test` environment
+ // since normally you expect tests to produce the same
+ // results for everyone
+ NODE_ENV !== 'test' && `${paths.dotenv}.local`,
+ paths.dotenv,
+].filter(Boolean);
+
+// Load environment variables from .env* files. Suppress warnings using silent
+// if this file is missing. dotenv will never modify any environment variables
+// that have already been set. Variable expansion is supported in .env files.
+// https://github.com/motdotla/dotenv
+// https://github.com/motdotla/dotenv-expand
+dotenvFiles.forEach(dotenvFile => {
+ if (fs.existsSync(dotenvFile)) {
+ require('dotenv-expand')(
+ require('dotenv').config({
+ path: dotenvFile,
+ })
+ );
+ }
+});
+
+// We support resolving modules according to `NODE_PATH`.
+// This lets you use absolute paths in imports inside large monorepos:
+// https://github.com/facebook/create-react-app/issues/253.
+// It works similar to `NODE_PATH` in Node itself:
+// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
+// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
+// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
+// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
+// We also resolve them to make sure all tools using them work consistently.
+const appDirectory = fs.realpathSync(process.cwd());
+process.env.NODE_PATH = (process.env.NODE_PATH || '')
+ .split(path.delimiter)
+ .filter(folder => folder && !path.isAbsolute(folder))
+ .map(folder => path.resolve(appDirectory, folder))
+ .join(path.delimiter);
+
+// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
+// injected into the application via DefinePlugin in Webpack configuration.
+const REACT_APP = /^REACT_APP_/i;
+
+function getClientEnvironment(publicUrl) {
+ const raw = Object.keys(process.env)
+ .filter(key => REACT_APP.test(key))
+ .reduce(
+ (env, key) => {
+ env[key] = process.env[key];
+ return env;
+ },
+ {
+ // Useful for determining whether we’re running in production mode.
+ // Most importantly, it switches React into the correct mode.
+ NODE_ENV: process.env.NODE_ENV || 'development',
+ // Useful for resolving the correct path to static assets in `public`.
+ // For example,
.
+ // This should only be used as an escape hatch. Normally you would put
+ // images into the `src` and `import` them in code to get their paths.
+ PUBLIC_URL: publicUrl,
+ }
+ );
+ // Stringify all values so we can feed into Webpack DefinePlugin
+ const stringified = {
+ 'process.env': Object.keys(raw).reduce((env, key) => {
+ env[key] = JSON.stringify(raw[key]);
+ return env;
+ }, {}),
+ };
+
+ return { raw, stringified };
+}
+
+module.exports = getClientEnvironment;
diff --git a/config/jest/cssTransform.js b/config/jest/cssTransform.js
new file mode 100644
index 0000000..8f65114
--- /dev/null
+++ b/config/jest/cssTransform.js
@@ -0,0 +1,14 @@
+'use strict';
+
+// This is a custom Jest transformer turning style imports into empty objects.
+// http://facebook.github.io/jest/docs/en/webpack.html
+
+module.exports = {
+ process() {
+ return 'module.exports = {};';
+ },
+ getCacheKey() {
+ // The output is always the same.
+ return 'cssTransform';
+ },
+};
diff --git a/config/jest/fileTransform.js b/config/jest/fileTransform.js
new file mode 100644
index 0000000..07010e3
--- /dev/null
+++ b/config/jest/fileTransform.js
@@ -0,0 +1,30 @@
+'use strict';
+
+const path = require('path');
+
+// This is a custom Jest transformer turning file imports into filenames.
+// http://facebook.github.io/jest/docs/en/webpack.html
+
+module.exports = {
+ process(src, filename) {
+ const assetFilename = JSON.stringify(path.basename(filename));
+
+ if (filename.match(/\.svg$/)) {
+ return `module.exports = {
+ __esModule: true,
+ default: ${assetFilename},
+ ReactComponent: (props) => ({
+ $$typeof: Symbol.for('react.element'),
+ type: 'svg',
+ ref: null,
+ key: null,
+ props: Object.assign({}, props, {
+ children: ${assetFilename}
+ })
+ }),
+ };`;
+ }
+
+ return `module.exports = ${assetFilename};`;
+ },
+};
diff --git a/config/paths.js b/config/paths.js
new file mode 100644
index 0000000..c24b4dd
--- /dev/null
+++ b/config/paths.js
@@ -0,0 +1,89 @@
+'use strict';
+
+const path = require('path');
+const fs = require('fs');
+const url = require('url');
+
+// Make sure any symlinks in the project folder are resolved:
+// https://github.com/facebook/create-react-app/issues/637
+const appDirectory = fs.realpathSync(process.cwd());
+const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
+
+const envPublicUrl = process.env.PUBLIC_URL;
+
+function ensureSlash(inputPath, needsSlash) {
+ const hasSlash = inputPath.endsWith('/');
+ if (hasSlash && !needsSlash) {
+ return inputPath.substr(0, inputPath.length - 1);
+ } else if (!hasSlash && needsSlash) {
+ return `${inputPath}/`;
+ } else {
+ return inputPath;
+ }
+}
+
+const getPublicUrl = appPackageJson =>
+ envPublicUrl || require(appPackageJson).homepage;
+
+// We use `PUBLIC_URL` environment variable or "homepage" field to infer
+// "public path" at which the app is served.
+// Webpack needs to know it to put the right