all-contributors / all-contributors/cli

make the bot work with rst files

Đang mở
#300 10 bình luận 0 reaction 1 người được giao Được @tenshiAMD nhận Xem trên GitHub
pinned priority: high status: available type: enhancement
Ngôn ngữ chính
JavaScript
Star
425
Fork
149
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Is your feature request related to a problem? Please describe.**
I use the following json file to pilot he all-contributor bot :

```json
{
"files": [
"AUTHORS.rst"
],
"imageSize": 100,
"contributorsPerLine": 7,
"contributorsSortAlphabetically": false,
"badgeTemplate": "-orange.svg?style=flat-square\" alt=\"All contributors\">",
"contributorTemplate": "\">\" width=\"<%= options.imageSize %>px;\" alt=\"\"/>
<%= contributor.name %>
",
"skipCi": true,
"contributors": [
{
"login": "12rambau",
"name": "Rambaud Pierrick",
"avatar_url": "https://avatars.githubusercontent.com/u/12596392?v=4",
"profile": "https://12rambau.github.io/web-resume/",
"contributions": [
"code",
"ideas",
"question",
"doc",
"maintenance",
"review"
]
}
],
"projectName": "sepal-doc",
"projectOwner": "openforis",
"repoType": "github",
"repoHost": "https://github.com"
}
```

and I created the following AUTHOR.rst file to specify the placement of the final table elements :
```rst
Thanks goes to these wonderful people (`emoji key `_):

.. raw:: html



All contributors

.. raw:: html







Rambaud Pierrick



This project follows the `all-contributors `_ specification.
Contributions of any kind are welcome!
```

But when I launch the bot, the indentation change and the file is broken. In short, .rst files are snesible to indentation inside the `raw` directive and the bot is always rewritting from to very left without identation ending up breaking the rst file.

**Describe the solution you'd like**
So the problem is indentation, and it would be nothing to change :

in the CLI tools (https://github.com/all-contributors/all-contributors-cli/blob/e9c1f55beb2c18391a5d5f0c9e8243dc3f89ebe3/src/generate/index.js#L7) we parse the text and search for the starting point of the table.
To be working with RST, the code should detect the indentation of this message (`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.