codimd-to-gitlab-sync/README.md
2022-04-18 21:19:21 +00:00

45 lines
985 B
Markdown

A 'simple' collection of bash scripts that syncs CodiMD files with a certain metadata block to Gitlab
You need to put the following block somewhere in you CodiMD file.
```markdown
:::spoiler Gitlab sync
- sync-to: path/in/the/drive
:::
```
## Setup
Install the glab tool using a package manager of your choice.
Set environment variable in your shell profile:
```bash
export GITLAB_HOST=https://git.zeus.gent
export GITLAB_TOKEN_NAME=the-token-name-in-gitlab
export GITLAB_TOKEN=********
export CMD_SERVER_URL=https://codimd.zeus.gent
export CMD_EMAIL=codimd.zeus.gent@mcbloch.dev
export CMD_PASSWORD=*******
```
## TODO
- Add a way to discover new markdown files.
- Scraping Mattermost
- ? Providing an api endpoint to post an url to ?
## Used tech
- [GitLab CLI Tool](https://glab.readthedocs.io/en/latest/index.html)
- bash
- git
- curl
### References
- [CodiMD source code](https://github.com/hackmdio/codimd/tree/develop/lib). Usefull to find the api endpoints.