6.0e0cea4a.js 9.4 KB
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{188:function(e,r,t){"use strict";t.r(r);var a=t(0),_=Object(a.a)({},function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"文档写作平台使用入门"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#文档写作平台使用入门","aria-hidden":"true"}},[e._v("#")]),e._v(" 文档写作平台使用入门")]),e._v(" "),t("p",[e._v("介绍文档写作平台的运行方式,如何编写文档及各方面资源的内容组织")]),e._v(" "),t("h2",{attrs:{id:"文档写作平台项目地址"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#文档写作平台项目地址","aria-hidden":"true"}},[e._v("#")]),e._v(" 文档写作平台项目地址")]),e._v(" "),t("p",[t("a",{attrs:{href:"http://192.168.100.254:3000/frontend/doc-press",target:"_blank",rel:"noopener noreferrer"}},[e._v("doc-press"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"项目运行方式"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#项目运行方式","aria-hidden":"true"}},[e._v("#")]),e._v(" 项目运行方式")]),e._v(" "),t("ol",[t("li",[e._v("安装 "),t("code",[e._v("nodejs")]),e._v(",在 "),t("a",{attrs:{href:"http://nodejs.cn/download/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nodejs 官网"),t("OutboundLink")],1),e._v(" 下载并安装"),t("br"),e._v(" "),t("em",[e._v("windows 下建议下载 "),t("code",[e._v("Windows 安装包 (.msi) 64 位")])])]),e._v(" "),t("li",[e._v("安装 "),t("code",[e._v("yarn")]),e._v(",在 "),t("a",{attrs:{href:"https://www.yarnpkg.com/zh-Hant/docs/install#windows-stable",target:"_blank",rel:"noopener noreferrer"}},[e._v("yarn 官网"),t("OutboundLink")],1),e._v(" 下载并安装")]),e._v(" "),t("li",[t("strong",[e._v("只编写文档的情况可跳过以上两个步骤")])]),e._v(" "),t("li",[e._v("安装 "),t("code",[e._v("git")]),e._v(",在 "),t("a",{attrs:{href:"https://git-scm.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("git 官网"),t("OutboundLink")],1),e._v(" 下载并安装好")]),e._v(" "),t("li",[e._v("下载并安装 git 图形化工具,推荐使用的有 "),t("a",{attrs:{href:"https://tortoisegit.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("TortoiseGit"),t("OutboundLink")],1),e._v("、"),t("a",{attrs:{href:"https://www.sourcetreeapp.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("SourceTree"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("克隆文档写作平台到本地环境")]),e._v(" "),t("li",[e._v("使用命令行进入到文档写作平台目录")]),e._v(" "),t("li",[e._v("运行命令 "),t("code",[e._v("yarn dev")])]),e._v(" "),t("li",[e._v("运行完成后,命令行界面中会提示访问地址,在浏览器中访问该地址即可开始进行写作,效果如下")])]),e._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[e._v("success "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("16")]),e._v(":22:08"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v(" Build 42920d finished "),t("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("in")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token number"}},[e._v("3668")]),e._v(" ms"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v("!")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token operator"}},[e._v(">")]),e._v(" VuePress dev server listening at http://localhost:8082/\n")])])]),t("p",[e._v("写作完成后,将内容提交并推送到项目托管地址")]),e._v(" "),t("h2",{attrs:{id:"文档写作"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#文档写作","aria-hidden":"true"}},[e._v("#")]),e._v(" 文档写作")]),e._v(" "),t("p",[e._v("Markdown 标记语言语法")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://www.markdown.cn/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://www.markdown.cn/"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://markdown-zh.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://markdown-zh.readthedocs.io/en/latest/"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://wow.kuapp.com/markdown/",target:"_blank",rel:"noopener noreferrer"}},[e._v("http://wow.kuapp.com/markdown/"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("编辑器")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://typora.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Typora"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://code.visualstudio.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("VSCode"),t("OutboundLink")],1)])]),e._v(" "),t("blockquote",[t("p",[e._v("文档写作平台项目基于 VuePress 构建,具体配置内容请查看 "),t("a",{attrs:{href:"https://vuepress.vuejs.org/zh/",target:"_blank",rel:"noopener noreferrer"}},[e._v("这里"),t("OutboundLink")],1)])]),e._v(" "),t("h3",{attrs:{id:"写作方式"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#写作方式","aria-hidden":"true"}},[e._v("#")]),e._v(" 写作方式")]),e._v(" "),t("p",[e._v("文档写作平台所有编写的文档均是基于 "),t("strong",[e._v("Markdown")]),e._v(" 标记语言来编写,它的特点是使用简单的符号即可清晰地描述整个文档结构和排版,仅需要普通文本编辑器即可完成,不像 Word、Excel 等格式必须安装 Microsft Office 才可以正常使用;目前 Markdown 标记语言已经被广泛使用于国内、国际各种记事本或笔记平台、知识平台、写作平台,成为一种流行的文档编写格式,且范围不仅仅是软件行业")]),e._v(" "),t("p",[e._v("在网站的内容组织上,一个目录或站点的默认访问位置是 "),t("code",[e._v("index.html")]),e._v(",这是整个互联网环境、网页服务平台、网页服务软件等组织共同形成的约定俗成的结果")]),e._v(" "),t("p",[e._v("在以 Markdown 标记语言为主要格式和形式的文档平台中,大家约定俗成的默认文档为 "),t("code",[e._v("README.md")]),e._v("(注意大小写),其功能与 "),t("code",[e._v("index.html")]),e._v(" 一致,可以将其理解为是一个目录或是一个文档站点的里的 "),t("strong",[e._v("首页")])]),e._v(" "),t("p",[t("strong",[e._v("HTML")])]),e._v(" "),t("p",[e._v("实际上,在文档写作平台中,所有的 Markdown 文档最终会被编译为 HTML 格式的网页作为最终展现,所以在内容的编写上可以放心使用部分 HTML 标签的排版,建议是排版方面的标签,"),t("strong",[e._v("表单类型的标签请尽可能不要使用")]),e._v(",以免出现不可预期的问题")]),e._v(" "),t("h3",{attrs:{id:"资源内容添加"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#资源内容添加","aria-hidden":"true"}},[e._v("#")]),e._v(" 资源内容添加")]),e._v(" "),t("p",[e._v("在文档写作过程中,除了文档描述自身,往往需要引用图片、跳转链接和文件下载等需求来丰富文档内容")]),e._v(" "),t("h4",{attrs:{id:"资源内容说明"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#资源内容说明","aria-hidden":"true"}},[e._v("#")]),e._v(" 资源内容说明")]),e._v(" "),t("p",[e._v("资源可分为以下两类")]),e._v(" "),t("ul",[t("li",[e._v("图片")]),e._v(" "),t("li",[e._v("文档(Word、Excel、PowerPoint或其它类型文档)")])]),e._v(" "),t("p",[e._v("其中,图片可在文档中直接显示,而其它类型文件可作为下载附件的方式挂载在文档中")]),e._v(" "),t("p",[e._v("所有资源存放位置:")]),e._v(" "),t("p",[t("code",[e._v("/.vuepress/public/")])]),e._v(" "),t("strong",{staticStyle:{color:"red"}},[e._v("\n注意:所有资源要求必须有序存放,例如根据业务类型、团队类型等形式分目录存放\n")]),e._v(" "),t("h4",{attrs:{id:"资源使用方式"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#资源使用方式","aria-hidden":"true"}},[e._v("#")]),e._v(" 资源使用方式")]),e._v(" "),t("ul",[t("li",[e._v("图片内容")])]),e._v(" "),t("p",[e._v("假设有一张图片存放于以下位置")]),e._v(" "),t("p",[t("code",[e._v("/.vuepress/public/logo.png")])]),e._v(" "),t("p",[e._v("那么在文档中引用该图片的方式为")]),e._v(" "),t("p",[t("code",[e._v("![logo](/logo.png)")])]),e._v(" "),t("p",[e._v("渲染结果")]),e._v(" "),t("p",[t("img",{attrs:{src:"/logo.png",alt:"logo"}})]),e._v(" "),t("p",[e._v("可以看到 "),t("code",[e._v("/")]),e._v(" 资源引用的根位置指向了 "),t("code",[e._v("/.vuepress/public/")])]),e._v(" "),t("ul",[t("li",[e._v("文档或其它")])]),e._v(" "),t("p",[e._v("引用其它资源,区别仅为引用方式上,假设有一个文档存放于以下位置")]),e._v(" "),t("p",[t("code",[e._v("/.vuepress/public/design/file.docx")])]),e._v(" "),t("p",[e._v("该文档的引用方式为")]),e._v(" "),t("p",[t("code",[e._v("[file](/design/file.docx)")])]),e._v(" "),t("p",[e._v("根据观察可以发现,文件的引用方式与图片的引用方式上的区别仅是一个 "),t("code",[e._v("!")]),e._v(",而在描述一个链接时增加感叹号则是专用于图片显示")]),e._v(" "),t("blockquote",[t("p",[e._v("附件类型的在点击后,会直接弹出浏览器下载窗口下载该文件,所以该方式适用于与文档内容相关的附件设置")])])])},[],!1,null,null,null);r.default=_.exports}}]);