作者都是各自领域经过审查的专家,并撰写他们有经验的主题. 我们所有的内容都经过同行评审,并由同一领域的Toptal专家验证.
风暴法雷尔
验证专家 在工程
13 的经验

Storm是一个有7年以上经验的前端开发者,专注于UI/UX, JavaScript和React.

分享

如果你是 软件工程师,你可能花了很多时间来改善你的环境,以提高你的工作效率. You’ve got your favorite IDE. You’ve got your favorite debugger. You’ve got your favorite performance monitoring tool. But what about your tool for writing documentation, manuals, and reports? After all, writing does take a non-trivial amount of your time, doesn’t it? Indeed, it’s time to get serious about your writing tool.

让我们记住这一点 你很专业, so WYSIWYG editors may or may not be the best option for you. You don’t necessarily want (or even like!) navigating menus, toolbars, and ribbons to format your text.

那如果, 而不是, 您可以轻松地将所有格式化样式作为简单的内联语法添加到文本中,从而生成完全格式化的文本?

事实上,你可以. 这是 减价 and that’s what this tutorial is all about.

当多即是少……

文字处理软件的编写是为了满足极其广泛的用户和用例, 像这样, needs to provide all sorts of functionality. 但很明显, 只有一小部分功能可能与每个用户相关. 对于大多数用户来说, 谁只是想写一个文档(不需要设计一个营销宣传册或海报), a very small subset of the many, many options available are relevant.

事实上, 微软在几年前就意识到了这一点,他们将Word的用户界面重新设计为不同的功能组,他们称之为“缎带”. 然而,有趣的是, 大多数用户会告诉你,他们发现新界面比之前的版本更令人困惑,更难以操作.

学习减价

的确,在易用性和生产力方面,有时多则少.

以及《欧博体育app下载》

Face it, you’re a 软件工程师, not a graphic designer. 你只是想写手册,或者技术文档,或者报告,然后完成它. 你会非常满意一些基本的格式化功能,比如标题, 项目符号或编号列表, 和代码块. And, oh yeah, some font formatting (bold, italics, etc.)也会有帮助. 就是这样. (And man, if you could even just do it in vi, that would really be awesome!)

进入减价.

什么是降价?

约翰•格鲁伯 (来自技术大师和互联网活动家的大量贡献 亚伦斯) created the 减价 language in 2004 with 我们的目标 of enabling people “to write using an easy-to-read, easy-to-write plain text format, and optionally convert it to structurally valid XHTML (or HTML)”.

减价 was designed to be readable as-is, 而不会让它看起来像被标记或格式化指令(不像用RTF或HTML等标记语言格式化的文本,这些标记语言在原始格式下既难以编写又难以阅读)。.

减价 allows you to write using an easy-to-read, easy-to-write plain text format, that can then be converted into structurally valid HTML. 所以,准确地说, 减价 is really two things:

  1. A plain text formatting syntax
  2. 一种将纯文本格式转换为HTML的软件工具(其第一个版本是用Perl编写的).

减价包含了一些简单、相当直观且易于使用的语法约定. 尤其是作为软件工程师的你——你不会因为需要学习和使用这些基本的语法惯例而拖延——减价确实可以是最有效的 最小阻力路径 between what you want to write and getting it written.

标记语法约定

Learn 减记: Getting Started

降价很容易学. 超级简单. 你可以在五分钟内学会基本知识,很快就会成为你的第二天性. 而且——就像CSS和CSS预处理器之间的关系一样——你可以随心所欲地少用或多用.

If you’re used to any kind of plain text writing conventions, then you might already be familiar with some markdown conventions, such as numbers or dashes at the beginning of a sentence to create a list, asterisks around a word for emphasis, 等等....... 因此,例如,如果您想以斜体显示某些内容,只需将其用星号括起来,就像 <代码>*本*> < /代码 (as opposed to clunkier HTML syntax like <代码>this> < /代码).

类似地,您可以通过简单地在行(e .)前添加“#”前缀来指定H1标题.g., <代码>#节标题> < /代码,而不是 <代码>

Section Heading

> < /代码).

Another great use for learning 减价, especially for us 软件工程师s, is to use it for documentation on source code repositories. 大多数回购包括一个 <代码>自述.md> < /代码 文件(<代码>.md> < /代码 is the standard extension for a 减价 file). Github, for instance, has its own “Github-flavored 减价”, which adds 额外的功能 specifically for development documentation. This can certainly save time over having to write this documentation in HTML.

举个简单的例子,假设你想在你的文档中包含以下代码片段:

Initiating Plugins

在你的容器上使用jQuery初始化<代码>pluginName> < /代码,如下所示:

<代码>$(function() { $('#container').pluginName (); });> < /代码 Using our container’s ID, we can initiate <代码>pluginName> < /代码 使用jQuery方法 <代码>.pluginName ()> < /代码.

Here’s a comparison of how this would be done in HTML vs. 减记:

HTML减价

Initiating Plugins

#初始化插件

启动 pluginName on your container using jQuery as follows:

启动 `pluginName` on your container using jQuery as follows:

$(function() { $('#container').pluginName (); });
`$(function() { $('#container').pluginName (); });`

Using our container's ID, we can initiate pluginName 使用jQuery方法 .pluginName ()

使用我们的容器ID,我们可以用jQuery方法初始化' pluginName '。.pluginName ()”.*

For further help getting started, 网上有很多降价教程可以帮助你跟上进度,包括一个 减价的概述 by 约翰•格鲁伯 (减价’s creator) as well as an online 减价教程.

降价解析器和工具

在减价中编写完文章后,需要一个应用程序将语法解析为HTML. There are a few great ones that are 免费的 包括:

  • StackEdit -基于浏览器的减价编辑器,有一些同步选项与流行的服务,如Google Drive和Dropbox
  • 在线Kramdown编辑器 - another browser-based 减价 editor with an extremely simple interface
  • 谅解备忘录 - the best Mac-based 减价 writer I’ve come across as a geekier option for developers; tons of features and 免费的 (while in beta) [this is what I used to write this article]
  • 减价Pad - great 减价 editor for Windows
  • 文本 - a nice cross-platform (Mac and Windows) editor; exports to multiple formats such as PDF, .doc和ePub

一些主流平台已经在编辑器中采用(或至少允许)减价功能,供希望使用它的用户使用. 与他人, 比如WordPress, Evernote, 和谷歌文档, native support (at the time of writing this article) is not yet baked in, but custom solutions have been introduced by third parties. 这些包括:

  • Popular new blogging platform 为了精简在线写作,该公司使用减价作为其内容编辑器.
  • 对于WordPress, Jetpack插件现在正式支持减价,你可以在下面启用 Settings > Discussion 如果你使用插件. Or you could use a plugin like WP-减价 这将转换你的帖子markdown内容为HTML,并回到markdown当你需要编辑它.
  • For Evernote, some 减价 apps such as a the online editor 标示 或者Mac编辑器 笑柄 allow export and publishing directly to notes. 或者,如果你喜欢直接使用Evernote的web应用程序,你可以使用一个浏览器扩展名为 减记在这里 按一下工具栏按钮,就可以将写入减价的选定笔记转换为格式化的文本.
  • 谷歌文档 doesn’t natively support 减价 yet, but a few editors (such as StackEdit) will export/sync directly with Drive.

的缺点

Of course, with great simplicity comes limitations. 我已经解释过了, 减价不是为需要高级格式化功能的复杂文字处理任务而编写的. If that’s what you need, 减价 is not the right tool.

But for developers who need to write a user manual or 技术文档 或者一份技术报告, 减价在简单性和您需要的功能之间提供了近乎完美的平衡.

也许最大的缺点——尤其是对我们这些热衷变更控制的工程师来说——就是无法做到这一点 工作协作 并跟踪变化(不过,有一个值得注意的例外是 StackEdit 谷歌文档插件. 当然, with a minimal amount of effort, 你可以简单地通过git存储库在减价文档上进行协作,从而获得你通常需要的所有更改跟踪和协作.

结论

So is learning 减价 for everyone? 当然不是. 没有一个工具是这样的.

But if you’re a 软件工程师, it could very well be precisely the writing tool you’ve been looking for. So if you haven’t given it a try yet, you really should take it for a spin.

Hire a Toptal expert on this topic.
现在雇佣
风暴法雷尔

风暴法雷尔

验证专家 在工程
13 的经验

慕尼黑,巴伐利亚,德国

Member since February 24, 2015

作者简介

Storm是一个有7年以上经验的前端开发者,专注于UI/UX, JavaScript和React.

作者都是各自领域经过审查的专家,并撰写他们有经验的主题. 我们所有的内容都经过同行评审,并由同一领域的Toptal专家验证.

World-class articles, delivered weekly.

By entering your email, you are agreeing to our 隐私政策.

World-class articles, delivered weekly.

By entering your email, you are agreeing to our 隐私政策.

Toptal开发者

加入总冠军® 社区.