markdown 邮件_使用Markdown提升电子邮件质量

markdown 邮件

Markdown provides a simple way to mark up plain text so that it can be converted to HTML.

Markdown提供了一种简单的方法来标记纯文本,以便可以将其转换为HTML。

I use Markdown daily to write documents, website content and so on. I also compose a lot of emails, so I was delighted to stumble on an easy way to create pretty HTML emails with Markdown too.

我每天都使用Markdown编写文档,网站内容等。 我也撰写了很多电子邮件,因此我很高兴偶然发现一种使用Markdown创建漂亮HTML电子邮件的简单方法。

在这里降价 (Markdown Here)

the Markdown Here logo

Markdown Here (MDH) is a simple browser extension that can be installed in browsers such as Chrome, Firefox, Safari and Opera. It adds an icon to your browser's address bar:

Markdown Here (MDH)是一个简单的浏览器扩展程序,可以安装在Chrome,Firefox,Safari和Opera等浏览器中。 它将图标添加到浏览器的地址栏中:

MDH address bar icon

Simply add Markdown syntax to your email, and when you're ready to send, click the MDH icon. (You can also activate MDH via a keyboard shortcut of your choice—CTRL + ALT + M by default—or a via a dropdown context menu.) Clicking that icon means that all of your Markdown is converted to HTML—so you end up sending an HTML email. (No Markdown actually gets sent with the email, so you don’t have to worry about email clients not understanding it.)

只需在您的电子邮件中添加Markdown语法,然后在准备发送时,单击MDH图标。 (您也可以通过选择的键盘快捷键(默认情况下为CTRL + ALT + M或通过下拉菜单来激活MDH)。)单击该图标表示您的所有Markdown都转换为HTML,因此最终发送HTML电子邮件。 (实际上Markdown不会随电子邮件一起发送,因此您不必担心电子邮件客户端不了解它。)

For example, you can send emails that look like this:

例如,您可以发送如下电子邮件:

email styled by MDH

其他用途 (Other Uses)

If sending email in the browser isn't your thing, you can also use MDH with email clients such as Thunderbird, Postbox and Icedove.

如果您不必在浏览器中发送电子邮件,则还可以将MDH与电子邮件客户端(例如Thunderbird,Postbox和Icedove)一起使用。

And Markdown Here isn't limited to email. You can use it in other web editing interfaces such as Google Groups, Evernote and WordPress.

Markdown不仅限于电子邮件。 您可以在其他网络编辑界面(例如Google网上论坛,Evernote和WordPress)中使用它。

创建HTML电子邮件 (Creating HTML Emails)

I tend to send email directly through Gmail in my browser. It's really nice to be able to enhance emails with some HTML formatting, which is easy with Markdown.

我倾向于直接在浏览器中通过Gmail发送电子邮件。 能够使用某些HTML格式增强电子邮件非常好,而Markdown则很容易。

I often need to send longish emails, and it's great to be able to add headings, quotes, inline code, code blocks and lists to make the email readable and break up the content.

我经常需要发送冗长的电子邮件,并且能够添加标题,引号,内联代码,代码块和列表以使电子邮件可读并分解内容非常好。

Here are some examples of what you can do.

这是您可以做什么的一些示例。

(Code)

Being involved in web design and development, I often send code samples in emails. Writing inline code is as easy at this:

参与Web设计和开发时,我经常通过电子邮件发送代码示例。 编写内联代码很容易:

You could try `.element {display: block;}` instead.

After the MDH conversion, the above text look like this:

MDH转换后,上面的文本如下所示:

inline code

And a block of code is easy too. Note that you can specify the language to get nice syntax highlighting:

代码块也很容易。 请注意,您可以指定语言以突出显示语法:

```javascript
(function() {
    var method;
    var noop = function () {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});
}());

// From the HTML5 Boilerplate
```

And this is the result:

结果如下:

a block of code with syntax highlighting

报价单 (Quoting)

It's handy to be able to quote text in an email. Simply copying the text and placing a > before it is super easy:

能够在电子邮件中引用文本很方便。 只需复制文本,然后在>之前放置一个>

> Should I click this email link saying I'll win $1MM?

Nah, maybe not.

Resulting in this:

结果是:

quoted text

Rather than sending long, potentially unsightly URLs, you can easily convert them to nice, text-based links:

您可以轻松地将它们转换为漂亮的,基于文本的链接,而不必发送可能会很长的冗长的URL:

There are some great articles on [SitePoint](https://www.sitepoint.com/).

Which renders like so:

如下所示:

linked text

清单 (Lists)

Text is often easier to read in lists. Creating ordered and unordered lists is as simple as this:

文本通常在列表中更易于阅读。 创建有序列表和无序列表非常简单:

- first item in an unordered list
- second item in an unordered list

1. first item in an ordered list
1. second item in an ordered list

This is the result:

结果如下:

unordered and ordered lists

标题 (Headings)

You can markup headings like so:

您可以像这样标记标题:

# Heading One

Some text

## Heading Two

Rendering thusly:

因此渲染:

heading examples

重点 (Emphasis)

You can easily add italics and bold like so:

您可以像这样轻松添加斜体和粗体:

*These* are both _italic_, and **these** are both __bold__. 
And this is *__italic and bold__*.

Which appears like this:

看起来像这样:

italics and bold

水平尺 (Horizontal Rule)

If I'm changing topic, it can be nice to throw in a horizontal rule:

如果我要更改主题,最好插入水平规则:

End of one topic.

---

Beginning of the next …

Which outputs like this:

像这样的输出:

horizontal rule

桌子 (Tables)

Admittedly, I rarely need to place a table in my emails, but it's nice that you can:

诚然,我很少需要在电子邮件中放置表格,但是很高兴您可以:

Selector    |   Property        |   Value
---         |   ---             |   ---
`body`      |   **color**       |   *#30353b*
`.aside`    |   **float**       |   *right*
`img`       |   **display**     |   *inline-block*

The above text renders like this:

上面的文本呈现如下:

a table

图片 (Images)

You can add images to your email, as long you can link to them somewhere online:

您可以将图像添加到电子邮件中,只要您可以在线链接到它们即可:

Here's a cool picture of grass:

![grass](https://unsplash.it/600/200?image=487)
an image of grass

其他HTML元素 (Other HTML Elements)

MDH also allows you to add HTML elements that aren't covered by Markdown. For example, you could add superscript:

MDH还允许您添加Markdown未涵盖HTML元素。 例如,您可以添加上标:

This is the 1<sup>st</sup> presentation …
superscript example
This text should be <s>crossed out</s>.
strikethrough demo

造型 (Styling)

MDH uses GitHub-like styles by default. But you can easily customize the styling if you want. For example, in Chrome for Mac, go to Window > Extensions, where you'll see the MDH extension:

MDH默认使用类似GitHub的样式。 但是,您可以根据需要轻松自定义样式。 例如,在Mac版Chrome浏览器中,转到窗口 > 扩展程序 ,您将在其中看到MDH扩展程序:

Markdown Here extension in Chrome

Click on the Options link. This opens a very useful Options page, where you can alter various MDH settings, including styles. You can either choose from a list of themes (including some spiffy ones popular in code editors like Sublime Text), or write your own CSS entirely:

单击选项链接。 这将打开一个非常有用的“选项”页面,您可以在其中更改各种MDH设置,包括样式。 您可以从主题列表中进行选择(包括一些在代码编辑器中流行的精美主题,例如Sublime Text),也可以完全编写自己CSS:

MDH styling options

While you're on this page, make sure to check out the other available options, such as setting a preferred keyboard combination for activating MDH.

在此页面上时,请确保签出其他可用选项,例如设置用于激活MDH的首选键盘组合。

安装 (Installation)

MDH is easy to install. The official site provides a number of links through which to add it to your browser or email client. You can also get the project's source code, hosted at GitHub, from that page.

MDH易于安装。 官方站点提供了许多链接,可通过这些链接将其添加到浏览器或电子邮件客户端。 您还可以从该页面获取托管在GitHub上的项目的源代码。

其他资源 (Additional Resources)

Finally, here are some links to resources for using and learning about MDH:

最后,这是一些使用和学习MDH的资源链接:

结语 (Wrap Up)

I hope you've enjoyed this brief introduction to MDH. It's a pretty simple extension, but I use it every day, and honestly would hate to be without it.

希望您喜欢MDH的简短介绍。 这是一个非常简单的扩展,但是我每天都在使用它,说实话,我讨厌没有它。

Is this something you would consider using? Do you know of anything similar? Let me know in the comments.

这是您会考虑使用的东西吗? 你知道类似的东西吗? 在评论中让我知道。

翻译自: https://www.sitepoint.com/spicing-up-your-emails-with-markdown/

markdown 邮件

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: rmarkdown output_dir 是一种通过在 RMarkdown 文件中指定输出文件夹的方法,可以用来指定输出文件的存储位置。可以通过指定 output_dir 参数,将 RMarkdown 文件转换为 HTML 文件并保存到指定的文件夹。 ### 回答2: rmarkdown是一个用于生成报告、演示文稿、网页等多种输出格式的工具,可以方便地将R代码和文字整合在一起,并且支持多种输出格式的灵活选择。 在rmarkdown中,可以使用output_dir参数指定生成输出文件的目录。使用output_dir可以将生成的报告文件统一保存在指定的目录中,方便管理和查看。 具体使用方法如下: 1. 在RStudio中,打开一个rmarkdown文件(.Rmd扩展名)。 2. 在文件顶部的元数据中,找到output参数,可以设置为html_document、pdf_document、word_document等不同的输出格式。例如,output: html_document表示将生成的报告保存为HTML格式。 3. 在元数据中添加output_dir参数,并设置为想要保存报告的目录的路径。例如,output_dir: "reports"表示将生成的报告保存在项目根目录下的reports目录中。 4. 在Rmarkdown文件中编写内容,包括R代码块和文本等。 5. 点击RStudio界面上的"Knit"按钮,或者使用rmarkdown::render函数编译生成报告。 6. 编译完成后,生成的报告文件将保存在指定的output_dir目录中。 总的来说,使用output_dir参数可以轻松地指定生成报告文件的保存目录,便于整理和管理生成的文件。 ### 回答3: 在Rmarkdown中,可以使用`output_dir`选项指定输出文件的目录。 在Rmarkdown文档的YAML头部,可以添加以下代码: ``` output_dir: "目录路径" ``` 其中,`目录路径`是要指定的输出目录的路径。 例如,假设要将Rmarkdown文档的输出结果保存在名为"output"的目录中,可以添加以下代码到文档的YAML头部: ``` output_dir: "output" ``` 这样,在执行渲染操作后,生成的输出文件将保存在指定的目录中。 使用`output_dir`选项可以非常方便地将生成的MarkdownHTML、PDF等文件保存到特定的目录中,有助于整理和管理文件。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值