From 338ef3f318b90b5da932f6f4cf16e1ba6bce1325 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 1 Nov 2018 13:04:43 +0800 Subject: [PATCH 1/9] PRF:20181019 How to use Pandoc to produce a research paper.md @dianbanjiu --- ... use Pandoc to produce a research paper.md | 176 +++++++++--------- 1 file changed, 86 insertions(+), 90 deletions(-) diff --git a/translated/tech/20181019 How to use Pandoc to produce a research paper.md b/translated/tech/20181019 How to use Pandoc to produce a research paper.md index 516ab8ba37..3ccbc8df1c 100644 --- a/translated/tech/20181019 How to use Pandoc to produce a research paper.md +++ b/translated/tech/20181019 How to use Pandoc to produce a research paper.md @@ -1,19 +1,21 @@ -用 Pandoc 做一篇调研论文 +用 Pandoc 生成一篇调研论文 ====== -学习如何用 Markdown 管理引用、图像、表格、以及更多。 + +> 学习如何用 Markdown 管理章节引用、图像、表格以及更多。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_paperclips.png?itok=j48op49T) -这篇文章对于使用 [Markdown][1] 语法做一篇调研论文进行了一个深度体验。覆盖了如何创建和引用、图像(用 Markdown 和 [LaTeX][2])和参考书目。我们也讨论了一些棘手的案例和为什么使用 LaTex 是一个正确的做法。 +这篇文章对于使用 [Markdown][1] 语法做一篇调研论文进行了一个深度体验。覆盖了如何创建和引用章节、图像(用 Markdown 和 [LaTeX][2])和参考书目。我们也讨论了一些棘手的案例和为什么使用 LaTex 是一个正确的做法。 -### 调查 +### 调研 -调研论文一般包括引用、图像、表格和参考书目。[Pandoc][3] 本身并不能交叉引用这些,但是但是它能够利用 [pandoc-crossref][4] 过滤来完成自动编号和章节、图像、表格的交叉引用。 +调研论文一般包括对章节、图像、表格和参考书目的引用。[Pandoc][3] 本身并不能交叉引用这些,但是它能够利用 [pandoc-crossref][4] 过滤器来完成自动编号和章节、图像、表格的交叉引用。 -让我们开始正常的使用 LaTax 重写 [一个教育调研报告的例子][5],然后用 Markdown(和一些 LaTax)、Pandoc 和 Pandoc-crossref 再重写。 +让我们从重写原本以 LaTax 撰写的 [一个教育调研报告的例子][5] 开始,然后用 Markdown(和一些 LaTax)、Pandoc 和 Pandoc-crossref 重写。 #### 添加并引用章节 -要想章节被自动编号,必须使用 Markdown 标题 H1 编写。子章节使用子标题 H2-H4 编写(通常不需要更多的东西)。例如一个章节的标题是 “履行”,写作 `# 履行 {#sec: 履行}`,然后 Pandoc 会把它转化为 `3. 履行`(或者转换为相应的章节标号)。`履行` 这个标题使用了 H1 并且声明了一个 `{#sec: 履行}` 的标签,这是作者引用了该章节的标签。要想引用一个章节,在对应章节后面输入 `@` 符号并使用方括号括起来即可: `[@sec:履行]` +要想章节被自动编号,必须使用 Markdown H1 标题编写。子章节使用 H2-H4 子标题编写(通常不需要更多级别了)。例如一个章节的标题是 “Implementation”,写作 `# Implementation {#sec: implementation}`,然后 Pandoc 会把它转化为 `3. Implementation `(或者转换为相应的章节编号)。`Implementation` 这个标题使用了 H1 并且声明了一个 `{#sec: implementation}` 的标签,这是作者用于引用该章节的标签。要想引用一个章节,输入 `@` 符号并跟上对应章节标签,使用方括号括起来即可: `[@ sec:implementation]` [在这篇论文中][5], 我们发现了下面这个例子: @@ -27,16 +29,17 @@ Pandoc 转换: we lack experience (consistency between TAs, Section 4). ``` -章节被自动(这包含在文章最后的 `Makefile` 当中)标号。要创建无标号的章节,输入章节的标题并在最后添加 `{-}`。例如:`### 设计一个可维护的游戏 {-}` 就以标题 “设计一个可维护的游戏”,创建了一个无标号的章节。 +章节被自动编号(这在本文最后的 `Makefile` 当中说明)。要创建无编号的章节,输入章节的标题并在最后添加 `{-}`。例如:`### Designing a game for maintainability {-}` 就以标题 “Designing a game for maintainability”,创建了一个无标号的章节。 #### 添加并引用图像 -添加并引用一个图像,跟添加并引用一个章节和添加一个 Markdown 图片很相似: +添加并引用一个图像,跟添加并引用一个章节和添加一个 Markdown 图片很相似: ``` ![Scatterplot matrix](data/scatterplots/RScatterplotMatrix2.png){#fig:scatter-matrix} ``` -上面这一行是告诉 Pandoc,有一个标有 Scatterplot matrix 的图像以及这张图片路径是 `data/scatterplots/RScatterplotMatrix2.png`。`{#fig:scatter-matrix}` 表明了应该引用的图像的名字。 + +上面这一行是告诉 Pandoc,有一个标有 Scatterplot matrix 的图像以及这张图片路径是 `data/scatterplots/RScatterplotMatrix2.png`。`{#fig:scatter-matrix}` 表明了用于引用该图像的名字。 这里是从一篇论文中进行图像引用的例子: @@ -51,46 +54,47 @@ The boxes "Enjoy", "Grade" and "Motivation" (Fig. 1) ... ``` #### 添加及引用参考书目 -大多数调研报告都把引用放在一个 BibTeX 的数据库文件中。在这个例子中,该文件被命名为 [biblio.bib][6],它包含了论文中所有的引用。下面是这个文件的样子: + +大多数调研报告都把引用放在一个 BibTeX 的数据库文件中。在这个例子中,该文件被命名为 [biblio.bib][6],它包含了论文中所有的引用。下面是这个文件的样子: ``` @inproceedings{wrigstad2017mastery, -    Author =       {Wrigstad, Tobias and Castegren, Elias}, -    Booktitle =    {SPLASH-E}, -    Title =        {Mastery Learning-Like Teaching with Achievements}, -    Year =         2017 + Author = {Wrigstad, Tobias and Castegren, Elias}, + Booktitle = {SPLASH-E}, + Title = {Mastery Learning-Like Teaching with Achievements}, + Year = 2017 } @inproceedings{review-gamification-framework, -  Author =       {A. Mora and D. Riera and C. Gonzalez and J. Arnedo-Moreno}, -  Publisher =    {IEEE}, -  Booktitle =    {2015 7th International Conference on Games and Virtual Worlds -                  for Serious Applications (VS-Games)}, -  Doi =          {10.1109/VS-GAMES.2015.7295760}, -  Keywords =     {formal specification;serious games (computing);design -                  framework;formal design process;game components;game design -                  elements;gamification design frameworks;gamification-based -                  solutions;Bibliographies;Context;Design -                  methodology;Ethics;Games;Proposals}, -  Month =        {Sept}, -  Pages =        {1-8}, -  Title =        {A Literature Review of Gamification Design Frameworks}, -  Year =         2015, -  Bdsk-Url-1 =   {http://dx.doi.org/10.1109/VS-GAMES.2015.7295760} + Author = {A. Mora and D. Riera and C. Gonzalez and J. Arnedo-Moreno}, + Publisher = {IEEE}, + Booktitle = {2015 7th International Conference on Games and Virtual Worlds + for Serious Applications (VS-Games)}, + Doi = {10.1109/VS-GAMES.2015.7295760}, + Keywords = {formal specification;serious games (computing);design + framework;formal design process;game components;game design + elements;gamification design frameworks;gamification-based + solutions;Bibliographies;Context;Design + methodology;Ethics;Games;Proposals}, + Month = {Sept}, + Pages = {1-8}, + Title = {A Literature Review of Gamification Design Frameworks}, + Year = 2015, + Bdsk-Url-1 = {http://dx.doi.org/10.1109/VS-GAMES.2015.7295760} } ... ``` -第一行的 `@inproceedings{wrigstad2017mastery,` 表明了出版物 (`inproceedings`) 的类型,以及用来指向那篇论文 (`wrigstad2017mastery`) 的标签。 +第一行的 `@inproceedings{wrigstad2017mastery,` 表明了出版物 的类型(`inproceedings`),以及用来指向那篇论文的标签(`wrigstad2017mastery`)。 -引用这篇题为 “Mastery Learning-Like Teaching with Achievements” 的论文, 输入: +引用这篇题为 “Mastery Learning-Like Teaching with Achievements” 的论文, 输入: ``` the achievement-driven learning methodology [@wrigstad2017mastery] ``` -Pandoc 将会输出: +Pandoc 将会输出: ``` the achievement- driven learning methodology [30] @@ -100,25 +104,23 @@ the achievement- driven learning methodology [30] ![](https://opensource.com/sites/default/files/uploads/bibliography-example_0.png) -引用文章的集合也很容易:只要引用使用分号 `;` 分隔开被标记的参考文献就可以了。如果一个引用有两个标签 —— 例如: `SEABORN201514` 和 `gamification-leaderboard-benefits`—— 像下面这样把它们放在一起引用: +引用文章的集合也很容易:只要引用使用分号 `;` 分隔开被标记的参考文献就可以了。如果一个引用有两个标签 —— 例如: `SEABORN201514` 和 `gamification-leaderboard-benefits`—— 像下面这样把它们放在一起引用: ``` Thus, the most important benefit is its potential to increase students' motivation - and engagement [@SEABORN201514;@gamification-leaderboard-benefits]. ``` -Pandoc 将会产生: +Pandoc 将会产生: ``` Thus, the most important benefit is its potential to increase students’ motivation - and engagement [26, 28] ``` ### 问题案例 -一个常见的问题是项目与页面不匹配。不匹配的部分会自动移动到它们认为合适的地方,即便这些位置并不是读者期望看到的位置。因此在图像或者表格接近于它们被提及的地方时,我们需要调节一下它们在此处的元素组合,使得他们更加易于阅读。为了达到这个效果,我建议使用 `figure` 这个 LaTeX 环境参数,它可以让用户控制图像的位置。 +一个常见的问题是所需项目与页面不匹配。不匹配的部分会自动移动到它们认为合适的地方,即便这些位置并不是读者期望看到的位置。因此在图像或者表格接近于它们被提及的地方时,我们需要调节一下那些元素放置的位置,使得它们更加易于阅读。为了达到这个效果,我建议使用 `figure` 这个 LaTeX 环境参数,它可以让用户控制图像的位置。 我们看一个上面提到的图像的例子: @@ -126,7 +128,7 @@ and engagement [26, 28] ![Scatterplot matrix](data/scatterplots/RScatterplotMatrix2.png){#fig:scatter-matrix} ``` -然后使用 LaTeX 重写: +然后使用 LaTeX 重写: ``` \begin{figure}[t] @@ -139,17 +141,17 @@ and engagement [26, 28] ### 产生一篇论文 -到目前为止,我们讲了如何添加和引用(子)章节、图像和参考书目,现在让我们重温一下如何生产一篇 PDF 格式的论文,生成 PDF,我们将使用 Pandoc 生成一篇可以被构建成最终 PDF 的 LaTeX 文件。我们还会讨论如何以 LaTeX,使用一套自定义的模板和元信息文件生成一篇调研论文,以及如何构建 LaTeX 文档为最终的 PDF 格式。 +到目前为止,我们讲了如何添加和引用(子)章节、图像和参考书目,现在让我们重温一下如何生成一篇 PDF 格式的论文。要生成 PDF,我们将使用 Pandoc 生成一篇可以被构建成最终 PDF 的 LaTeX 文件。我们还会讨论如何以 LaTeX,使用一套自定义的模板和元信息文件生成一篇调研论文,以及如何将 LaTeX 文档编译为最终的 PDF 格式。 -很多会议都提供了一个 **.cls** 文件或者一套论文该有样子的模板; 例如,他们是否应该使用两列的格式以及其他的设计风格。在我们的例子中,会议提供了一个名为 **acmart.cls** 的文件。 +很多会议都提供了一个 .cls 文件或者一套论文应有样式的模板;例如,它们是否应该使用两列的格式以及其它的设计风格。在我们的例子中,会议提供了一个名为 `acmart.cls` 的文件。 -作者通常想要在他们的论文中包含他们所属的机构,然而,这个选项并没有包含在默认的 Pandoc 的 LaTeX 模板(注意,可以通过输入 `pandoc -D latex` 来查看 Pandoc 模板)当中。要包含这个内容,找一个 Pandoc 默认的 LaTeX 模板,并添加一些新的内容。将这个模板像下面这样复制进一个名为 `mytemplate.tex` 的文件中: +作者通常想要在他们的论文中包含他们所属的机构,然而,这个选项并没有包含在默认的 Pandoc 的 LaTeX 模板(注意,可以通过输入 `pandoc -D latex` 来查看 Pandoc 模板)当中。要包含这个内容,找一个 Pandoc 默认的 LaTeX 模板,并添加一些新的内容。将这个模板像下面这样复制进一个名为 `mytemplate.tex` 的文件中: ``` pandoc -D latex > mytemplate.tex ``` -默认的模板包含以下代码: +默认的模板包含以下代码: ``` $if(author)$ @@ -161,32 +163,30 @@ $if(institute)$ $endif$ ``` -因为这个模板应该包含作者的联系方式和电子邮件地址,在其他一些选项之间,我们可以添加以下内容(我们还做了一些其他的更改,但是因为文件的长度,就没有包含在此处)更新这个模板 +因为这个模板应该包含作者的联系方式和电子邮件地址,在其他一些选项之间,我们更新这个模板以添加以下内容(我们还做了一些其他的更改,但是因为文件的长度,就没有包含在此处): ``` latex $for(author)$ -    $if(author.name)$ -        \author{$author.name$} -        $if(author.affiliation)$ -            \affiliation{\institution{$author.affiliation$}} -        $endif$ -        $if(author.email)$ -            \email{$author.email$} -        $endif$ -    $else$ -        $author$ -    $endif$ + $if(author.name)$ + \author{$author.name$} + $if(author.affiliation)$ + \affiliation{\institution{$author.affiliation$}} + $endif$ + $if(author.email)$ + \email{$author.email$} + $endif$ + $else$ + $author$ + $endif$ $endfor$ ``` 要让这些更改起作用,我们还应该有下面的文件: - * `main.md` 包含调研论文 - * `biblio.bib` 包含参考书目数据库 - * `acmart.cls` 我们使用的文档的集合 - * `mytemplate.tex` 是我们使用的模板文件(代替默认的) - - +* `main.md` 包含调研论文 +* `biblio.bib` 包含参考书目数据库 +* `acmart.cls` 我们使用的文档的集合 +* `mytemplate.tex` 是我们使用的模板文件(代替默认的) 让我们添加论文的元信息到一个 `meta.yaml` 文件: @@ -211,7 +211,7 @@ abstract: |   An achievement-driven methodology strives to give students more control over their learning with enough flexibility to engage them in deeper learning. (more stuff continues) include-before: | -   \```{=latex} +   \` ``{=latex}   \copyrightyear{2018}   \acmYear{2018}   \setcopyright{acmlicensed} @@ -234,7 +234,7 @@ include-before: |   \ccsdesc[500]{Applied computing~Education}   \keywords{gamification, education, software design, UML} -   \``` +   \` `` figPrefix:   - "Fig."   - "Figs." @@ -246,23 +246,21 @@ secPrefix: 这个元信息文件使用 LaTeX 设置下列参数: - * `template` 指向使用的模板(’mytemplate.tex‘) - * `documentclass` 指向使用的 LaTeX 文档集合 (`acmart`) - * `classoption` 是在 `sigconf` 的案例中,指向这个类的选项 - * `title` 指定论文的标题 - * `author` 是一个包含例如 `name`, `affiliation`, 和 `email` 的地方 - * `bibliography` 指向包含参考书目的文件 (biblio.bib) - * `abstract` 包含论文的摘要 - * `include-before` 是这篇论文的真实内容之前应该被包含的信息;在 LaTeX 中被称为 [前言][8]。我在这里包含它去展示如何产生一篇计算机科学的论文,但是你可以选择跳过 - * `figPrefix` 指向如何引用文档中的图像,例如:当引用图像的 `[@fig:scatter-matrix]` 时应该显示什么。例如,当前的 `figPrefix` 在这个例子 `The boxes "Enjoy", "Grade" and "Motivation" ([@fig:scatter-matrix])`中,产生了这样的输出:`The boxes "Enjoy", "Grade" and "Motivation" (Fig. 3)`。如果这里有很多图像,目前的设置表明它应该在图像号码旁边显示 `Figs.`。 - * `secPrefix` 指定如何引用文档中其他地方提到的部分(类似之前的图像和概览) - - +* `template` 指向使用的模板(`mytemplate.tex`) +* `documentclass` 指向使用的 LaTeX 文档集合(`acmart`) +* `classoption` 是在 `sigconf` 的案例中,指向这个类的选项 +* `title` 指定论文的标题 +* `author` 是一个包含例如 `name`、`affiliation` 和 `email` 的地方 +* `bibliography` 指向包含参考书目的文件(`biblio.bib`) +* `abstract` 包含论文的摘要 +* `include-before` 是这篇论文的具体内容之前应该被包含的信息;在 LaTeX 中被称为 [前言][8]。我在这里包含它去展示如何产生一篇计算机科学的论文,但是你可以选择跳过 +* `figPrefix` 指向如何引用文档中的图像,例如:当引用图像的 `[@fig:scatter-matrix]` 时应该显示什么。例如,当前的 `figPrefix` 在这个例子 `The boxes "Enjoy", "Grade" and "Motivation" ([@fig:scatter-matrix])`中,产生了这样的输出:`The boxes "Enjoy", "Grade" and "Motivation" (Fig. 3)`。如果这里有很多图像,目前的设置表明它应该在图像号码旁边显示 `Figs.` +* `secPrefix` 指定如何引用文档中其他地方提到的部分(类似之前的图像和概览) 现在已经设置好了元信息,让我们来创建一个 `Makefile`,它会产生你想要的输出。`Makefile` 使用 Pandoc 产生 LaTeX 文件,`pandoc-crossref` 产生交叉引用,`pdflatex` 构建 LaTeX 为 PDF,`bibtex ` 处理引用。 -`Makefile` 已经展示如下: +`Makefile` 已经展示如下: ``` all: paper @@ -281,18 +279,16 @@ clean: .PHONY: all clean paper ``` -Pandoc 使用下面的标记: +Pandoc 使用下面的标记: - * `-s` 创建一个独立的 LaTeX 文档 - * `-F pandoc-crossref` 利用 `pandoc-crossref` 进行过滤 - * `--natbib` 用 `natbib` (你也可以选择 `--biblatex`)对参考书目进行渲染 - * `--template` 设置使用的模板文件 - * `-N` 为章节的标题编号 - * `-f` 和 `-t` 指定从哪个格式转换到哪个格式。`-t` 通常包含格式和 Pandoc 使用的扩展。在这个例子中,我们标明的 `raw_tex+tex_math_dollars+citations` 允许在 Markdown 中使用 `raw_tex` LaTeX。 `tex_math_dollars` 让我们能够像在 LaTeX 中一样输入数学符号,`citations` 让我们可以使用 [这个扩展][9]. +* `-s` 创建一个独立的 LaTeX 文档 +* `-F pandoc-crossref` 利用 `pandoc-crossref` 进行过滤 +* `--natbib` 用 `natbib` (你也可以选择 `--biblatex`)对参考书目进行渲染 +* `--template` 设置使用的模板文件 +* `-N` 为章节的标题编号 +* `-f` 和 `-t` 指定从哪个格式转换到哪个格式。`-t` 通常包含格式和 Pandoc 使用的扩展。在这个例子中,我们标明的 `raw_tex+tex_math_dollars+citations` 允许在 Markdown 中使用 `raw_tex` LaTeX。 `tex_math_dollars` 让我们能够像在 LaTeX 中一样输入数学符号,`citations` 让我们可以使用 [这个扩展][9]。 - - -由 LaTeX 产生 PDF,接着引导行 [从 bibtex][10] 处理参考书目: +要从 LaTeX 产生 PDF,按 [来自bibtex][10] 的指导处理参考书目: ``` @pdflatex main.tex &> /dev/null @@ -301,7 +297,7 @@ Pandoc 使用下面的标记: @pdflatex main.tex &> /dev/null ``` -脚本用 `@` 忽略输出,并且重定向标准输出和错误到 `/dev/null` ,因此我们在使用这些命令的可执行文件时不会看到任何的输出。 +脚本用 `@` 忽略输出,并且重定向标准输出和错误到 `/dev/null` ,因此我们在使用这些命令的可执行文件时不会看到任何的输出。 最终的结果展示如下。这篇文章的库可以在 [GitHub][11] 找到: @@ -309,9 +305,9 @@ Pandoc 使用下面的标记: ### 结论 -在我看来,研究的重点是协作,思想的传播,以及在任何一个恰好存在的领域中改进现有的技术。许多计算机科学家和工程师使用 LaTeX 文档系统来写论文,它对数学提供了完美的支持。来自社会科学的调查员似乎更喜欢 DOCX 文档。 +在我看来,研究的重点是协作、思想的传播,以及在任何一个恰好存在的领域中改进现有的技术。许多计算机科学家和工程师使用 LaTeX 文档系统来写论文,它对数学提供了完美的支持。来自社会科学的研究人员似乎更喜欢 DOCX 文档。 -当身处不同社区的调查员一同写一篇论文时,他们首先应该讨论一下他们将要使用哪种格式。然而如果包含太多的数学符号,DOCX 对于工程师来说不会是最简便的选择,LaTeX 对于缺乏编程经验的调查员来说也有一些问题。就像这篇文章中展示的,Markdown 是一门工程师和社会科学家都很轻易能够使用的语言。 +当身处不同社区的研究人员一同写一篇论文时,他们首先应该讨论一下他们将要使用哪种格式。然而如果包含太多的数学符号,DOCX 对于工程师来说不会是最简便的选择,LaTeX 对于缺乏编程经验的研究人员来说也有一些问题。就像这篇文章中展示的,Markdown 是一门工程师和社会科学家都很轻易能够使用的语言。 -------------------------------------------------------------------------------- @@ -320,7 +316,7 @@ via: https://opensource.com/article/18/9/pandoc-research-paper 作者:[Kiko Fernandez-Reyes][a] 选题:[lujun9972][b] 译者:[dianbanjiu](https://github.com/dianbanjiu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8aeed0539bcf53cb3d622f039f68d1de0bd22385 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 1 Nov 2018 13:05:03 +0800 Subject: [PATCH 2/9] PUB:20181019 How to use Pandoc to produce a research paper.md @dianbanjiu https://linux.cn/article-10179-1.html --- .../20181019 How to use Pandoc to produce a research paper.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181019 How to use Pandoc to produce a research paper.md (100%) diff --git a/translated/tech/20181019 How to use Pandoc to produce a research paper.md b/published/20181019 How to use Pandoc to produce a research paper.md similarity index 100% rename from translated/tech/20181019 How to use Pandoc to produce a research paper.md rename to published/20181019 How to use Pandoc to produce a research paper.md From 9e26f415aa4e59ccd075f1b4042a0253ee2723ee Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 1 Nov 2018 13:19:42 +0800 Subject: [PATCH 3/9] PRF:20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md @FSSlc --- ...t Powerful Feature-rich Screenshot Tool.md | 79 +++++++++++-------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/translated/tech/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md b/translated/tech/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md index 898955242a..a34c575261 100644 --- a/translated/tech/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md +++ b/translated/tech/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md @@ -1,4 +1,4 @@ -Flameshot – 一个简洁但功能丰富的截图工具 +Flameshot:一个简洁但功能丰富的截图工具 ====== ![](https://www.ostechnix.com/wp-content/uploads/2018/09/Flameshot-720x340.png) @@ -10,11 +10,13 @@ Flameshot – 一个简洁但功能丰富的截图工具 **在 Arch Linux 上:** Flameshot 可以从 Arch LInux 的 [community] 仓库中获取。确保你已经启用了 community 仓库,然后就可以像下面展示的那样使用 pacman 来安装 Flameshot : + ``` $ sudo pacman -S flameshot ``` 它也可以从 [**AUR**][1] 中获取,所以你还可以使用任意一个 AUR 帮助程序(例如 [**Yay**][2])来在基于 Arch 的系统中安装它: + ``` $ yay -S flameshot-git ``` @@ -26,6 +28,7 @@ $ sudo dnf install flameshot ``` 在 **Debian 10+** 和 **Ubuntu 18.04+** 中,可以使用 APT 包管理器来安装它: + ``` $ sudo apt install flameshot ``` @@ -35,97 +38,105 @@ $ sudo apt install flameshot ``` $ sudo zypper install flameshot ``` + 在其他的 Linux 发行版中,可以从源代码编译并安装它。编译过程中需要 **Qt version 5.3** 以及 **GCC 4.9.2** 或者它们的更高版本。 ### 使用 -可以从菜单或者应用启动器中启动 Flameshot。在 MATE 桌面环境,它通常可以在 **Applications - > Graphics** 下找到。 +可以从菜单或者应用启动器中启动 Flameshot。在 MATE 桌面环境,它通常可以在 “Applications -> Graphics” 下找到。 一旦打开了它,你就可以在系统面板中看到 Flameshot 的托盘图标。 **注意:** -假如你使用 Gnome 桌面环境,为了能够看到系统托盘图标,你需要安装 [TopIcons][3] 扩展。 +假如你使用 Gnome 桌面环境,为了能够看到系统托盘图标,你需要安装 [TopIcons][3] 扩展。 在 Flameshot 托盘图标上右击,你便会看到几个菜单项,例如打开配置窗口、信息窗口以及退出该应用。 -要进行截图,只需要点击托盘图标就可以了。接着你将看到如何使用 Flameshot 的帮助窗口。选择一个截图区域,然后敲 **ENTER** 键便可以截屏了,点击右键便可以看到颜色拾取器,再敲空格键便可以查看屏幕侧边的面板。你可以使用鼠标的滚轮来增加或者减少指针的宽度。 +要进行截图,只需要点击托盘图标就可以了。接着你将看到如何使用 Flameshot 的帮助窗口。选择一个截图区域,然后敲回车键便可以截屏了,点击右键便可以看到颜色拾取器,再敲空格键便可以查看屏幕侧边的面板。你可以使用鼠标的滚轮来增加或者减少指针的宽度。 Flameshot 自带一系列非常好的功能,例如: - * 可以进行手写 - * 可以划直线 - * 可以画长方形或者圆形框 - * 可以进行长方形区域选择 - * 可以画箭头 - * 可以对要点进行标注 - * 可以添加文本 - * 可以对图片或者文字进行模糊处理 - * 可以展示图片的尺寸大小 - * 在编辑图片是可以进行撤销和重做操作 - * 可以将选择的东西复制到剪贴板 - * 可以保存选择 - * 可以离开截屏 - * 可以选择另一个 app 来打开图片 - * 可以上传图片到 imgur 网站 - * 可以将图片固定到桌面上 +* 可以进行手写 +* 可以划直线 +* 可以画长方形或者圆形框 +* 可以进行长方形区域选择 +* 可以画箭头 +* 可以对要点进行标注 +* 可以添加文本 +* 可以对图片或者文字进行模糊处理 +* 可以展示图片的尺寸大小 +* 在编辑图片是可以进行撤销和重做操作 +* 可以将选择的东西复制到剪贴板 +* 可以保存选区 +* 可以离开截屏 +* 可以选择另一个 app 来打开图片 +* 可以上传图片到 imgur 网站 +* 可以将图片固定到桌面上 下面是一个示例的视频: -**快捷键** +### 快捷键 -Frameshot 也支持快捷键。在 Flameshot 的托盘图标上右击并点击 **Information** 窗口便可以看到在 GUI 模式下所有可用的快捷键。下面是在 GUI 模式下可用的快捷键清单: +Frameshot 也支持快捷键。在 Flameshot 的托盘图标上右击并点击 “Information” 窗口便可以看到在 GUI 模式下所有可用的快捷键。下面是在 GUI 模式下可用的快捷键清单: | 快捷键 | 描述 | |------------------------|------------------------------| -| ←, ↓, ↑, → | 移动选择区域 1px | -| Shift + ←, ↓, ↑, → | 将选择区域大小更改 1px | -| Esc | 退出截图 | -| Ctrl + C | 复制到粘贴板 | -| Ctrl + S | 将选择区域保存为文件 | -| Ctrl + Z | 撤销最近的一次操作 | -| Right Click | 展示颜色拾取器 | -| Mouse Wheel | 改变工具的宽度 | +| `←`、`↓`、`↑`、`→` | 移动选择区域 1px | +| `Shift` + `←`、`↓`、`↑`、`→` | 将选择区域大小更改 1px | +| `Esc` | 退出截图 | +| `Ctrl` + `C` | 复制到粘贴板 | +| `Ctrl` + `S` | 将选择区域保存为文件 | +| `Ctrl` + `Z` | 撤销最近的一次操作 | +| 鼠标右键 | 展示颜色拾取器 | +| 鼠标滚轮 | 改变工具的宽度 | -边按住 Shift 键并拖动选择区域的其中一个控制点将会对它相反方向的控制点做类似的拖放操作。 +边按住 `Shift` 键并拖动选择区域的其中一个控制点将会对它相反方向的控制点做类似的拖放操作。 -**命令行选项** +### 命令行选项 Flameshot 也支持一系列的命令行选项来延时截图和保存图片到自定义的路径。 要使用 Flameshot GUI 模式,运行: + ``` $ flameshot gui ``` 要使用 GUI 模式截屏并将你选取的区域保存到一个自定义的路径,运行: + ``` $ flameshot gui -p ~/myStuff/captures ``` 要延时 2 秒后打开 GUI 模式可以使用: + ``` $ flameshot gui -d 2000 ``` 要延时 2 秒并将截图保存到一个自定义的路径(无 GUI)可以使用: + ``` $ flameshot full -p ~/myStuff/captures -d 2000 ``` 要截图全屏并保存到自定义的路径和粘贴板中使用: + ``` $ flameshot full -c -p ~/myStuff/captures ``` -要在截屏中包含鼠标并将图片保存为 **PNG** 格式可以使用: +要在截屏中包含鼠标并将图片保存为 PNG 格式可以使用: + ``` $ flameshot screen -r ``` 要对屏幕 1 进行截屏并将截屏复制到粘贴板中可以运行: + ``` $ flameshot screen -n 1 -c ``` @@ -143,7 +154,7 @@ via: https://www.ostechnix.com/flameshot-a-simple-yet-powerful-feature-rich-scre 作者:[SK][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6dbd8e93f8d6dc3423df063482cc67b4f81fed3b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 1 Nov 2018 13:20:01 +0800 Subject: [PATCH 4/9] PUB:20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md @FSSlc https://linux.cn/article-10180-1.html --- ...eshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md (100%) diff --git a/translated/tech/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md b/published/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md similarity index 100% rename from translated/tech/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md rename to published/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md From 05600605386a6d4ee9209de82cd07512341b6e68 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Thu, 1 Nov 2018 20:35:35 +0800 Subject: [PATCH 5/9] [Translated] 20181030 How To Analyze And Explore The Contents Of Docker Images.md Signed-off-by: Chang Liu --- ...d Explore The Contents Of Docker Images.md | 100 ------------------ ...d Explore The Contents Of Docker Images.md | 94 ++++++++++++++++ 2 files changed, 94 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20181030 How To Analyze And Explore The Contents Of Docker Images.md create mode 100644 translated/tech/20181030 How To Analyze And Explore The Contents Of Docker Images.md diff --git a/sources/tech/20181030 How To Analyze And Explore The Contents Of Docker Images.md b/sources/tech/20181030 How To Analyze And Explore The Contents Of Docker Images.md deleted file mode 100644 index f76f30055d..0000000000 --- a/sources/tech/20181030 How To Analyze And Explore The Contents Of Docker Images.md +++ /dev/null @@ -1,100 +0,0 @@ -FSSlc translating - -How To Analyze And Explore The Contents Of Docker Images -====== -![](https://www.ostechnix.com/wp-content/uploads/2018/10/dive-tool-720x340.png) - -As you may already know, a Docker container image is a lightweight, standalone, executable package of software that has everything required to run an application. That’s why container images are often used by developers for building and distributing applications. If you’re curious to know what is in a Docker image, this brief guide might help you. Today, we are going to learn to analyze and explore the contents of Docker images layer by layer using a tool named **“Dive”**. By analyzing a Docker image, we can discover possible duplicate files across the layers and remove them to reduce the size of the docker image. The Dive utility is not just a Docker Image analyzer, but also helps us to build one. - -### Installing Dive - -Get the latest version from the [**releases page**][1] and install it as shown below depending upon the distribution you use. - -If you’re on **Debian** or **Ubuntu** , run the following commands to download and install it. - -``` -$ wget https://github.com/wagoodman/dive/releases/download/v0.0.8/dive_0.0.8_linux_amd64.deb - -$ sudo apt install ./dive_0.0.8_linux_amd64.deb -``` - -**On RHEL/CentOS:** - -``` -$ wget https://github.com/wagoodman/dive/releases/download/v0.0.8/dive_0.0.8_linux_amd64.rpm - -$ sudo rpm -i dive_0.0.8_linux_amd64.rpm -``` - -Dive can also installed using [**Linuxbrew**][2] package manager. - -``` -$ brew tap wagoodman/dive - -$ brew install dive -``` - -For other installation methods, refer the project’s GitHub page given at the end of this guide. - -### Analyze And Explore The Contents Of Docker Images - -To analyze a Docker image, simply run dive command with Docker “Image ID”. You can get your Docker images’ IDs using “sudo docker images” command. - -``` -$ sudo dive ea4c82dcd15a -``` - -Here, **ea4c82dcd15a** is Docker image id. - -The Dive command will quickly analyze the given Docker image and display its contents in the Terminal. -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Dive-1.png) -As you can see in the above screenshot, the layers of given docker image and its details, wasted space are shown in the left pane. On the right pane, the contents of each layer in the given Docker image. You can switch between the left and right pane using **Ctrl+SPACEBAR** key and **UP/DOWN** arrow keys to navigate through the directory tree. - -The list of keyboard shortcuts to use “Dive”. - - * **Ctrl+Spacebar** – Switch between left and right panes, - * **Spacebar** – Expand/Collapse directory tree, - * **Ctrl+A** – Show/hide added files, - * **Ctrl+R** – Show/hide removed files, - * **Ctrl+M** – Show/hide modified files, - * **Ctrl+U** – Show/hide unmodified files, - * **Ctrl+ L** – Show layer changes, - * **Ctrl+A** – Show layer changes, - * **Ctrl+/** – Filter files, - * **Ctrl+C** – Exit. - - - -In the above example, I have used “sudo” permission, because my Docker images are stored in **/var/lib/docker/** directory. If you have them on your $HOME directory or anywhere not owned “root” user, you need not to use “sudo”. - -You can also build a Docker image and do an immediate analysis with one command: `` - -``` -$ dive build -t -``` - -Dive tool is still in beta stage, so there will be bugs. If you came across any bugs, report them in the project’s github page. - -And, that’s all for today. You know now how to explore and analyze the contents of Docker container image and how to build it using Dive tool. Hope this helps. - -More good stuffs to come. Stay tuned! - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-analyze-and-explore-the-contents-of-docker-images/ - -作者:[SK][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://github.com/wagoodman/dive/releases -[2]: https://www.ostechnix.com/linuxbrew-common-package-manager-linux-mac-os-x/ diff --git a/translated/tech/20181030 How To Analyze And Explore The Contents Of Docker Images.md b/translated/tech/20181030 How To Analyze And Explore The Contents Of Docker Images.md new file mode 100644 index 0000000000..8b0021bf26 --- /dev/null +++ b/translated/tech/20181030 How To Analyze And Explore The Contents Of Docker Images.md @@ -0,0 +1,94 @@ +如何分析并探索 Docker 容器镜像的内容 +====== +![](https://www.ostechnix.com/wp-content/uploads/2018/10/dive-tool-720x340.png) + +或许你已经了解到 Docker 容器镜像是一个轻量、独立、含有运行某个应用所需全部软件的可执行包,这也是为什么容器镜像会经常被开发者用于构建和分发应用。假如你很好奇一个 Docker 镜像里面包含了什么东西,那么这篇简要的指南或许会帮助到你。今天,我们将学会使用一个名为 **Dive** 的工具来分析和探索 Docker 镜像每层的内容。通过分析 Docker 镜像,我们可以发现在各个层之间可能重复的文件并通过移除它们来减小 Docker 镜像的大小。Dive 工具不仅仅是一个 Docker 镜像分析工具,它还可以帮助我们来构建镜像。Dive 是一个用 Go 编程语言编写的免费开源工具。 + +### 安装 Dive + +首先从该项目的 [**发布页**][1] 下载最新版本,然后像下面展示的那样根据你所使用的发行版来安装它。 + +假如你正在使用 **Debian** 或者 **Ubuntu**,那么可以运行下面的命令来下载并安装它。 +``` +$ wget https://github.com/wagoodman/dive/releases/download/v0.0.8/dive_0.0.8_linux_amd64.deb +``` +``` +$ sudo apt install ./dive_0.0.8_linux_amd64.deb +``` + +**在 RHEL 或 CentOS 系统中** +``` +$ wget https://github.com/wagoodman/dive/releases/download/v0.0.8/dive_0.0.8_linux_amd64.rpm +``` +``` +$ sudo rpm -i dive_0.0.8_linux_amd64.rpm +``` + +Dive 也可以使用 [**Linuxbrew**][2] 包管理器来安装。 +``` +$ brew tap wagoodman/dive +``` +``` +$ brew install dive +``` + +至于其他的安装方法,请参考 [Dive 项目的 GitHub 网页][3]。 + +### 分析并探索 Docker 镜像的内容 + +要分析一个 Docker 镜像,只需要运行加上 Docker 镜像 ID的 dive 命令就可以了。你可以使用 `sudo docker images` 来得到 Docker 镜像的 ID。 +``` +$ sudo dive ea4c82dcd15a +``` + +上面命令中的 **ea4c82dcd15a** 是某个镜像的 id。 + +然后 Dive 命令将快速地分析给定 Docker 镜像的内容并将它在终端中展示出来。 + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Dive-1.png) + +正如你在上面的截图中看到的那样,在终端的左边一栏列出了给定 Docker 镜像的各个层及其详细内容,浪费的空间大小等信息。右边一栏则给出了给定 Docker 镜像每一层的内容。你可以使用 **Ctrl+SPACEBAR** 来在左右栏之间切换,使用 **UP/DOWN** 上下键来在目录树中进行浏览。 + +下面是 `Dive` 的快捷键列表: + * **Ctrl+Spacebar** – 在左右栏之间切换 + * **Spacebar** – 展开或收起目录树 + * **Ctrl+A** – 文件树视图:展示或隐藏增加的文件 + * **Ctrl+R** – 文件树视图:展示或隐藏被移除的文件 + * **Ctrl+M** – 文件树视图:展示或隐藏被修改的文件 + * **Ctrl+U** – 文件树视图:展示或隐藏未修改的文件 + * **Ctrl+L** – 层视图:展示当前层的变化 + * **Ctrl+A** – 层视图:展示总的变化 + * **Ctrl+/** – 筛选文件 + * **Ctrl+C** – 退出 + +在上面的例子中,我使用了 `sudo` 权限,这是因为我的 Docker 镜像存储在 **/var/lib/docker/** 目录中。假如你的镜像保存在你的家目录 `$HOME`或者在其他不属于 `root` 用户的目录,你就没有必要使用 `sudo` 命令。 + +你还可以使用下面的单个命令来构建一个 Docker 镜像并立刻分析该镜像: +``` +$ dive build -t +``` + +Dive 工具仍处于 beta 阶段,所以可能会存在 bug。假如你遇到了 bug,请在该项目的 GitHub 主页上进行报告。 + +好了,这就是今天的全部内容。现在你知道如何使用 Dive 工具来探索和分析 Docker 容器镜像的内容以及利用它构建镜像。希望本文对你有所帮助。 + +更多精彩内容即将呈现,请保持关注! + +干杯! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-analyze-and-explore-the-contents-of-docker-images/ + +作者:[SK][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://github.com/wagoodman/dive/releases +[2]: https://www.ostechnix.com/linuxbrew-common-package-manager-linux-mac-os-x/ +[3]: https://github.com/wagoodman/dive \ No newline at end of file From 451f11b2a447e013d40d198e8c94eea5c8060945 Mon Sep 17 00:00:00 2001 From: David Dai Date: Thu, 1 Nov 2018 20:51:40 +0800 Subject: [PATCH 6/9] Finish translating Disign faster web pages part 2 --- ...er web pages, part 2- Image replacement.md | 178 ------------------ ...er web pages, part 2- Image replacement.md | 177 +++++++++++++++++ 2 files changed, 177 insertions(+), 178 deletions(-) delete mode 100644 sources/tech/20181017 Design faster web pages, part 2- Image replacement.md create mode 100644 translated/tech/20181017 Design faster web pages, part 2- Image replacement.md diff --git a/sources/tech/20181017 Design faster web pages, part 2- Image replacement.md b/sources/tech/20181017 Design faster web pages, part 2- Image replacement.md deleted file mode 100644 index 119646347d..0000000000 --- a/sources/tech/20181017 Design faster web pages, part 2- Image replacement.md +++ /dev/null @@ -1,178 +0,0 @@ -Translating by StdioA - -Design faster web pages, part 2: Image replacement -====== -![](https://fedoramagazine.org/wp-content/uploads/2018/03/fasterwebsites2-816x345.jpg) - -Welcome back to this series on building faster web pages. The last [article][1] talked about what you can achieve just through image compression. The example started with 1.2MB of browser fat, and reduced down to a weight of 488.9KB. That’s still not fast enough! This article continues the browser diet to lose more fat. You might think that partway through this process things are a bit crazy, but once finished, you’ll understand why. - -### Preparation - -Once again this article starts with an analysis of the web pages. Use the built-in screenshot function of Firefox to make a screenshot of the entire page. You’ll also want to install Inkscape [using sudo][2]: - -``` -$ sudo dnf install inkscape -``` - -If you want to know how to use Inkscape, there are already several [articles][3] in Fedora Magazine. This article will only explain some basic tasks for optimizing an SVG for web use. - -### Analysis - -Once again, this example uses the [getfedora.org][4] web page. - -![Getfedora page with graphics marked][5] - -This analysis is better done graphically, which is why it starts with a screenshot. The screenshot above marks all graphical elements of the page. In two cases or better in four cases, the Fedora websites team already used measures to replace images. The icons for social media are glyphs from a font and the language selector is an SVG. - -There are several options for replacing: - - -+ CSS3 -+ Fonts -+ SVG -+ HTML5 Canvas - - -#### HTML5 Canvas - -Briefly, HTML5 Canvas is an HTML element that allows you to draw with the help of scripts, mostly JavaScript, although it’s not widely used yet. As you draw with the help of scripts, the element can also be animated. Some examples of what you can achieve with HTML Canvas include this [triangle pattern,][6] [animated wave][7], and [text animation][8]. In this case, though, it seems not to be the right choice. - -#### CSS3 - -With Cascading Style Sheets you can draw shapes and even animate them. CSS is often used for drawing elements like buttons. However, more complicated graphics via CSS are usually only seen in technical demonstration pages. This is because graphics are still better done visually as with coding. - -#### Fonts - -The usage of fonts for styling web pages is another way, and [Fontawesome][9] is quiet popular. For instance, you could replace the Flavor and the Spin icons with a font in this example. There is a negative side to using this method, which will be covered in the next part of this series, but it can be done easily. - -#### SVG - -This graphics format has existed for a long time and was always supposed to be used in the browser. For a long time not all browsers supported it, but that’s history. So the best way to replace pictures in this example is with SVG. - -### Optimizing SVG for the web - -To optimize an SVG for internet use requires several steps. - -SVG is an XML dialect. Components like circle, rectangle, or text paths are described with nodes. Each node is an XML element. To keep the code clean, an SVG should use as few nodes as possible. - -The SVG example is a circular icon with a coffee mug on it. You have 3 options to describe it with SVG. - -#### Circle element with the mug on top - -``` - -``` - -#### Circular path with the mug on top - -``` - -``` - -#### single path - -``` - -``` - -You probably can see the code becomes more complex and needs more characters to describe it. More characters in a file result, of course, in a larger size. - -#### Node cleaning - -If you open an example SVG in Inkscape and press F2, that activates the Node tool. You should see something like this: - -![Inkscape - Node tool activated][10] - -There are 5 nodes that aren’t necessary in this example — the ones in the middle of the lines. To remove them, select them one by one with the activated Node tool and press the **Del** key. After this, select the nodes which define this lines and make them corners again using the toolbar tool. - -![Inkscape - Node tool make node a corner][11] - -Without fixing the corners, handles are used that define the curve, which gets saved and will increase file size. You have to do this node cleaning by hand, as it can’t be effectively automated. Now you’re ready for the next stage. - -Use the Save as function and choose Optimized svg. A dialogue window opens where you can select what to remove or keep. - -![Inkscape - Dialog window for save as optimized SVG][12] - -Even the little SVG in this example got down from 3.2 KB to 920 bytes, less than a third of its original size. - -Back to the getfedora page: The grey voronoi pattern used in the background of the main section, after our optimization from Part 1 of this series, is down to 164.1 KB versus the original 211.12 KB size. - -The original SVG it was exported from is 1.9 MB in size. After these SVG optimization steps, it’s only 500.4KB. Too big? Well, the current blue background is 564.98 KB in size. But there’s only a small difference between the SVG and the PNG. - -#### Compressed files - -``` -$ ls -lh -insgesamt 928K --rw-r--r--. 1 user user 161K 19. Feb 19:44 grey-pattern.png --rw-rw-r--. 1 user user 160K 18. Feb 12:23 grey-pattern.png.gz --rw-r--r--. 1 user user 489K 19. Feb 19:43 greyscale-pattern-opti.svg --rw-rw-r--. 1 user user 112K 19. Feb 19:05 greyscale-pattern-opti.svg.gz -``` - -This is the output of a small test I did to visualize this topic. You should probably see that the raster graphic — the PNG — is already compressed and can’t be anymore. The opposite is the SVG, an XML file. This is just text and can compressed, to less then a fourth of its size. As a result it is now around 50 KB smaller in size than the PNG. - -Modern browsers can handle compressed files natively. Therefore, a lot of web servers have switched on mod_deflate (Apache) and gzip (nginx). That’s how we save space during delivery. Check out if it’s enabled at your server [here][13]. - -### Tooling for production - -First of all, nobody wants to always optimize SVG in Inkscape. You can run Inkscape without a GUI in batch mode, but there’s no option to convert from Inkscape SVG to optimized SVG. You can only export raster graphics this way. But there are alternatives: - - * SVGO (which seems not actively developed) - * Scour - - - -This example will use scour for optimization. To install it: - -``` -$ sudo dnf install scour -``` - -To automatically optimize an SVG file, run scour similarly to this: - -``` -[user@localhost ]$ scour INPUT.svg OUTPUT.svg -p 3 --create-groups --renderer-workaround --strip-xml-prolog --remove-descriptive-elements --enable-comment-stripping --disable-embed-rasters --no-line-breaks --enable-id-stripping --shorten-ids -``` - -This is the end of part two, in which you learned how to replace raster images with SVG and how to optimize it for usage. Stay tuned to the Fedora Magazine for part three, coming soon. - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/design-faster-web-pages-part-2-image-replacement/ - -作者:[Sirko Kemter][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/gnokii/ -[b]: https://github.com/lujun9972 -[1]: https://wp.me/p3XX0v-5fJ -[2]: https://fedoramagazine.org/howto-use-sudo/ -[3]: https://fedoramagazine.org/?s=Inkscape -[4]: https://getfedora.org -[5]: https://fedoramagazine.org/wp-content/uploads/2018/02/getfedora_mag.png -[6]: https://codepen.io/Cthulahoop/pen/umcvo -[7]: https://codepen.io/jackrugile/pen/BvLHg -[8]: https://codepen.io/tholman/pen/lDLhk -[9]: https://fontawesome.com/ -[10]: https://fedoramagazine.org/wp-content/uploads/2018/02/svg-optimization-nodes.png -[11]: https://fedoramagazine.org/wp-content/uploads/2018/02/node_cleaning.png -[12]: https://fedoramagazine.org/wp-content/uploads/2018/02/svg-optimizing-dialog.png -[13]: https://checkgzipcompression.com/?url=http%3A%2F%2Fgetfedora.org diff --git a/translated/tech/20181017 Design faster web pages, part 2- Image replacement.md b/translated/tech/20181017 Design faster web pages, part 2- Image replacement.md new file mode 100644 index 0000000000..55631b4713 --- /dev/null +++ b/translated/tech/20181017 Design faster web pages, part 2- Image replacement.md @@ -0,0 +1,177 @@ +设计更快的网页(二):图片替换 +====== +![](https://fedoramagazine.org/wp-content/uploads/2018/03/fasterwebsites2-816x345.jpg) + + +欢迎回到我们为了构建更快网页所写的系列文章。上一篇[文章][1]讨论了只通过图片压缩实现这个目标的方法。这个例子从一开始有 1.2MB 的“浏览器脂肪”,然后它减轻到了 488.9KB 的大小。但这还不够快!那么本文继续来给浏览器“减肥”。你可能在这个过程中会认为我们所做的事情有点疯狂,但一旦完成,你就会明白为什么要这么做了。 + +### 准备工作 + +本文再次从对网页的分析开始。使用 Firefox 内置的截图功能来对整个页面进行截图。你还需要[用 sudo][2] 来安装 Inkscape: + +``` +$ sudo dnf install inkscape +``` + +如果你想了解 Inkscape 的用法,Fedora 杂志上有几篇现成的[文章][3]。本文仅会介绍一些基本的 SVG 优化方法以供 Web 使用。 + +### 分析 + +我们再来用 [getfedora.org][4] 的网页来举例。 + +![Getfedora 的页面,对其中的图片做了标记][5] + +这次分析更好地以图形方式完成,这也就是它从屏幕截图开始的原因。上面的截图标记了页面中的所有图形元素。Fedora 网站团队已经针对两种情况措施(也有可能是四种,这样更好)来替换图像了。社交媒体的图标变成了字体的字形,而语言选择器变成了 SVG. + +我们有几个可以替换的选择: + + ++ CSS3 ++ 字体 ++ SVG ++ HTML5 Canvas + + +#### HTML5 Canvas + +简单来说,HTML5 Canvas 是一种 HTML 元素,它允许你借助脚本语言(通常是 JavaScript)在上面绘图,不过它现在还没有被广泛使用。因为它可以使用脚本语言来绘制,所以这个元素也可以用来做动画。这里有一些使用 HTML Canvas 实现的实例,比如[三角形模式][6]、[动态波浪][7]和[字体动画][8]。不过,在这种情况下,似乎这也不是最好的选择。 + +#### CSS3 + +使用层叠式样式表,你可以绘制图形,甚至可以让它们动起来。CSS 常被用来绘制按钮等元素。然而,使用 CSS 绘制的更复杂的图形通常只能在技术演示页面中看到。这是因为使用视觉来制作图形依然要比使用代码来的更快一些。 + +#### 字体 + +另外一种方式是使用字体来装饰网页,[Fontawesome][9] 在这方面很流行。比如,在这个例子中你可以使用字体来替换“风味”和“旋转”的图标。这种方法有一个负面影响,但解决起来很容易,我们会在本系列的下一部分中来介绍。 + +#### SVG + +这种图形格式已经存在了很长时间,而且它总是在浏览器中被使用。有很长一段时间并非所有浏览器都支持它,不过现在这已经成为历史了。所以,本例中图形替换的最佳方法是使用 SVG. + +### 为网页优化 SVG + +优化 SVG 以供互联网使用,需要几个步骤。 + +SVG 是一种 XML 方言。它用节点来描述圆形、矩形或文本路径等组件。每个节点都是一个 XML 元素。为了保证代码简洁,SVG 应该包含尽可能少的元素。 + +我们选用的 SVG 实例是带有一个咖啡杯的圆形图标。你有三种选项来用 SVG 描述它。 + +#### 一个圆形元素,上面有一个咖啡杯 + +``` + +``` + +#### 一个圆形路径,上面有一个咖啡杯 + +``` + +``` + +#### 单一路径 + +``` + +``` + +你应该可以看出,代码变得越来越复杂,需要更多的字符来描述它。当然,文件中包含更多的字符,就会导致更大的尺寸。 + +#### 节点清理 + +如果你在 Inkscape 中打开了实例 SVG 按下 F2,就会激活一个节点工具。你应该看到这样的界面: + +![Inkscape - 激活节点工具][10] + +这个例子中有五个不必要的节点——就是直线中间的那些。要删除它们,你可以使用已激活的节点工具依次选中它们,并按下 **Del** 键。然后,选中这条线的定义节点,并使用工具栏的工具把它们重新做成角。 + +![Inkscape - 将节点变成角的工具][11] + +如果不修复这些角,我们还有方法可以定义这条曲线,这条曲线会被保存,也就会增加文件体积。你可以手动清理这些节点,因为它无法有效的自动完成。现在,你已经为下一阶段做好了准备。 + +使用_另存为_功能,并选择_优化的 SVG_。这会弹出一个窗口,你可以在里面选择移除或保留哪些成分。 + +![Inkscape - “另存为”“优化的 SVG”][12] + +虽然这个 SVG 实例很小,但它还是从 3.2KB 减小到了 920 字节,不到原有的三分之一。 + +回到 getfedora 的页面:页面主要部分的背景中的灰色沃罗诺伊图,在经过本系列第一篇文章中的优化处理之后,从原先的 211.12 KB 减小到了 164.1 KB. + +页面中导出的原始 SVG 有 1.9 MB 大小。经过这些 SVG 优化步骤后,它只有 500.4 KB 了。太大了?好吧,现在的蓝色背景的体积是 564.98 KB。SVG 和 PNG 之间只有很小的差别。 + +#### 压缩文件 + +``` +$ ls -lh +insgesamt 928K +-rw-r--r--. 1 user user 161K 19. Feb 19:44 grey-pattern.png +-rw-rw-r--. 1 user user 160K 18. Feb 12:23 grey-pattern.png.gz +-rw-r--r--. 1 user user 489K 19. Feb 19:43 greyscale-pattern-opti.svg +-rw-rw-r--. 1 user user 112K 19. Feb 19:05 greyscale-pattern-opti.svg.gz +``` + +这是我为可视化这个主题所做的一个小测试的输出。你可能应该看到光栅图形——PNG——已经被压缩,不能再被压缩了。而 SVG,一个 XML 文件正相反。它是文本文件,所以可被压缩至原来的四分之一不到。因此,现在它的体积要比 PNG 小 50 KB 左右。 + +现代浏览器可以以原生方式处理压缩文件。所以,许多 Web 服务器都打开了 mod_deflate (Apache) 和 gzip (Nginx) 模式。这样我们就可以在传输过程中节省空间。你可以在[这儿][13]看看你的服务器是不是启用了它。 + +### 生产工具 + +首先,没有人希望每次都要用 Inkscape 来优化 SVG. 你可以在命令行中脱离 GUI 来运行 Inkscape,但你找不到选项来将 Inkscape SVG 转换成优化的 SVG. 用这种方式只能导出光栅图像。但是我们替代品: + + * SVGO (看起来开发过程已经不活跃了) + * Scour + + + +本例中我们使用 scour 来进行优化。先来安装它: + +``` +$ sudo dnf install scour +``` + +要想自动优化 SVG 文件,请运行 scour,就像这样: + +``` +[user@localhost ]$ scour INPUT.svg OUTPUT.svg -p 3 --create-groups --renderer-workaround --strip-xml-prolog --remove-descriptive-elements --enable-comment-stripping --disable-embed-rasters --no-line-breaks --enable-id-stripping --shorten-ids +``` + +这就是第二部分的结尾了。在这部分中你应该学会了如何将光栅图像替换成 SVG,并对它进行优化以供使用。请继续关注 Feroda 杂志,第三篇即将出炉。 + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/design-faster-web-pages-part-2-image-replacement/ + +作者:[Sirko Kemter][a] +选题:[lujun9972][b] +译者:[StdioA](https://github.com/StdioA) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/gnokii/ +[b]: https://github.com/lujun9972 +[1]: https://wp.me/p3XX0v-5fJ +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://fedoramagazine.org/?s=Inkscape +[4]: https://getfedora.org +[5]: https://fedoramagazine.org/wp-content/uploads/2018/02/getfedora_mag.png +[6]: https://codepen.io/Cthulahoop/pen/umcvo +[7]: https://codepen.io/jackrugile/pen/BvLHg +[8]: https://codepen.io/tholman/pen/lDLhk +[9]: https://fontawesome.com/ +[10]: https://fedoramagazine.org/wp-content/uploads/2018/02/svg-optimization-nodes.png +[11]: https://fedoramagazine.org/wp-content/uploads/2018/02/node_cleaning.png +[12]: https://fedoramagazine.org/wp-content/uploads/2018/02/svg-optimizing-dialog.png +[13]: https://checkgzipcompression.com/?url=http%3A%2F%2Fgetfedora.org From 8562063e8ea435897da006d9d2159de4003e403b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 1 Nov 2018 21:19:50 +0800 Subject: [PATCH 7/9] PRF:20171202 Simulating the Altair.md @geekpi --- translated/tech/20171202 Simulating the Altair.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/translated/tech/20171202 Simulating the Altair.md b/translated/tech/20171202 Simulating the Altair.md index 390298451e..e59c3c913c 100644 --- a/translated/tech/20171202 Simulating the Altair.md +++ b/translated/tech/20171202 Simulating the Altair.md @@ -1,8 +1,9 @@ -模拟 Altair +模拟 Altair 8800 计算机 ====== -[Altair 8800][1] 是 1975 年发布的自建家用电脑套件。Altair 基本上是第一台个人电脑,虽然这个名词好几年前就出现了。对 Dell、HP 或者 Macbook 而言它是亚当(或者夏娃)。 -有些人认为为 Z80(与 Altair 的 Intel 8080 密切相关的处理器)编写仿真器真是太棒了,并认为它需要模拟 Altair 的控制面板。所以如果你想知道 1975 年使用电脑是什么感觉,你可以在你的 Macbook 上运行 Altair: +[Altair 8800][1] 是 1975 年发布的自建家用电脑套件。Altair 基本上是第一台个人电脑(PC),虽然 PC 这个名词好几年前就出现了。对 Dell、HP 或者 Macbook 而言它是亚当(或者夏娃)。 + +有些人认为为 Z80(与 Altair 的 Intel 8080 密切相关的处理器)编写仿真器真是太棒了,并认为它需要一个模拟 Altair 的控制面板。所以如果你想知道 1975 年使用电脑是什么感觉,你可以在你的 Macbook 上运行 Altair: ![Altair 8800][2] @@ -22,9 +23,9 @@ $ tar -xvf z80pack-1.26.tgz $ cd z80pack-1.26 ``` -控制面板模拟基于名为 `frontpanel` 的库。你必须先编译该库。如果你进入 `frontpanel` 目录,你会发现 `README` 文件列出了库自己的依赖项。你在这里的体会几乎肯定会与我的不同,但也许我的痛苦可以作为例子。我安装了依赖项,但是是通过 [Homebrew][4] 安装的。为了让库能够编译,我必须确保在 `Makefile.osx` 中将 `/usr/local/include `添加到 Clang 的 include 路径中。 +控制面板模拟基于名为 `frontpanel` 的库。你必须先编译该库。如果你进入 `frontpanel` 目录,你会发现 `README` 文件列出了这个库自己的依赖项。你在这里的体会几乎肯定会与我的不同,但也许我的痛苦可以作为例子。我安装了依赖项,但是是通过 [Homebrew][4] 安装的。为了让库能够编译,我必须确保在 `Makefile.osx` 中将 `/usr/local/include `添加到 Clang 的 include 路径中。 -如果你觉得依赖没有问题,那么你应该就能编译库(我们现在位于 `z80pack-1.26/frontpanel`): +如果你觉得依赖没有问题,那么你应该就能编译这个库(我们现在位于 `z80pack-1.26/frontpanel`): ``` $ make -f Makefile.osx ... @@ -42,7 +43,7 @@ $ make -f Makefile.osx clean 该过程将在 `z80pack-1.26/altairsim` 中创建一个名为 `altairsim` 的可执行文件。运行该可执行文件,你应该会看到标志性的 Altair 控制面板! -如果你想要探究,请阅读原始的[Altair 手册][5] +如果你想要探究,请阅读原始的 [Altair 手册][5] 如果你喜欢这篇文章,我们每两周更新一次!在 Twitter 上关注 [@TwoBitHistory]​​[6] 或订阅 [RSS 源][7]了解什么时候有新文章。 @@ -53,7 +54,7 @@ via: https://twobithistory.org/2017/12/02/simulating-the-altair.html 作者:[Two-Bit History][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ced85230afedcac6b272d4c27d1e6e5ba912187b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 1 Nov 2018 21:22:53 +0800 Subject: [PATCH 8/9] PUB:20171202 Simulating the Altair.md @geekpi https://linux.cn/article-10181-1.html --- {translated/tech => published}/20171202 Simulating the Altair.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171202 Simulating the Altair.md (100%) diff --git a/translated/tech/20171202 Simulating the Altair.md b/published/20171202 Simulating the Altair.md similarity index 100% rename from translated/tech/20171202 Simulating the Altair.md rename to published/20171202 Simulating the Altair.md From 7fff3ae82f352a97dc4f11e1da3a91614355fb58 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 1 Nov 2018 21:26:15 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201810?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20140607 Five things that make Go fast.md | 0 ...p to JavaScript From Scratch in 350 LOC.md | 0 ...stack JavaScript web app in three weeks.md | 0 ...0170926 Managing users on Linux systems.md | 0 ...e By by Brian Christian - Tom Griffiths.md | 0 ...eshark on Debian and Ubuntu 16.04_17.10.md | 0 ... Improve your Bash scripts with Argbash.md | 0 ...ve Essential Linux Applications In 2017.md | 0 ...171214 Peeking into your Linux packages.md | 0 ...5 The Best Linux Distributions for 2018.md | 0 .../20180117 How to get into DevOps.md | 0 ...ng to Linux from dated Windows machines.md | 0 ... Rendering in React using Ternaries and.md | 0 ... React.js Foundations A Beginners Guide.md | 0 ...ultiple websites with Apache web server.md | 0 ...80412 A Desktop GUI Application For NPM.md | 0 ...nd Tutorial With Examples For Beginners.md | 0 ...rces for Securing Your Open Source Code.md | 0 ...20180528 What is behavior-driven Python.md | 0 .../20180531 How to create shortcuts in vi.md | 0 ...0180601 Download an OS with GNOME Boxes.md | 0 ... Rename Multiple Files At Once In Linux.md | 0 ...Box On Ubuntu 18.04 LTS Headless Server.md | 0 ...on Server Using KVM In Ubuntu 18.04 LTS.md | 0 ...e SSH Key-based Authentication In Linux.md | 0 .../20180715 Why is Python so slow.md | 0 ...ed Essential Linux Applications of 2018.md | 0 ...ched storage device with a Raspberry Pi.md | 0 ...5 Essential Tools for Linux Development.md | 0 ...10 How To Remove Or Disable Ubuntu Dock.md | 0 ...Educational Software and Games for Kids.md | 0 ...utomating backups on a Raspberry Pi NAS.md | 0 ...eate M3U Playlists in Linux [Quick Tip].md | 0 ... With browser-mpris2 (Chrome Extension).md | 0 ... And Mouse, But Not The Screen In Linux.md | 0 ...ubmitting your first Linux kernel patch.md | 0 .../{ => 201810}/20180823 CLI- improved.md | 0 ...ly And Safely Manage Cron Jobs In Linux.md | 0 .../20180824 5 cool music player apps.md | 0 ...0180824 What Stable Kernel Should I Use.md | 0 ...0180827 4 tips for better tmux sessions.md | 0 ...180827 A sysadmin-s guide to containers.md | 0 ...tion (conflicting files)- In Arch Linux.md | 0 ...30 6 places to host your git repository.md | 0 ...ke Screenshot in Linux GUI and Terminal.md | 0 ...t Powerful Feature-rich Screenshot Tool.md | 164 +++++++++ ...k Bandwidth In Linux Using Wondershaper.md | 0 ...lan Network Configuration Tool on Linux.md | 0 ...st An Available Package Groups In Linux.md | 0 .../20180912 How to build rpm packages.md | 0 ...80913 ScreenCloud- The Screenshot-- App.md | 0 ...estore Them On Freshly Installed Ubuntu.md | 0 ...s Why Linux is a Better Choice than Mac.md | 0 ... 4 scanning tools for the Linux desktop.md | 0 ...ith openmediavault- A home NAS solution.md | 0 ...ed to know about iptables and firewalld.md | 0 ...Top 3 Python libraries for data science.md | 0 ...st your own cloud with Raspberry Pi NAS.md | 0 ...Expand Your Skills and Grow Your Career.md | 0 ...nduct and Not Everyone is Happy With it.md | 0 ...hat will simplify your life with Django.md | 0 ...tion Of Defunct OSs, Software And Games.md | 0 ...s And Latest Headlines From Commandline.md | 0 ...ng- An open source synchronization tool.md | 0 ...eautiful And Cross-platform Podcast App.md | 0 ...Port Number A Process Is Using In Linux.md | 0 ...0180924 Why Linux users should try Rust.md | 0 ...tem Monitor Application Written In Rust.md | 0 ...cue (Single User mode) - Emergency Mode.md | 0 ...Distro With Another in Dual Boot -Guide.md | 0 ...3 open source distributed tracing tools.md | 0 ...oduction to swap space on Linux systems.md | 0 ...ntrol And Manage CPU Frequency In Linux.md | 0 ...ython library for data science projects.md | 0 .../20180927 5 cool tiling window managers.md | 0 ...ind And Delete Duplicate Files In Linux.md | 0 ...27 How to Use RAR files in Ubuntu Linux.md | 0 ...0180928 10 handy Bash aliases for Linux.md | 0 ... And Secure Online PDF Conversion Suite.md | 0 ...ntu 18.04 and Other Linux Distributions.md | 0 ...Web is Creating a New Decentralized Web.md | 0 ... iptables tips and tricks for sysadmins.md | 0 .../20181001 How to Install Pip on Ubuntu.md | 0 ...and SFTP protocols on your home network.md | 0 .../20181003 Introducing Swift on Fedora.md | 0 ...files with ls at the Linux command line.md | 0 ...lease- Facebook-s newest Open Source AI.md | 0 ...005 Open Source Logging Tools for Linux.md | 0 ...ump- A script for filling your gas tank.md | 0 ...d Reboot The Linux System From Terminal.md | 0 ...to LaTeX Instantly With This Nifty Tool.md | 0 ... Create And Maintain Your Own Man Pages.md | 0 ...urce Code In Many Programming Languages.md | 0 ...er web pages, part 1- Image compression.md | 0 ...he Enabled-Active Repositories In Linux.md | 0 ... Front-end For Popular Package Managers.md | 0 ...ith Minikube- Kubernetes on your laptop.md | 0 ...uick tips- Reading files different ways.md | 0 ... 11 applications you never knew existed.md | 0 ... Lock Virtual Console Sessions On Linux.md | 0 ...ow to Install GRUB on Arch Linux (UEFI).md | 0 ...ead Entire Arch Wiki As Linux Man Pages.md | 0 ...ux containers as a non-root with Podman.md | 0 ... a Retrogaming Console with Lakka Linux.md | 0 ...dnightBSD Hits 1.0- Checkout What-s New.md | 0 ...81018 Understanding Linux Links- Part 1.md | 0 ... use Pandoc to produce a research paper.md | 335 ++++++++++++++++++ 107 files changed, 499 insertions(+) rename published/{ => 201810}/20140607 Five things that make Go fast.md (100%) rename published/{ => 201810}/20161014 Compiling Lisp to JavaScript From Scratch in 350 LOC.md (100%) rename published/{ => 201810}/20170810 How we built our first full-stack JavaScript web app in three weeks.md (100%) rename published/{ => 201810}/20170926 Managing users on Linux systems.md (100%) rename published/{ => 201810}/20171022 Review- Algorithms to Live By by Brian Christian - Tom Griffiths.md (100%) rename published/{ => 201810}/20171129 How to Install and Use Wireshark on Debian and Ubuntu 16.04_17.10.md (100%) rename published/{ => 201810}/20171204 Improve your Bash scripts with Argbash.md (100%) rename published/{ => 201810}/20171208 24 Must Have Essential Linux Applications In 2017.md (100%) rename published/{ => 201810}/20171214 Peeking into your Linux packages.md (100%) rename published/{ => 201810}/20180105 The Best Linux Distributions for 2018.md (100%) rename published/{ => 201810}/20180117 How to get into DevOps.md (100%) rename published/{ => 201810}/20180123 Moving to Linux from dated Windows machines.md (100%) rename published/{ => 201810}/20180201 Conditional Rendering in React using Ternaries and.md (100%) rename published/{ => 201810}/20180201 Rock Solid React.js Foundations A Beginners Guide.md (100%) rename published/{ => 201810}/20180329 How to configure multiple websites with Apache web server.md (100%) rename published/{ => 201810}/20180412 A Desktop GUI Application For NPM.md (100%) rename published/{ => 201810}/20180413 The df Command Tutorial With Examples For Beginners.md (100%) rename published/{ => 201810}/20180522 Free Resources for Securing Your Open Source Code.md (100%) rename published/{ => 201810}/20180528 What is behavior-driven Python.md (100%) rename published/{ => 201810}/20180531 How to create shortcuts in vi.md (100%) rename published/{ => 201810}/20180601 Download an OS with GNOME Boxes.md (100%) rename published/{ => 201810}/20180615 How To Rename Multiple Files At Once In Linux.md (100%) rename published/{ => 201810}/20180703 Install Oracle VirtualBox On Ubuntu 18.04 LTS Headless Server.md (100%) rename published/{ => 201810}/20180704 Setup Headless Virtualization Server Using KVM In Ubuntu 18.04 LTS.md (100%) rename published/{ => 201810}/20180709 How To Configure SSH Key-based Authentication In Linux.md (100%) rename published/{ => 201810}/20180715 Why is Python so slow.md (100%) rename published/{ => 201810}/20180724 75 Most Used Essential Linux Applications of 2018.md (100%) rename published/{ => 201810}/20180724 Building a network attached storage device with a Raspberry Pi.md (100%) rename published/{ => 201810}/20180803 5 Essential Tools for Linux Development.md (100%) rename published/{ => 201810}/20180810 How To Remove Or Disable Ubuntu Dock.md (100%) rename published/{ => 201810}/20180813 5 of the Best Linux Educational Software and Games for Kids.md (100%) rename published/{ => 201810}/20180814 Automating backups on a Raspberry Pi NAS.md (100%) rename published/{ => 201810}/20180815 How to Create M3U Playlists in Linux [Quick Tip].md (100%) rename published/{ => 201810}/20180816 Add YouTube Player Controls To Your Linux Desktop With browser-mpris2 (Chrome Extension).md (100%) rename published/{ => 201810}/20180817 How To Lock The Keyboard And Mouse, But Not The Screen In Linux.md (100%) rename published/{ => 201810}/20180821 A checklist for submitting your first Linux kernel patch.md (100%) rename published/{ => 201810}/20180823 CLI- improved.md (100%) rename published/{ => 201810}/20180823 How To Easily And Safely Manage Cron Jobs In Linux.md (100%) rename published/{ => 201810}/20180824 5 cool music player apps.md (100%) rename published/{ => 201810}/20180824 What Stable Kernel Should I Use.md (100%) rename published/{ => 201810}/20180827 4 tips for better tmux sessions.md (100%) rename published/{ => 201810}/20180827 A sysadmin-s guide to containers.md (100%) rename published/{ => 201810}/20180827 Solve -error- failed to commit transaction (conflicting files)- In Arch Linux.md (100%) rename published/{ => 201810}/20180830 6 places to host your git repository.md (100%) rename published/{ => 201810}/20180901 5 Ways to Take Screenshot in Linux GUI and Terminal.md (100%) create mode 100644 published/201810/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md rename published/{ => 201810}/20180906 How To Limit Network Bandwidth In Linux Using Wondershaper.md (100%) rename published/{ => 201810}/20180907 How to Use the Netplan Network Configuration Tool on Linux.md (100%) rename published/{ => 201810}/20180910 How To List An Available Package Groups In Linux.md (100%) rename published/{ => 201810}/20180912 How to build rpm packages.md (100%) rename published/{ => 201810}/20180913 ScreenCloud- The Screenshot-- App.md (100%) rename published/{ => 201810}/20180915 Backup Installed Packages And Restore Them On Freshly Installed Ubuntu.md (100%) rename published/{ => 201810}/20180915 Linux vs Mac- 7 Reasons Why Linux is a Better Choice than Mac.md (100%) rename published/{ => 201810}/20180917 4 scanning tools for the Linux desktop.md (100%) rename published/{ => 201810}/20180917 Getting started with openmediavault- A home NAS solution.md (100%) rename published/{ => 201810}/20180918 Linux firewalls- What you need to know about iptables and firewalld.md (100%) rename published/{ => 201810}/20180918 Top 3 Python libraries for data science.md (100%) rename published/{ => 201810}/20180919 Host your own cloud with Raspberry Pi NAS.md (100%) rename published/{ => 201810}/20180919 How Writing Can Expand Your Skills and Grow Your Career.md (100%) rename published/{ => 201810}/20180919 Linux Has a Code of Conduct and Not Everyone is Happy With it.md (100%) rename published/{ => 201810}/20180920 8 Python packages that will simplify your life with Django.md (100%) rename published/{ => 201810}/20180920 WinWorld - A Large Collection Of Defunct OSs, Software And Games.md (100%) rename published/{ => 201810}/20180921 Clinews - Read News And Latest Headlines From Commandline.md (100%) rename published/{ => 201810}/20180921 Control your data with Syncthing- An open source synchronization tool.md (100%) rename published/{ => 201810}/20180924 A Simple, Beautiful And Cross-platform Podcast App.md (100%) rename published/{ => 201810}/20180924 How To Find Out Which Port Number A Process Is Using In Linux.md (100%) rename published/{ => 201810}/20180924 Why Linux users should try Rust.md (100%) rename published/{ => 201810}/20180925 Hegemon - A Modular System Monitor Application Written In Rust.md (100%) rename published/{ => 201810}/20180925 How to Boot Ubuntu 18.04 - Debian 9 Server in Rescue (Single User mode) - Emergency Mode.md (100%) rename published/{ => 201810}/20180925 How to Replace one Linux Distro With Another in Dual Boot -Guide.md (100%) rename published/{ => 201810}/20180926 3 open source distributed tracing tools.md (100%) rename published/{ => 201810}/20180926 An introduction to swap space on Linux systems.md (100%) rename published/{ => 201810}/20180926 CPU Power Manager - Control And Manage CPU Frequency In Linux.md (100%) rename published/{ => 201810}/20180926 How to use the Scikit-learn Python library for data science projects.md (100%) rename published/{ => 201810}/20180927 5 cool tiling window managers.md (100%) rename published/{ => 201810}/20180927 How To Find And Delete Duplicate Files In Linux.md (100%) rename published/{ => 201810}/20180927 How to Use RAR files in Ubuntu Linux.md (100%) rename published/{ => 201810}/20180928 10 handy Bash aliases for Linux.md (100%) rename published/{ => 201810}/20180928 A Free And Secure Online PDF Conversion Suite.md (100%) rename published/{ => 201810}/20180928 How to Install Popcorn Time on Ubuntu 18.04 and Other Linux Distributions.md (100%) rename published/{ => 201810}/20180930 Creator of the World Wide Web is Creating a New Decentralized Web.md (100%) rename published/{ => 201810}/20181001 16 iptables tips and tricks for sysadmins.md (100%) rename published/{ => 201810}/20181001 How to Install Pip on Ubuntu.md (100%) rename published/{ => 201810}/20181002 How use SSH and SFTP protocols on your home network.md (100%) rename published/{ => 201810}/20181003 Introducing Swift on Fedora.md (100%) rename published/{ => 201810}/20181003 Tips for listing files with ls at the Linux command line.md (100%) rename published/{ => 201810}/20181004 PyTorch 1.0 Preview Release- Facebook-s newest Open Source AI.md (100%) rename published/{ => 201810}/20181005 Open Source Logging Tools for Linux.md (100%) rename published/{ => 201810}/20181008 Python at the pump- A script for filling your gas tank.md (100%) rename published/{ => 201810}/20181009 6 Commands To Shutdown And Reboot The Linux System From Terminal.md (100%) rename published/{ => 201810}/20181009 Convert Screenshots of Equations into LaTeX Instantly With This Nifty Tool.md (100%) rename published/{ => 201810}/20181009 How To Create And Maintain Your Own Man Pages.md (100%) rename published/{ => 201810}/20181010 Cloc - Count The Lines Of Source Code In Many Programming Languages.md (100%) rename published/{ => 201810}/20181010 Design faster web pages, part 1- Image compression.md (100%) rename published/{ => 201810}/20181010 How To List The Enabled-Active Repositories In Linux.md (100%) rename published/{ => 201810}/20181011 A Front-end For Popular Package Managers.md (100%) rename published/{ => 201810}/20181011 Getting started with Minikube- Kubernetes on your laptop.md (100%) rename published/{ => 201810}/20181012 Command line quick tips- Reading files different ways.md (100%) rename published/{ => 201810}/20181012 Happy birthday, KDE- 11 applications you never knew existed.md (100%) rename published/{ => 201810}/20181012 How To Lock Virtual Console Sessions On Linux.md (100%) rename published/{ => 201810}/20181013 How to Install GRUB on Arch Linux (UEFI).md (100%) rename published/{ => 201810}/20181015 How To Browse And Read Entire Arch Wiki As Linux Man Pages.md (100%) rename published/{ => 201810}/20181015 Running Linux containers as a non-root with Podman.md (100%) rename published/{ => 201810}/20181016 Turn Your Old PC into a Retrogaming Console with Lakka Linux.md (100%) rename published/{ => 201810}/20181018 MidnightBSD Hits 1.0- Checkout What-s New.md (100%) rename published/{ => 201810}/20181018 Understanding Linux Links- Part 1.md (100%) create mode 100644 published/201810/20181019 How to use Pandoc to produce a research paper.md diff --git a/published/20140607 Five things that make Go fast.md b/published/201810/20140607 Five things that make Go fast.md similarity index 100% rename from published/20140607 Five things that make Go fast.md rename to published/201810/20140607 Five things that make Go fast.md diff --git a/published/20161014 Compiling Lisp to JavaScript From Scratch in 350 LOC.md b/published/201810/20161014 Compiling Lisp to JavaScript From Scratch in 350 LOC.md similarity index 100% rename from published/20161014 Compiling Lisp to JavaScript From Scratch in 350 LOC.md rename to published/201810/20161014 Compiling Lisp to JavaScript From Scratch in 350 LOC.md diff --git a/published/20170810 How we built our first full-stack JavaScript web app in three weeks.md b/published/201810/20170810 How we built our first full-stack JavaScript web app in three weeks.md similarity index 100% rename from published/20170810 How we built our first full-stack JavaScript web app in three weeks.md rename to published/201810/20170810 How we built our first full-stack JavaScript web app in three weeks.md diff --git a/published/20170926 Managing users on Linux systems.md b/published/201810/20170926 Managing users on Linux systems.md similarity index 100% rename from published/20170926 Managing users on Linux systems.md rename to published/201810/20170926 Managing users on Linux systems.md diff --git a/published/20171022 Review- Algorithms to Live By by Brian Christian - Tom Griffiths.md b/published/201810/20171022 Review- Algorithms to Live By by Brian Christian - Tom Griffiths.md similarity index 100% rename from published/20171022 Review- Algorithms to Live By by Brian Christian - Tom Griffiths.md rename to published/201810/20171022 Review- Algorithms to Live By by Brian Christian - Tom Griffiths.md diff --git a/published/20171129 How to Install and Use Wireshark on Debian and Ubuntu 16.04_17.10.md b/published/201810/20171129 How to Install and Use Wireshark on Debian and Ubuntu 16.04_17.10.md similarity index 100% rename from published/20171129 How to Install and Use Wireshark on Debian and Ubuntu 16.04_17.10.md rename to published/201810/20171129 How to Install and Use Wireshark on Debian and Ubuntu 16.04_17.10.md diff --git a/published/20171204 Improve your Bash scripts with Argbash.md b/published/201810/20171204 Improve your Bash scripts with Argbash.md similarity index 100% rename from published/20171204 Improve your Bash scripts with Argbash.md rename to published/201810/20171204 Improve your Bash scripts with Argbash.md diff --git a/published/20171208 24 Must Have Essential Linux Applications In 2017.md b/published/201810/20171208 24 Must Have Essential Linux Applications In 2017.md similarity index 100% rename from published/20171208 24 Must Have Essential Linux Applications In 2017.md rename to published/201810/20171208 24 Must Have Essential Linux Applications In 2017.md diff --git a/published/20171214 Peeking into your Linux packages.md b/published/201810/20171214 Peeking into your Linux packages.md similarity index 100% rename from published/20171214 Peeking into your Linux packages.md rename to published/201810/20171214 Peeking into your Linux packages.md diff --git a/published/20180105 The Best Linux Distributions for 2018.md b/published/201810/20180105 The Best Linux Distributions for 2018.md similarity index 100% rename from published/20180105 The Best Linux Distributions for 2018.md rename to published/201810/20180105 The Best Linux Distributions for 2018.md diff --git a/published/20180117 How to get into DevOps.md b/published/201810/20180117 How to get into DevOps.md similarity index 100% rename from published/20180117 How to get into DevOps.md rename to published/201810/20180117 How to get into DevOps.md diff --git a/published/20180123 Moving to Linux from dated Windows machines.md b/published/201810/20180123 Moving to Linux from dated Windows machines.md similarity index 100% rename from published/20180123 Moving to Linux from dated Windows machines.md rename to published/201810/20180123 Moving to Linux from dated Windows machines.md diff --git a/published/20180201 Conditional Rendering in React using Ternaries and.md b/published/201810/20180201 Conditional Rendering in React using Ternaries and.md similarity index 100% rename from published/20180201 Conditional Rendering in React using Ternaries and.md rename to published/201810/20180201 Conditional Rendering in React using Ternaries and.md diff --git a/published/20180201 Rock Solid React.js Foundations A Beginners Guide.md b/published/201810/20180201 Rock Solid React.js Foundations A Beginners Guide.md similarity index 100% rename from published/20180201 Rock Solid React.js Foundations A Beginners Guide.md rename to published/201810/20180201 Rock Solid React.js Foundations A Beginners Guide.md diff --git a/published/20180329 How to configure multiple websites with Apache web server.md b/published/201810/20180329 How to configure multiple websites with Apache web server.md similarity index 100% rename from published/20180329 How to configure multiple websites with Apache web server.md rename to published/201810/20180329 How to configure multiple websites with Apache web server.md diff --git a/published/20180412 A Desktop GUI Application For NPM.md b/published/201810/20180412 A Desktop GUI Application For NPM.md similarity index 100% rename from published/20180412 A Desktop GUI Application For NPM.md rename to published/201810/20180412 A Desktop GUI Application For NPM.md diff --git a/published/20180413 The df Command Tutorial With Examples For Beginners.md b/published/201810/20180413 The df Command Tutorial With Examples For Beginners.md similarity index 100% rename from published/20180413 The df Command Tutorial With Examples For Beginners.md rename to published/201810/20180413 The df Command Tutorial With Examples For Beginners.md diff --git a/published/20180522 Free Resources for Securing Your Open Source Code.md b/published/201810/20180522 Free Resources for Securing Your Open Source Code.md similarity index 100% rename from published/20180522 Free Resources for Securing Your Open Source Code.md rename to published/201810/20180522 Free Resources for Securing Your Open Source Code.md diff --git a/published/20180528 What is behavior-driven Python.md b/published/201810/20180528 What is behavior-driven Python.md similarity index 100% rename from published/20180528 What is behavior-driven Python.md rename to published/201810/20180528 What is behavior-driven Python.md diff --git a/published/20180531 How to create shortcuts in vi.md b/published/201810/20180531 How to create shortcuts in vi.md similarity index 100% rename from published/20180531 How to create shortcuts in vi.md rename to published/201810/20180531 How to create shortcuts in vi.md diff --git a/published/20180601 Download an OS with GNOME Boxes.md b/published/201810/20180601 Download an OS with GNOME Boxes.md similarity index 100% rename from published/20180601 Download an OS with GNOME Boxes.md rename to published/201810/20180601 Download an OS with GNOME Boxes.md diff --git a/published/20180615 How To Rename Multiple Files At Once In Linux.md b/published/201810/20180615 How To Rename Multiple Files At Once In Linux.md similarity index 100% rename from published/20180615 How To Rename Multiple Files At Once In Linux.md rename to published/201810/20180615 How To Rename Multiple Files At Once In Linux.md diff --git a/published/20180703 Install Oracle VirtualBox On Ubuntu 18.04 LTS Headless Server.md b/published/201810/20180703 Install Oracle VirtualBox On Ubuntu 18.04 LTS Headless Server.md similarity index 100% rename from published/20180703 Install Oracle VirtualBox On Ubuntu 18.04 LTS Headless Server.md rename to published/201810/20180703 Install Oracle VirtualBox On Ubuntu 18.04 LTS Headless Server.md diff --git a/published/20180704 Setup Headless Virtualization Server Using KVM In Ubuntu 18.04 LTS.md b/published/201810/20180704 Setup Headless Virtualization Server Using KVM In Ubuntu 18.04 LTS.md similarity index 100% rename from published/20180704 Setup Headless Virtualization Server Using KVM In Ubuntu 18.04 LTS.md rename to published/201810/20180704 Setup Headless Virtualization Server Using KVM In Ubuntu 18.04 LTS.md diff --git a/published/20180709 How To Configure SSH Key-based Authentication In Linux.md b/published/201810/20180709 How To Configure SSH Key-based Authentication In Linux.md similarity index 100% rename from published/20180709 How To Configure SSH Key-based Authentication In Linux.md rename to published/201810/20180709 How To Configure SSH Key-based Authentication In Linux.md diff --git a/published/20180715 Why is Python so slow.md b/published/201810/20180715 Why is Python so slow.md similarity index 100% rename from published/20180715 Why is Python so slow.md rename to published/201810/20180715 Why is Python so slow.md diff --git a/published/20180724 75 Most Used Essential Linux Applications of 2018.md b/published/201810/20180724 75 Most Used Essential Linux Applications of 2018.md similarity index 100% rename from published/20180724 75 Most Used Essential Linux Applications of 2018.md rename to published/201810/20180724 75 Most Used Essential Linux Applications of 2018.md diff --git a/published/20180724 Building a network attached storage device with a Raspberry Pi.md b/published/201810/20180724 Building a network attached storage device with a Raspberry Pi.md similarity index 100% rename from published/20180724 Building a network attached storage device with a Raspberry Pi.md rename to published/201810/20180724 Building a network attached storage device with a Raspberry Pi.md diff --git a/published/20180803 5 Essential Tools for Linux Development.md b/published/201810/20180803 5 Essential Tools for Linux Development.md similarity index 100% rename from published/20180803 5 Essential Tools for Linux Development.md rename to published/201810/20180803 5 Essential Tools for Linux Development.md diff --git a/published/20180810 How To Remove Or Disable Ubuntu Dock.md b/published/201810/20180810 How To Remove Or Disable Ubuntu Dock.md similarity index 100% rename from published/20180810 How To Remove Or Disable Ubuntu Dock.md rename to published/201810/20180810 How To Remove Or Disable Ubuntu Dock.md diff --git a/published/20180813 5 of the Best Linux Educational Software and Games for Kids.md b/published/201810/20180813 5 of the Best Linux Educational Software and Games for Kids.md similarity index 100% rename from published/20180813 5 of the Best Linux Educational Software and Games for Kids.md rename to published/201810/20180813 5 of the Best Linux Educational Software and Games for Kids.md diff --git a/published/20180814 Automating backups on a Raspberry Pi NAS.md b/published/201810/20180814 Automating backups on a Raspberry Pi NAS.md similarity index 100% rename from published/20180814 Automating backups on a Raspberry Pi NAS.md rename to published/201810/20180814 Automating backups on a Raspberry Pi NAS.md diff --git a/published/20180815 How to Create M3U Playlists in Linux [Quick Tip].md b/published/201810/20180815 How to Create M3U Playlists in Linux [Quick Tip].md similarity index 100% rename from published/20180815 How to Create M3U Playlists in Linux [Quick Tip].md rename to published/201810/20180815 How to Create M3U Playlists in Linux [Quick Tip].md diff --git a/published/20180816 Add YouTube Player Controls To Your Linux Desktop With browser-mpris2 (Chrome Extension).md b/published/201810/20180816 Add YouTube Player Controls To Your Linux Desktop With browser-mpris2 (Chrome Extension).md similarity index 100% rename from published/20180816 Add YouTube Player Controls To Your Linux Desktop With browser-mpris2 (Chrome Extension).md rename to published/201810/20180816 Add YouTube Player Controls To Your Linux Desktop With browser-mpris2 (Chrome Extension).md diff --git a/published/20180817 How To Lock The Keyboard And Mouse, But Not The Screen In Linux.md b/published/201810/20180817 How To Lock The Keyboard And Mouse, But Not The Screen In Linux.md similarity index 100% rename from published/20180817 How To Lock The Keyboard And Mouse, But Not The Screen In Linux.md rename to published/201810/20180817 How To Lock The Keyboard And Mouse, But Not The Screen In Linux.md diff --git a/published/20180821 A checklist for submitting your first Linux kernel patch.md b/published/201810/20180821 A checklist for submitting your first Linux kernel patch.md similarity index 100% rename from published/20180821 A checklist for submitting your first Linux kernel patch.md rename to published/201810/20180821 A checklist for submitting your first Linux kernel patch.md diff --git a/published/20180823 CLI- improved.md b/published/201810/20180823 CLI- improved.md similarity index 100% rename from published/20180823 CLI- improved.md rename to published/201810/20180823 CLI- improved.md diff --git a/published/20180823 How To Easily And Safely Manage Cron Jobs In Linux.md b/published/201810/20180823 How To Easily And Safely Manage Cron Jobs In Linux.md similarity index 100% rename from published/20180823 How To Easily And Safely Manage Cron Jobs In Linux.md rename to published/201810/20180823 How To Easily And Safely Manage Cron Jobs In Linux.md diff --git a/published/20180824 5 cool music player apps.md b/published/201810/20180824 5 cool music player apps.md similarity index 100% rename from published/20180824 5 cool music player apps.md rename to published/201810/20180824 5 cool music player apps.md diff --git a/published/20180824 What Stable Kernel Should I Use.md b/published/201810/20180824 What Stable Kernel Should I Use.md similarity index 100% rename from published/20180824 What Stable Kernel Should I Use.md rename to published/201810/20180824 What Stable Kernel Should I Use.md diff --git a/published/20180827 4 tips for better tmux sessions.md b/published/201810/20180827 4 tips for better tmux sessions.md similarity index 100% rename from published/20180827 4 tips for better tmux sessions.md rename to published/201810/20180827 4 tips for better tmux sessions.md diff --git a/published/20180827 A sysadmin-s guide to containers.md b/published/201810/20180827 A sysadmin-s guide to containers.md similarity index 100% rename from published/20180827 A sysadmin-s guide to containers.md rename to published/201810/20180827 A sysadmin-s guide to containers.md diff --git a/published/20180827 Solve -error- failed to commit transaction (conflicting files)- In Arch Linux.md b/published/201810/20180827 Solve -error- failed to commit transaction (conflicting files)- In Arch Linux.md similarity index 100% rename from published/20180827 Solve -error- failed to commit transaction (conflicting files)- In Arch Linux.md rename to published/201810/20180827 Solve -error- failed to commit transaction (conflicting files)- In Arch Linux.md diff --git a/published/20180830 6 places to host your git repository.md b/published/201810/20180830 6 places to host your git repository.md similarity index 100% rename from published/20180830 6 places to host your git repository.md rename to published/201810/20180830 6 places to host your git repository.md diff --git a/published/20180901 5 Ways to Take Screenshot in Linux GUI and Terminal.md b/published/201810/20180901 5 Ways to Take Screenshot in Linux GUI and Terminal.md similarity index 100% rename from published/20180901 5 Ways to Take Screenshot in Linux GUI and Terminal.md rename to published/201810/20180901 5 Ways to Take Screenshot in Linux GUI and Terminal.md diff --git a/published/201810/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md b/published/201810/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md new file mode 100644 index 0000000000..a34c575261 --- /dev/null +++ b/published/201810/20180901 Flameshot - A Simple, Yet Powerful Feature-rich Screenshot Tool.md @@ -0,0 +1,164 @@ +Flameshot:一个简洁但功能丰富的截图工具 +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/09/Flameshot-720x340.png) + +截图是我工作的一部分,我先前使用深度截图工具来截图,深度截图是一个简单、轻量级且非常简洁的截图工具。它自带许多功能例如窗口识别、快捷键支持、图片编辑、延时截图、社交分享、智能存储以及图片清晰度调整等功能。今天我碰巧发现了另一个具备多种功能的截图工具,它就是 **Flameshot** ,一个简单但功能丰富的针对类 Unix 系统的截图工具。它简单易用,可定制并且有选项可以支持上传截图到在线图片分享网站 **imgur** 上。同时 Flameshot 有一个 CLI 版本,所以你也可以从命令行来进行截图。Flameshot 是一个完全免费且开源的工具。在本教程中,我们将看到如何安装 Flameshot 以及如何使用它来截图。 + +### 安装 Flameshot + +**在 Arch Linux 上:** + +Flameshot 可以从 Arch LInux 的 [community] 仓库中获取。确保你已经启用了 community 仓库,然后就可以像下面展示的那样使用 pacman 来安装 Flameshot : + +``` +$ sudo pacman -S flameshot +``` + +它也可以从 [**AUR**][1] 中获取,所以你还可以使用任意一个 AUR 帮助程序(例如 [**Yay**][2])来在基于 Arch 的系统中安装它: + +``` +$ yay -S flameshot-git +``` + +**在 Fedora 中:** + +``` +$ sudo dnf install flameshot +``` + +在 **Debian 10+** 和 **Ubuntu 18.04+** 中,可以使用 APT 包管理器来安装它: + +``` +$ sudo apt install flameshot +``` + +**在 openSUSE 上:** + +``` +$ sudo zypper install flameshot +``` + +在其他的 Linux 发行版中,可以从源代码编译并安装它。编译过程中需要 **Qt version 5.3** 以及 **GCC 4.9.2** 或者它们的更高版本。 + +### 使用 + +可以从菜单或者应用启动器中启动 Flameshot。在 MATE 桌面环境,它通常可以在 “Applications -> Graphics” 下找到。 + +一旦打开了它,你就可以在系统面板中看到 Flameshot 的托盘图标。 + +**注意:** + +假如你使用 Gnome 桌面环境,为了能够看到系统托盘图标,你需要安装 [TopIcons][3] 扩展。 + +在 Flameshot 托盘图标上右击,你便会看到几个菜单项,例如打开配置窗口、信息窗口以及退出该应用。 + +要进行截图,只需要点击托盘图标就可以了。接着你将看到如何使用 Flameshot 的帮助窗口。选择一个截图区域,然后敲回车键便可以截屏了,点击右键便可以看到颜色拾取器,再敲空格键便可以查看屏幕侧边的面板。你可以使用鼠标的滚轮来增加或者减少指针的宽度。 + +Flameshot 自带一系列非常好的功能,例如: + +* 可以进行手写 +* 可以划直线 +* 可以画长方形或者圆形框 +* 可以进行长方形区域选择 +* 可以画箭头 +* 可以对要点进行标注 +* 可以添加文本 +* 可以对图片或者文字进行模糊处理 +* 可以展示图片的尺寸大小 +* 在编辑图片是可以进行撤销和重做操作 +* 可以将选择的东西复制到剪贴板 +* 可以保存选区 +* 可以离开截屏 +* 可以选择另一个 app 来打开图片 +* 可以上传图片到 imgur 网站 +* 可以将图片固定到桌面上 + +下面是一个示例的视频: + + + +### 快捷键 + +Frameshot 也支持快捷键。在 Flameshot 的托盘图标上右击并点击 “Information” 窗口便可以看到在 GUI 模式下所有可用的快捷键。下面是在 GUI 模式下可用的快捷键清单: + +| 快捷键 | 描述 | +|------------------------|------------------------------| +| `←`、`↓`、`↑`、`→` | 移动选择区域 1px | +| `Shift` + `←`、`↓`、`↑`、`→` | 将选择区域大小更改 1px | +| `Esc` | 退出截图 | +| `Ctrl` + `C` | 复制到粘贴板 | +| `Ctrl` + `S` | 将选择区域保存为文件 | +| `Ctrl` + `Z` | 撤销最近的一次操作 | +| 鼠标右键 | 展示颜色拾取器 | +| 鼠标滚轮 | 改变工具的宽度 | + +边按住 `Shift` 键并拖动选择区域的其中一个控制点将会对它相反方向的控制点做类似的拖放操作。 + +### 命令行选项 + +Flameshot 也支持一系列的命令行选项来延时截图和保存图片到自定义的路径。 + +要使用 Flameshot GUI 模式,运行: + +``` +$ flameshot gui +``` + +要使用 GUI 模式截屏并将你选取的区域保存到一个自定义的路径,运行: + +``` +$ flameshot gui -p ~/myStuff/captures +``` + +要延时 2 秒后打开 GUI 模式可以使用: + +``` +$ flameshot gui -d 2000 +``` + +要延时 2 秒并将截图保存到一个自定义的路径(无 GUI)可以使用: + +``` +$ flameshot full -p ~/myStuff/captures -d 2000 +``` + +要截图全屏并保存到自定义的路径和粘贴板中使用: + +``` +$ flameshot full -c -p ~/myStuff/captures +``` + +要在截屏中包含鼠标并将图片保存为 PNG 格式可以使用: + +``` +$ flameshot screen -r +``` + +要对屏幕 1 进行截屏并将截屏复制到粘贴板中可以运行: + +``` +$ flameshot screen -n 1 -c +``` + +你还需要什么功能呢?Flameshot 拥有几乎截屏的所有功能:添加注释、编辑图片、模糊处理或者对要点做高亮等等功能。我想:在我找到它的最佳替代品之前,我将一直使用 Flameshot 来作为我当前的截图工具。请尝试一下它,你不会失望的。 + +好了,这就是今天的全部内容了。后续将有更多精彩内容,请保持关注! + +Cheers! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/flameshot-a-simple-yet-powerful-feature-rich-screenshot-tool/ + +作者:[SK][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[1]: https://aur.archlinux.org/packages/flameshot-git +[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[3]: https://extensions.gnome.org/extension/1031/topicons/ diff --git a/published/20180906 How To Limit Network Bandwidth In Linux Using Wondershaper.md b/published/201810/20180906 How To Limit Network Bandwidth In Linux Using Wondershaper.md similarity index 100% rename from published/20180906 How To Limit Network Bandwidth In Linux Using Wondershaper.md rename to published/201810/20180906 How To Limit Network Bandwidth In Linux Using Wondershaper.md diff --git a/published/20180907 How to Use the Netplan Network Configuration Tool on Linux.md b/published/201810/20180907 How to Use the Netplan Network Configuration Tool on Linux.md similarity index 100% rename from published/20180907 How to Use the Netplan Network Configuration Tool on Linux.md rename to published/201810/20180907 How to Use the Netplan Network Configuration Tool on Linux.md diff --git a/published/20180910 How To List An Available Package Groups In Linux.md b/published/201810/20180910 How To List An Available Package Groups In Linux.md similarity index 100% rename from published/20180910 How To List An Available Package Groups In Linux.md rename to published/201810/20180910 How To List An Available Package Groups In Linux.md diff --git a/published/20180912 How to build rpm packages.md b/published/201810/20180912 How to build rpm packages.md similarity index 100% rename from published/20180912 How to build rpm packages.md rename to published/201810/20180912 How to build rpm packages.md diff --git a/published/20180913 ScreenCloud- The Screenshot-- App.md b/published/201810/20180913 ScreenCloud- The Screenshot-- App.md similarity index 100% rename from published/20180913 ScreenCloud- The Screenshot-- App.md rename to published/201810/20180913 ScreenCloud- The Screenshot-- App.md diff --git a/published/20180915 Backup Installed Packages And Restore Them On Freshly Installed Ubuntu.md b/published/201810/20180915 Backup Installed Packages And Restore Them On Freshly Installed Ubuntu.md similarity index 100% rename from published/20180915 Backup Installed Packages And Restore Them On Freshly Installed Ubuntu.md rename to published/201810/20180915 Backup Installed Packages And Restore Them On Freshly Installed Ubuntu.md diff --git a/published/20180915 Linux vs Mac- 7 Reasons Why Linux is a Better Choice than Mac.md b/published/201810/20180915 Linux vs Mac- 7 Reasons Why Linux is a Better Choice than Mac.md similarity index 100% rename from published/20180915 Linux vs Mac- 7 Reasons Why Linux is a Better Choice than Mac.md rename to published/201810/20180915 Linux vs Mac- 7 Reasons Why Linux is a Better Choice than Mac.md diff --git a/published/20180917 4 scanning tools for the Linux desktop.md b/published/201810/20180917 4 scanning tools for the Linux desktop.md similarity index 100% rename from published/20180917 4 scanning tools for the Linux desktop.md rename to published/201810/20180917 4 scanning tools for the Linux desktop.md diff --git a/published/20180917 Getting started with openmediavault- A home NAS solution.md b/published/201810/20180917 Getting started with openmediavault- A home NAS solution.md similarity index 100% rename from published/20180917 Getting started with openmediavault- A home NAS solution.md rename to published/201810/20180917 Getting started with openmediavault- A home NAS solution.md diff --git a/published/20180918 Linux firewalls- What you need to know about iptables and firewalld.md b/published/201810/20180918 Linux firewalls- What you need to know about iptables and firewalld.md similarity index 100% rename from published/20180918 Linux firewalls- What you need to know about iptables and firewalld.md rename to published/201810/20180918 Linux firewalls- What you need to know about iptables and firewalld.md diff --git a/published/20180918 Top 3 Python libraries for data science.md b/published/201810/20180918 Top 3 Python libraries for data science.md similarity index 100% rename from published/20180918 Top 3 Python libraries for data science.md rename to published/201810/20180918 Top 3 Python libraries for data science.md diff --git a/published/20180919 Host your own cloud with Raspberry Pi NAS.md b/published/201810/20180919 Host your own cloud with Raspberry Pi NAS.md similarity index 100% rename from published/20180919 Host your own cloud with Raspberry Pi NAS.md rename to published/201810/20180919 Host your own cloud with Raspberry Pi NAS.md diff --git a/published/20180919 How Writing Can Expand Your Skills and Grow Your Career.md b/published/201810/20180919 How Writing Can Expand Your Skills and Grow Your Career.md similarity index 100% rename from published/20180919 How Writing Can Expand Your Skills and Grow Your Career.md rename to published/201810/20180919 How Writing Can Expand Your Skills and Grow Your Career.md diff --git a/published/20180919 Linux Has a Code of Conduct and Not Everyone is Happy With it.md b/published/201810/20180919 Linux Has a Code of Conduct and Not Everyone is Happy With it.md similarity index 100% rename from published/20180919 Linux Has a Code of Conduct and Not Everyone is Happy With it.md rename to published/201810/20180919 Linux Has a Code of Conduct and Not Everyone is Happy With it.md diff --git a/published/20180920 8 Python packages that will simplify your life with Django.md b/published/201810/20180920 8 Python packages that will simplify your life with Django.md similarity index 100% rename from published/20180920 8 Python packages that will simplify your life with Django.md rename to published/201810/20180920 8 Python packages that will simplify your life with Django.md diff --git a/published/20180920 WinWorld - A Large Collection Of Defunct OSs, Software And Games.md b/published/201810/20180920 WinWorld - A Large Collection Of Defunct OSs, Software And Games.md similarity index 100% rename from published/20180920 WinWorld - A Large Collection Of Defunct OSs, Software And Games.md rename to published/201810/20180920 WinWorld - A Large Collection Of Defunct OSs, Software And Games.md diff --git a/published/20180921 Clinews - Read News And Latest Headlines From Commandline.md b/published/201810/20180921 Clinews - Read News And Latest Headlines From Commandline.md similarity index 100% rename from published/20180921 Clinews - Read News And Latest Headlines From Commandline.md rename to published/201810/20180921 Clinews - Read News And Latest Headlines From Commandline.md diff --git a/published/20180921 Control your data with Syncthing- An open source synchronization tool.md b/published/201810/20180921 Control your data with Syncthing- An open source synchronization tool.md similarity index 100% rename from published/20180921 Control your data with Syncthing- An open source synchronization tool.md rename to published/201810/20180921 Control your data with Syncthing- An open source synchronization tool.md diff --git a/published/20180924 A Simple, Beautiful And Cross-platform Podcast App.md b/published/201810/20180924 A Simple, Beautiful And Cross-platform Podcast App.md similarity index 100% rename from published/20180924 A Simple, Beautiful And Cross-platform Podcast App.md rename to published/201810/20180924 A Simple, Beautiful And Cross-platform Podcast App.md diff --git a/published/20180924 How To Find Out Which Port Number A Process Is Using In Linux.md b/published/201810/20180924 How To Find Out Which Port Number A Process Is Using In Linux.md similarity index 100% rename from published/20180924 How To Find Out Which Port Number A Process Is Using In Linux.md rename to published/201810/20180924 How To Find Out Which Port Number A Process Is Using In Linux.md diff --git a/published/20180924 Why Linux users should try Rust.md b/published/201810/20180924 Why Linux users should try Rust.md similarity index 100% rename from published/20180924 Why Linux users should try Rust.md rename to published/201810/20180924 Why Linux users should try Rust.md diff --git a/published/20180925 Hegemon - A Modular System Monitor Application Written In Rust.md b/published/201810/20180925 Hegemon - A Modular System Monitor Application Written In Rust.md similarity index 100% rename from published/20180925 Hegemon - A Modular System Monitor Application Written In Rust.md rename to published/201810/20180925 Hegemon - A Modular System Monitor Application Written In Rust.md diff --git a/published/20180925 How to Boot Ubuntu 18.04 - Debian 9 Server in Rescue (Single User mode) - Emergency Mode.md b/published/201810/20180925 How to Boot Ubuntu 18.04 - Debian 9 Server in Rescue (Single User mode) - Emergency Mode.md similarity index 100% rename from published/20180925 How to Boot Ubuntu 18.04 - Debian 9 Server in Rescue (Single User mode) - Emergency Mode.md rename to published/201810/20180925 How to Boot Ubuntu 18.04 - Debian 9 Server in Rescue (Single User mode) - Emergency Mode.md diff --git a/published/20180925 How to Replace one Linux Distro With Another in Dual Boot -Guide.md b/published/201810/20180925 How to Replace one Linux Distro With Another in Dual Boot -Guide.md similarity index 100% rename from published/20180925 How to Replace one Linux Distro With Another in Dual Boot -Guide.md rename to published/201810/20180925 How to Replace one Linux Distro With Another in Dual Boot -Guide.md diff --git a/published/20180926 3 open source distributed tracing tools.md b/published/201810/20180926 3 open source distributed tracing tools.md similarity index 100% rename from published/20180926 3 open source distributed tracing tools.md rename to published/201810/20180926 3 open source distributed tracing tools.md diff --git a/published/20180926 An introduction to swap space on Linux systems.md b/published/201810/20180926 An introduction to swap space on Linux systems.md similarity index 100% rename from published/20180926 An introduction to swap space on Linux systems.md rename to published/201810/20180926 An introduction to swap space on Linux systems.md diff --git a/published/20180926 CPU Power Manager - Control And Manage CPU Frequency In Linux.md b/published/201810/20180926 CPU Power Manager - Control And Manage CPU Frequency In Linux.md similarity index 100% rename from published/20180926 CPU Power Manager - Control And Manage CPU Frequency In Linux.md rename to published/201810/20180926 CPU Power Manager - Control And Manage CPU Frequency In Linux.md diff --git a/published/20180926 How to use the Scikit-learn Python library for data science projects.md b/published/201810/20180926 How to use the Scikit-learn Python library for data science projects.md similarity index 100% rename from published/20180926 How to use the Scikit-learn Python library for data science projects.md rename to published/201810/20180926 How to use the Scikit-learn Python library for data science projects.md diff --git a/published/20180927 5 cool tiling window managers.md b/published/201810/20180927 5 cool tiling window managers.md similarity index 100% rename from published/20180927 5 cool tiling window managers.md rename to published/201810/20180927 5 cool tiling window managers.md diff --git a/published/20180927 How To Find And Delete Duplicate Files In Linux.md b/published/201810/20180927 How To Find And Delete Duplicate Files In Linux.md similarity index 100% rename from published/20180927 How To Find And Delete Duplicate Files In Linux.md rename to published/201810/20180927 How To Find And Delete Duplicate Files In Linux.md diff --git a/published/20180927 How to Use RAR files in Ubuntu Linux.md b/published/201810/20180927 How to Use RAR files in Ubuntu Linux.md similarity index 100% rename from published/20180927 How to Use RAR files in Ubuntu Linux.md rename to published/201810/20180927 How to Use RAR files in Ubuntu Linux.md diff --git a/published/20180928 10 handy Bash aliases for Linux.md b/published/201810/20180928 10 handy Bash aliases for Linux.md similarity index 100% rename from published/20180928 10 handy Bash aliases for Linux.md rename to published/201810/20180928 10 handy Bash aliases for Linux.md diff --git a/published/20180928 A Free And Secure Online PDF Conversion Suite.md b/published/201810/20180928 A Free And Secure Online PDF Conversion Suite.md similarity index 100% rename from published/20180928 A Free And Secure Online PDF Conversion Suite.md rename to published/201810/20180928 A Free And Secure Online PDF Conversion Suite.md diff --git a/published/20180928 How to Install Popcorn Time on Ubuntu 18.04 and Other Linux Distributions.md b/published/201810/20180928 How to Install Popcorn Time on Ubuntu 18.04 and Other Linux Distributions.md similarity index 100% rename from published/20180928 How to Install Popcorn Time on Ubuntu 18.04 and Other Linux Distributions.md rename to published/201810/20180928 How to Install Popcorn Time on Ubuntu 18.04 and Other Linux Distributions.md diff --git a/published/20180930 Creator of the World Wide Web is Creating a New Decentralized Web.md b/published/201810/20180930 Creator of the World Wide Web is Creating a New Decentralized Web.md similarity index 100% rename from published/20180930 Creator of the World Wide Web is Creating a New Decentralized Web.md rename to published/201810/20180930 Creator of the World Wide Web is Creating a New Decentralized Web.md diff --git a/published/20181001 16 iptables tips and tricks for sysadmins.md b/published/201810/20181001 16 iptables tips and tricks for sysadmins.md similarity index 100% rename from published/20181001 16 iptables tips and tricks for sysadmins.md rename to published/201810/20181001 16 iptables tips and tricks for sysadmins.md diff --git a/published/20181001 How to Install Pip on Ubuntu.md b/published/201810/20181001 How to Install Pip on Ubuntu.md similarity index 100% rename from published/20181001 How to Install Pip on Ubuntu.md rename to published/201810/20181001 How to Install Pip on Ubuntu.md diff --git a/published/20181002 How use SSH and SFTP protocols on your home network.md b/published/201810/20181002 How use SSH and SFTP protocols on your home network.md similarity index 100% rename from published/20181002 How use SSH and SFTP protocols on your home network.md rename to published/201810/20181002 How use SSH and SFTP protocols on your home network.md diff --git a/published/20181003 Introducing Swift on Fedora.md b/published/201810/20181003 Introducing Swift on Fedora.md similarity index 100% rename from published/20181003 Introducing Swift on Fedora.md rename to published/201810/20181003 Introducing Swift on Fedora.md diff --git a/published/20181003 Tips for listing files with ls at the Linux command line.md b/published/201810/20181003 Tips for listing files with ls at the Linux command line.md similarity index 100% rename from published/20181003 Tips for listing files with ls at the Linux command line.md rename to published/201810/20181003 Tips for listing files with ls at the Linux command line.md diff --git a/published/20181004 PyTorch 1.0 Preview Release- Facebook-s newest Open Source AI.md b/published/201810/20181004 PyTorch 1.0 Preview Release- Facebook-s newest Open Source AI.md similarity index 100% rename from published/20181004 PyTorch 1.0 Preview Release- Facebook-s newest Open Source AI.md rename to published/201810/20181004 PyTorch 1.0 Preview Release- Facebook-s newest Open Source AI.md diff --git a/published/20181005 Open Source Logging Tools for Linux.md b/published/201810/20181005 Open Source Logging Tools for Linux.md similarity index 100% rename from published/20181005 Open Source Logging Tools for Linux.md rename to published/201810/20181005 Open Source Logging Tools for Linux.md diff --git a/published/20181008 Python at the pump- A script for filling your gas tank.md b/published/201810/20181008 Python at the pump- A script for filling your gas tank.md similarity index 100% rename from published/20181008 Python at the pump- A script for filling your gas tank.md rename to published/201810/20181008 Python at the pump- A script for filling your gas tank.md diff --git a/published/20181009 6 Commands To Shutdown And Reboot The Linux System From Terminal.md b/published/201810/20181009 6 Commands To Shutdown And Reboot The Linux System From Terminal.md similarity index 100% rename from published/20181009 6 Commands To Shutdown And Reboot The Linux System From Terminal.md rename to published/201810/20181009 6 Commands To Shutdown And Reboot The Linux System From Terminal.md diff --git a/published/20181009 Convert Screenshots of Equations into LaTeX Instantly With This Nifty Tool.md b/published/201810/20181009 Convert Screenshots of Equations into LaTeX Instantly With This Nifty Tool.md similarity index 100% rename from published/20181009 Convert Screenshots of Equations into LaTeX Instantly With This Nifty Tool.md rename to published/201810/20181009 Convert Screenshots of Equations into LaTeX Instantly With This Nifty Tool.md diff --git a/published/20181009 How To Create And Maintain Your Own Man Pages.md b/published/201810/20181009 How To Create And Maintain Your Own Man Pages.md similarity index 100% rename from published/20181009 How To Create And Maintain Your Own Man Pages.md rename to published/201810/20181009 How To Create And Maintain Your Own Man Pages.md diff --git a/published/20181010 Cloc - Count The Lines Of Source Code In Many Programming Languages.md b/published/201810/20181010 Cloc - Count The Lines Of Source Code In Many Programming Languages.md similarity index 100% rename from published/20181010 Cloc - Count The Lines Of Source Code In Many Programming Languages.md rename to published/201810/20181010 Cloc - Count The Lines Of Source Code In Many Programming Languages.md diff --git a/published/20181010 Design faster web pages, part 1- Image compression.md b/published/201810/20181010 Design faster web pages, part 1- Image compression.md similarity index 100% rename from published/20181010 Design faster web pages, part 1- Image compression.md rename to published/201810/20181010 Design faster web pages, part 1- Image compression.md diff --git a/published/20181010 How To List The Enabled-Active Repositories In Linux.md b/published/201810/20181010 How To List The Enabled-Active Repositories In Linux.md similarity index 100% rename from published/20181010 How To List The Enabled-Active Repositories In Linux.md rename to published/201810/20181010 How To List The Enabled-Active Repositories In Linux.md diff --git a/published/20181011 A Front-end For Popular Package Managers.md b/published/201810/20181011 A Front-end For Popular Package Managers.md similarity index 100% rename from published/20181011 A Front-end For Popular Package Managers.md rename to published/201810/20181011 A Front-end For Popular Package Managers.md diff --git a/published/20181011 Getting started with Minikube- Kubernetes on your laptop.md b/published/201810/20181011 Getting started with Minikube- Kubernetes on your laptop.md similarity index 100% rename from published/20181011 Getting started with Minikube- Kubernetes on your laptop.md rename to published/201810/20181011 Getting started with Minikube- Kubernetes on your laptop.md diff --git a/published/20181012 Command line quick tips- Reading files different ways.md b/published/201810/20181012 Command line quick tips- Reading files different ways.md similarity index 100% rename from published/20181012 Command line quick tips- Reading files different ways.md rename to published/201810/20181012 Command line quick tips- Reading files different ways.md diff --git a/published/20181012 Happy birthday, KDE- 11 applications you never knew existed.md b/published/201810/20181012 Happy birthday, KDE- 11 applications you never knew existed.md similarity index 100% rename from published/20181012 Happy birthday, KDE- 11 applications you never knew existed.md rename to published/201810/20181012 Happy birthday, KDE- 11 applications you never knew existed.md diff --git a/published/20181012 How To Lock Virtual Console Sessions On Linux.md b/published/201810/20181012 How To Lock Virtual Console Sessions On Linux.md similarity index 100% rename from published/20181012 How To Lock Virtual Console Sessions On Linux.md rename to published/201810/20181012 How To Lock Virtual Console Sessions On Linux.md diff --git a/published/20181013 How to Install GRUB on Arch Linux (UEFI).md b/published/201810/20181013 How to Install GRUB on Arch Linux (UEFI).md similarity index 100% rename from published/20181013 How to Install GRUB on Arch Linux (UEFI).md rename to published/201810/20181013 How to Install GRUB on Arch Linux (UEFI).md diff --git a/published/20181015 How To Browse And Read Entire Arch Wiki As Linux Man Pages.md b/published/201810/20181015 How To Browse And Read Entire Arch Wiki As Linux Man Pages.md similarity index 100% rename from published/20181015 How To Browse And Read Entire Arch Wiki As Linux Man Pages.md rename to published/201810/20181015 How To Browse And Read Entire Arch Wiki As Linux Man Pages.md diff --git a/published/20181015 Running Linux containers as a non-root with Podman.md b/published/201810/20181015 Running Linux containers as a non-root with Podman.md similarity index 100% rename from published/20181015 Running Linux containers as a non-root with Podman.md rename to published/201810/20181015 Running Linux containers as a non-root with Podman.md diff --git a/published/20181016 Turn Your Old PC into a Retrogaming Console with Lakka Linux.md b/published/201810/20181016 Turn Your Old PC into a Retrogaming Console with Lakka Linux.md similarity index 100% rename from published/20181016 Turn Your Old PC into a Retrogaming Console with Lakka Linux.md rename to published/201810/20181016 Turn Your Old PC into a Retrogaming Console with Lakka Linux.md diff --git a/published/20181018 MidnightBSD Hits 1.0- Checkout What-s New.md b/published/201810/20181018 MidnightBSD Hits 1.0- Checkout What-s New.md similarity index 100% rename from published/20181018 MidnightBSD Hits 1.0- Checkout What-s New.md rename to published/201810/20181018 MidnightBSD Hits 1.0- Checkout What-s New.md diff --git a/published/20181018 Understanding Linux Links- Part 1.md b/published/201810/20181018 Understanding Linux Links- Part 1.md similarity index 100% rename from published/20181018 Understanding Linux Links- Part 1.md rename to published/201810/20181018 Understanding Linux Links- Part 1.md diff --git a/published/201810/20181019 How to use Pandoc to produce a research paper.md b/published/201810/20181019 How to use Pandoc to produce a research paper.md new file mode 100644 index 0000000000..3ccbc8df1c --- /dev/null +++ b/published/201810/20181019 How to use Pandoc to produce a research paper.md @@ -0,0 +1,335 @@ +用 Pandoc 生成一篇调研论文 +====== + +> 学习如何用 Markdown 管理章节引用、图像、表格以及更多。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_paperclips.png?itok=j48op49T) + +这篇文章对于使用 [Markdown][1] 语法做一篇调研论文进行了一个深度体验。覆盖了如何创建和引用章节、图像(用 Markdown 和 [LaTeX][2])和参考书目。我们也讨论了一些棘手的案例和为什么使用 LaTex 是一个正确的做法。 + +### 调研 + +调研论文一般包括对章节、图像、表格和参考书目的引用。[Pandoc][3] 本身并不能交叉引用这些,但是它能够利用 [pandoc-crossref][4] 过滤器来完成自动编号和章节、图像、表格的交叉引用。 + +让我们从重写原本以 LaTax 撰写的 [一个教育调研报告的例子][5] 开始,然后用 Markdown(和一些 LaTax)、Pandoc 和 Pandoc-crossref 重写。 + +#### 添加并引用章节 + +要想章节被自动编号,必须使用 Markdown H1 标题编写。子章节使用 H2-H4 子标题编写(通常不需要更多级别了)。例如一个章节的标题是 “Implementation”,写作 `# Implementation {#sec: implementation}`,然后 Pandoc 会把它转化为 `3. Implementation `(或者转换为相应的章节编号)。`Implementation` 这个标题使用了 H1 并且声明了一个 `{#sec: implementation}` 的标签,这是作者用于引用该章节的标签。要想引用一个章节,输入 `@` 符号并跟上对应章节标签,使用方括号括起来即可: `[@ sec:implementation]` + +[在这篇论文中][5], 我们发现了下面这个例子: + +``` +we lack experience (consistency between TAs, [@sec:implementation]). +``` + +Pandoc 转换: + +``` +we lack experience (consistency between TAs, Section 4). +``` + +章节被自动编号(这在本文最后的 `Makefile` 当中说明)。要创建无编号的章节,输入章节的标题并在最后添加 `{-}`。例如:`### Designing a game for maintainability {-}` 就以标题 “Designing a game for maintainability”,创建了一个无标号的章节。 + +#### 添加并引用图像 + +添加并引用一个图像,跟添加并引用一个章节和添加一个 Markdown 图片很相似: + +``` +![Scatterplot matrix](data/scatterplots/RScatterplotMatrix2.png){#fig:scatter-matrix} +``` + +上面这一行是告诉 Pandoc,有一个标有 Scatterplot matrix 的图像以及这张图片路径是 `data/scatterplots/RScatterplotMatrix2.png`。`{#fig:scatter-matrix}` 表明了用于引用该图像的名字。 + +这里是从一篇论文中进行图像引用的例子: + +``` +The boxes "Enjoy", "Grade" and "Motivation" ([@fig:scatter-matrix]) ... +``` + +Pandoc 产生如下输出: + +``` +The boxes "Enjoy", "Grade" and "Motivation" (Fig. 1) ... +``` + +#### 添加及引用参考书目 + +大多数调研报告都把引用放在一个 BibTeX 的数据库文件中。在这个例子中,该文件被命名为 [biblio.bib][6],它包含了论文中所有的引用。下面是这个文件的样子: + +``` +@inproceedings{wrigstad2017mastery, + Author = {Wrigstad, Tobias and Castegren, Elias}, + Booktitle = {SPLASH-E}, + Title = {Mastery Learning-Like Teaching with Achievements}, + Year = 2017 +} + +@inproceedings{review-gamification-framework, + Author = {A. Mora and D. Riera and C. Gonzalez and J. Arnedo-Moreno}, + Publisher = {IEEE}, + Booktitle = {2015 7th International Conference on Games and Virtual Worlds + for Serious Applications (VS-Games)}, + Doi = {10.1109/VS-GAMES.2015.7295760}, + Keywords = {formal specification;serious games (computing);design + framework;formal design process;game components;game design + elements;gamification design frameworks;gamification-based + solutions;Bibliographies;Context;Design + methodology;Ethics;Games;Proposals}, + Month = {Sept}, + Pages = {1-8}, + Title = {A Literature Review of Gamification Design Frameworks}, + Year = 2015, + Bdsk-Url-1 = {http://dx.doi.org/10.1109/VS-GAMES.2015.7295760} +} + +... +``` + +第一行的 `@inproceedings{wrigstad2017mastery,` 表明了出版物 的类型(`inproceedings`),以及用来指向那篇论文的标签(`wrigstad2017mastery`)。 + +引用这篇题为 “Mastery Learning-Like Teaching with Achievements” 的论文, 输入: + +``` +the achievement-driven learning methodology [@wrigstad2017mastery] +``` + +Pandoc 将会输出: + +``` +the achievement- driven learning methodology [30] +``` + +这篇论文将会产生像下面这样被标号的参考书目: + +![](https://opensource.com/sites/default/files/uploads/bibliography-example_0.png) + +引用文章的集合也很容易:只要引用使用分号 `;` 分隔开被标记的参考文献就可以了。如果一个引用有两个标签 —— 例如: `SEABORN201514` 和 `gamification-leaderboard-benefits`—— 像下面这样把它们放在一起引用: + +``` +Thus, the most important benefit is its potential to increase students' motivation +and engagement [@SEABORN201514;@gamification-leaderboard-benefits]. +``` + +Pandoc 将会产生: + +``` +Thus, the most important benefit is its potential to increase students’ motivation +and engagement [26, 28] +``` + +### 问题案例 + +一个常见的问题是所需项目与页面不匹配。不匹配的部分会自动移动到它们认为合适的地方,即便这些位置并不是读者期望看到的位置。因此在图像或者表格接近于它们被提及的地方时,我们需要调节一下那些元素放置的位置,使得它们更加易于阅读。为了达到这个效果,我建议使用 `figure` 这个 LaTeX 环境参数,它可以让用户控制图像的位置。 + +我们看一个上面提到的图像的例子: + +``` +![Scatterplot matrix](data/scatterplots/RScatterplotMatrix2.png){#fig:scatter-matrix} +``` + +然后使用 LaTeX 重写: + +``` +\begin{figure}[t] +\includegraphics{data/scatterplots/RScatterplotMatrix2.png} +\caption{\label{fig:matrix}Scatterplot matrix} +\end{figure} +``` + +在 LaTeX 中,`figure` 环境参数中的 `[t]` 选项表示这张图用该位于该页的最顶部。有关更多选项,参阅 [LaTex/Floats, Figures, and Captions][7] 这篇 Wikibooks 的文章。 + +### 产生一篇论文 + +到目前为止,我们讲了如何添加和引用(子)章节、图像和参考书目,现在让我们重温一下如何生成一篇 PDF 格式的论文。要生成 PDF,我们将使用 Pandoc 生成一篇可以被构建成最终 PDF 的 LaTeX 文件。我们还会讨论如何以 LaTeX,使用一套自定义的模板和元信息文件生成一篇调研论文,以及如何将 LaTeX 文档编译为最终的 PDF 格式。 + +很多会议都提供了一个 .cls 文件或者一套论文应有样式的模板;例如,它们是否应该使用两列的格式以及其它的设计风格。在我们的例子中,会议提供了一个名为 `acmart.cls` 的文件。 + +作者通常想要在他们的论文中包含他们所属的机构,然而,这个选项并没有包含在默认的 Pandoc 的 LaTeX 模板(注意,可以通过输入 `pandoc -D latex` 来查看 Pandoc 模板)当中。要包含这个内容,找一个 Pandoc 默认的 LaTeX 模板,并添加一些新的内容。将这个模板像下面这样复制进一个名为 `mytemplate.tex` 的文件中: + +``` +pandoc -D latex > mytemplate.tex +``` + +默认的模板包含以下代码: + +``` +$if(author)$ +\author{$for(author)$$author$$sep$ \and $endfor$} +$endif$ +$if(institute)$ +\providecommand{\institute}[1]{} +\institute{$for(institute)$$institute$$sep$ \and $endfor$} +$endif$ +``` + +因为这个模板应该包含作者的联系方式和电子邮件地址,在其他一些选项之间,我们更新这个模板以添加以下内容(我们还做了一些其他的更改,但是因为文件的长度,就没有包含在此处): + +``` +latex +$for(author)$ + $if(author.name)$ + \author{$author.name$} + $if(author.affiliation)$ + \affiliation{\institution{$author.affiliation$}} + $endif$ + $if(author.email)$ + \email{$author.email$} + $endif$ + $else$ + $author$ + $endif$ +$endfor$ +``` +要让这些更改起作用,我们还应该有下面的文件: + +* `main.md` 包含调研论文 +* `biblio.bib` 包含参考书目数据库 +* `acmart.cls` 我们使用的文档的集合 +* `mytemplate.tex` 是我们使用的模板文件(代替默认的) + +让我们添加论文的元信息到一个 `meta.yaml` 文件: + +``` +--- +template: 'mytemplate.tex' +documentclass: acmart +classoption: sigconf +title: The impact of opt-in gamification on `\\`{=latex} students' grades in a software design course +author: +- name: Kiko Fernandez-Reyes +  affiliation: Uppsala University +  email: kiko.fernandez@it.uu.se +- name: Dave Clarke +  affiliation: Uppsala University +  email: dave.clarke@it.uu.se +- name: Janina Hornbach +  affiliation: Uppsala University +  email: janina.hornbach@fek.uu.se +bibliography: biblio.bib +abstract: | +  An achievement-driven methodology strives to give students more control over their learning with enough flexibility to engage them in deeper learning. (more stuff continues) + +include-before: | +   \` ``{=latex} +   \copyrightyear{2018} +   \acmYear{2018} +   \setcopyright{acmlicensed} +   \acmConference[MODELS '18 Companion]{ACM/IEEE 21th International Conference on Model Driven Engineering Languages and Systems}{October 14--19, 2018}{Copenhagen, Denmark} +   \acmBooktitle{ACM/IEEE 21th International Conference on Model Driven Engineering Languages and Systems (MODELS '18 Companion), October 14--19, 2018, Copenhagen, Denmark} +   \acmPrice{XX.XX} +   \acmDOI{10.1145/3270112.3270118} +   \acmISBN{978-1-4503-5965-8/18/10} + +   \begin{CCSXML} +   +   +   10010405.10010489 +   Applied computing~Education +   500 +   +   +   \end{CCSXML} + +   \ccsdesc[500]{Applied computing~Education} + +   \keywords{gamification, education, software design, UML} +   \` `` +figPrefix: +  - "Fig." +  - "Figs." +secPrefix: +  - "Section" +  - "Sections" +... +``` + +这个元信息文件使用 LaTeX 设置下列参数: + +* `template` 指向使用的模板(`mytemplate.tex`) +* `documentclass` 指向使用的 LaTeX 文档集合(`acmart`) +* `classoption` 是在 `sigconf` 的案例中,指向这个类的选项 +* `title` 指定论文的标题 +* `author` 是一个包含例如 `name`、`affiliation` 和 `email` 的地方 +* `bibliography` 指向包含参考书目的文件(`biblio.bib`) +* `abstract` 包含论文的摘要 +* `include-before` 是这篇论文的具体内容之前应该被包含的信息;在 LaTeX 中被称为 [前言][8]。我在这里包含它去展示如何产生一篇计算机科学的论文,但是你可以选择跳过 +* `figPrefix` 指向如何引用文档中的图像,例如:当引用图像的 `[@fig:scatter-matrix]` 时应该显示什么。例如,当前的 `figPrefix` 在这个例子 `The boxes "Enjoy", "Grade" and "Motivation" ([@fig:scatter-matrix])`中,产生了这样的输出:`The boxes "Enjoy", "Grade" and "Motivation" (Fig. 3)`。如果这里有很多图像,目前的设置表明它应该在图像号码旁边显示 `Figs.` +* `secPrefix` 指定如何引用文档中其他地方提到的部分(类似之前的图像和概览) + +现在已经设置好了元信息,让我们来创建一个 `Makefile`,它会产生你想要的输出。`Makefile` 使用 Pandoc 产生 LaTeX 文件,`pandoc-crossref` 产生交叉引用,`pdflatex` 构建 LaTeX 为 PDF,`bibtex ` 处理引用。 + + +`Makefile` 已经展示如下: + +``` +all: paper + +paper: +        @pandoc -s -F pandoc-crossref --natbib meta.yaml --template=mytemplate.tex -N \ +         -f markdown -t latex+raw_tex+tex_math_dollars+citations -o main.tex main.md +        @pdflatex main.tex &> /dev/null +        @bibtex main &> /dev/null +        @pdflatex main.tex &> /dev/null +        @pdflatex main.tex &> /dev/null + +clean: +        rm main.aux main.tex main.log main.bbl main.blg main.out + +.PHONY: all clean paper +``` + +Pandoc 使用下面的标记: + +* `-s` 创建一个独立的 LaTeX 文档 +* `-F pandoc-crossref` 利用 `pandoc-crossref` 进行过滤 +* `--natbib` 用 `natbib` (你也可以选择 `--biblatex`)对参考书目进行渲染 +* `--template` 设置使用的模板文件 +* `-N` 为章节的标题编号 +* `-f` 和 `-t` 指定从哪个格式转换到哪个格式。`-t` 通常包含格式和 Pandoc 使用的扩展。在这个例子中,我们标明的 `raw_tex+tex_math_dollars+citations` 允许在 Markdown 中使用 `raw_tex` LaTeX。 `tex_math_dollars` 让我们能够像在 LaTeX 中一样输入数学符号,`citations` 让我们可以使用 [这个扩展][9]。 + +要从 LaTeX 产生 PDF,按 [来自bibtex][10] 的指导处理参考书目: + +``` +@pdflatex main.tex &> /dev/null +@bibtex main &> /dev/null +@pdflatex main.tex &> /dev/null +@pdflatex main.tex &> /dev/null +``` + +脚本用 `@` 忽略输出,并且重定向标准输出和错误到 `/dev/null` ,因此我们在使用这些命令的可执行文件时不会看到任何的输出。 + +最终的结果展示如下。这篇文章的库可以在 [GitHub][11] 找到: + +![](https://opensource.com/sites/default/files/uploads/abstract-image.png) + +### 结论 + +在我看来,研究的重点是协作、思想的传播,以及在任何一个恰好存在的领域中改进现有的技术。许多计算机科学家和工程师使用 LaTeX 文档系统来写论文,它对数学提供了完美的支持。来自社会科学的研究人员似乎更喜欢 DOCX 文档。 + +当身处不同社区的研究人员一同写一篇论文时,他们首先应该讨论一下他们将要使用哪种格式。然而如果包含太多的数学符号,DOCX 对于工程师来说不会是最简便的选择,LaTeX 对于缺乏编程经验的研究人员来说也有一些问题。就像这篇文章中展示的,Markdown 是一门工程师和社会科学家都很轻易能够使用的语言。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/9/pandoc-research-paper + +作者:[Kiko Fernandez-Reyes][a] +选题:[lujun9972][b] +译者:[dianbanjiu](https://github.com/dianbanjiu) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/kikofernandez +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Markdown +[2]: https://www.latex-project.org/ +[3]: https://pandoc.org/ +[4]: http://lierdakil.github.io/pandoc-crossref/ +[5]: https://dl.acm.org/citation.cfm?id=3270118 +[6]: https://github.com/kikofernandez/pandoc-examples/blob/master/research-paper/biblio.bib +[7]: https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures +[8]: https://www.sharelatex.com/learn/latex/Creating_a_document_in_LaTeX#The_preamble_of_a_document +[9]: http://pandoc.org/MANUAL.html#citations +[10]: http://www.bibtex.org/Using/ +[11]: https://github.com/kikofernandez/pandoc-examples/tree/master/research-paper