Skip to content

Commit d29b770

Browse files
committed
init
0 parents  commit d29b770

18 files changed

+53540
-0
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: 'Bug Report(bug 提交)'
3+
about: Report a software bug on this repo.(提交本仓库的 Bug)
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug(bug 描述)**
11+
A clear and concise description of what the bug is.(用简单的语言描述 bug。)
12+
13+
**To Reproduce(复现方式)**
14+
Steps to reproduce the behavior(复现 bug 的步骤):
15+
1. Go to '...'(访问“...”)
16+
2. Click on '....'(点击“...”)
17+
3. See bug(出现 bug)
18+
4. ...
19+
20+
**Expected behavior(预期现象)**
21+
A clear and concise description of what you expected to happen.(用简单的语言描述期待看到的现象。)
22+
23+
**Screenshots(截图)**
24+
If applicable, add screenshots to help explain your problem.(可以截图辅助描述。)
25+
26+
**environment(环境)**
27+
- OS(操作系统): [e.g. iOS(例如:iOS)]
28+
- Node.js’s Version(Node.js 版本): [e.g. 12.12.12(例如:12.12.12)]
29+
30+
**Additional context(其他)**
31+
Add any other context about the problem here.(添加其他你想添加的内容)

.github/ISSUE_TEMPLATE/feature.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: 'Feature(新特性)'
3+
about: Suggest an idea for this repo.(对本仓库新功能提出建议。)
4+
title: ''
5+
labels: 'feature'
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.(遇见的问题)**
11+
A clear and concise description of what the problem is.(简单地描述问题)
12+
13+
**Describe the solution you'd like(描述想要的解决方案)**
14+
A clear and concise description of what you want to happen.(简洁地描述你想要的解决方案。)
15+
16+
**Additional context(其他)**
17+
Add any other context about the problem here.(添加其他你想添加的内容)

.github/PULL_REQUEST_TEMPLATE.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Checklist(清单):
2+
3+
<!-- Please follow this checklist and put an x in each of the boxes, like this: [x]. It will ensure that we takes your pull request seriously.(请遵循此清单,并在每个 [ ] 中输入 x,如下所示:[x]。 这将确保我们认真对待您的 pull request。) -->
4+
5+
- [ ] I have read [freeCodeCamp's contribution guidelines](https://contribute.freecodecamp.org)(我已经阅读 [freeCodeCamp 贡献指南](https://contribute.freecodecamp.org)).
6+
- [ ] My pull request has a descriptive title (not a vague title like `Update index.md`)(我的 pull request 有一个详细的标题,而不是像“添加 index.md 文件这样的粗略标题”。)
7+
- [ ] My pull request targets the `main` branch of this repo.(我的 pull rewuest 基于本仓库 `main` 分支修改。)
8+
9+
<!--If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.(如果 pull request 关闭一个 GitHub issue,请用 GitHub issue 编号替换下面的 XXXXX)-->
10+
11+
Closes #XXXXX
12+
13+
<!-- Feel free to add any additional description of changes below this line(在此行下方添加其他更改描述。) -->

.gitignore

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Microbundle cache
57+
.rpt2_cache/
58+
.rts2_cache_cjs/
59+
.rts2_cache_es/
60+
.rts2_cache_umd/
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
78+
# Next.js build output
79+
.next
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
#dist
84+
85+
# Gatsby files
86+
.cache/
87+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88+
# https://nextjs.org/blog/next-9-1#public-directory-support
89+
# public
90+
91+
# vuepress build output
92+
.vuepress/dist
93+
94+
# Serverless directories
95+
.serverless/
96+
97+
# FuseBox cache
98+
.fusebox/
99+
100+
# DynamoDB Local files
101+
.dynamodb/
102+
103+
# TernJS port file
104+
.tern-port

CHANGELOG.md

Whitespace-only changes.

CONTRIBUTING.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Our contributing docs are available here: <https://contribute.freecodecamp.org>.
2+
3+
Looking to edit these docs? Read [this document](https://contribute.freecodecamp.org/#/how-to-work-on-the-docs-theme) first.
4+
5+
---
6+
7+
## 这是我们的贡献者文档: <https://contribute.freecodecamp.org/#/i18n/chinese/index>.
8+
9+
想编辑该文档?请先阅读 [这份说明](https://contribute.freecodecamp.org/#/i18n/chinese/how-to-work-on-the-docs-theme)

LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2021, Steven Ding
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README-zh-cn.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
## article-webpage-to-markdown-action
2+
3+
![GitHub](https://img.shields.io/github/license/freeCodeCamp-China/article-webpage-to-markdown-action) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/freeCodeCamp-China/article-webpage-to-markdown-action) ![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/freeCodeCamp-China/article-webpage-to-markdown-action?include_prereleases&label=release-last)
4+
5+
语言: [English](./README.md) | 简体中文
6+
7+
### 简介
8+
9+
根据文章的网页自动生成 Markdown 文件。目前只支持 freeCodeCamp 的 news 站点。
10+
11+
#### 项目结构
12+
13+
```
14+
news-translate
15+
| action.yml /** 入口文件 **/
16+
│ package.json
17+
│ README.md
18+
19+
|-.github
20+
│ |-ISSUE_TEMPLATE
21+
│ │ AutoGenerateMarkdown.md /** 自动生成 Markdown 文件的 issue 模板 **/
22+
│ │
23+
│ |-workflows
24+
│ WebPageToMarkdown.yml /** 用于自动生成 Markdown 文件的 Actions 文件 **/
25+
26+
|-dist /** 编译后的静态文件夹 **/
27+
|
28+
|-node_modules
29+
30+
|-src
31+
|-toMarkdown
32+
| index.js /** 脚本的入口文件 **/
33+
| toMarkdownConstant.js /** 配置文件 **/
34+
| utilities.js /** 函数库文件 **/
35+
|
36+
|-__tests__
37+
utilities.test.js /** 测试文件 **/
38+
```
39+
---
40+
<h3>Usage</h3>
41+
42+
在 job 中添加下面的 step.
43+
44+
```yml
45+
- uses: freeCodeCamp-China/[email protected]
46+
with:
47+
newsLink: '${{ github.event.issue.Body }}'
48+
```
49+
50+
下面是一个扩展示例,尽可能包含所有选项。
51+
52+
```yml
53+
- uses: freeCodeCamp-China/[email protected]
54+
with:
55+
# 一个特定的格式的字符串,该字符串包含一个指向 freeCodeCamp 的News 的链接。
56+
# 格式: "原文网址:[原文标题](https://www.freecodecamp.org/news/xxxxxxx/"
57+
newsLink: '${{ github.event.issue.Body }}'
58+
# 生成 MarkDown 文件的路径
59+
# 相对命令行位置的相对路径
60+
markDownFilePath: './chinese/articles/'
61+
```
62+
63+
<h4 id="submit-an-issue">通过 GitHub 的 issue 运行脚本</h4>
64+
65+
**Issues** >> **New issue** >> 填写 issue 的标题和描述 >> **Submit new issue**
66+
67+
#### 描述(Description):
68+
```
69+
- 原文网址:[原文标题](https://www.freeCodeCamp.org/news/路由/)
70+
- MarkDown 文件:https://github.com/freeCodeCamp/news-translation/edit/master/chinese/articles/文章文件名称.md
71+
```
72+
用原文标题替换 `原文标题`,用文章的路由地址替换 `路由` 和 `文章文件名称`。
73+
74+
#### 示例:
75+
如果文章的 URL 是 `https://www.freecodecamp.org/news/Example/`,标题是 `Example Title`。
76+
77+
*标题(Title):*
78+
```
79+
[Auto]示例标题
80+
```
81+
*描述(Description):*
82+
```
83+
- 原文网址:[Example Title](https://www.freeCodeCamp.org/news/Example/)
84+
- MarkDown 文件:https://github.com/freeCodeCamp/news-translation/edit/master/chinese/articles/Example.md
85+
```
86+
87+
可以通过检查 **Actions** 的执行结果,以确认脚本是否成功执行。或者在选项 `markDownFilePath` 中设置的位置检查文件是否存在。 如果未配置选项`markDownFilePath`,则默认情况下会在当前路径中生成文件。
88+
89+
如果脚本执行**失败**,您需要确认问题,解决问题,然后根据前面的步骤发布**新 issue**。 [*常见错误消息*](#CommonErrorMessages) 和 *Actions 的日志* 将为您提供一些可靠的提示。
90+
91+
<h3 id="CommonErrorMessages">常见错误消息</h3>
92+
93+
- **No parameters were found. Please confirm that the description of the issue has been entered.**
94+
issue 的描述为空,请根据模板填写内容。
95+
- **The route to the article is not matched. Please confirm that the URL is correct.**
96+
在 issue 的描述中,只需要替换 `原文标题`, `路由` 和 `文章文件名称` 即可,并且请保留其他字符。
97+
- **There is one file with the same name exists.Please check if the article has been added.**
98+
在 `./chinese/articles` 文件夹下有一个同名文件。
99+
- **The DOM of the website has been modified, or there is a problem with loading, please confirm.**
100+
网站的 DOM 结构可能更改,并且脚本需要修改。
101+
102+
---
103+
104+
## 贡献者指南
105+
106+
请转到[贡献者指南](CONTRIBUTING.md)。
107+
108+
---
109+
110+
### 许可证
111+
112+
- 程序遵循 [BSD-3-Clause](LICENSE) 许可证。

0 commit comments

Comments
 (0)