all-contributors / all-contributors/cli

make the bot work with rst files

Open
#300 10 comments 0 reactions 1 assignee Claimed by @tenshiAMD View on GitHub
pinned priority: high status: available type: enhancement
Dominant language
JavaScript
Stars
425
Forks
149
PR merge metrics
No merged PRs in 30d

Description

**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 (`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.