Skip to content

Commit

Permalink
feat(m2r): use m2r to convert automatic .md files to .rst
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Mar 3, 2019
1 parent 1a26fdd commit f6edb65
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
language: node_js
node_js: lts/*
before_install: skip
install:
- sudo pip install m2r
script:
# Update `AUTHORS.md`
- export MAINTAINER_TOKEN=${GH_TOKEN}
Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ Welcome to template-formula's documentation!
README <README>
CONTRIBUTING
TOFS_pattern
AUTHORS
CHANGELOG
2 changes: 1 addition & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
prepareCmd: 'sh ./update_FORMULA.sh ${nextRelease.version}',
}],
['@semantic-release/git', {
assets: ['*.md', 'FORMULA'],
assets: ['*.md', 'docs/*.rst', 'FORMULA'],
}],
'@semantic-release/github',
],
Expand Down
10 changes: 10 additions & 0 deletions update_FORMULA.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
#!/bin/sh
sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA

# m2r
# pip install m2r
cp *.md docs/
cd docs/
m2r --overwrite *.md
sed -i -e '5,/^=.*$/s/=/-/g' CHANGELOG.rst
cat AUTHORS.rst
cat CHANGELOG.rst
cd ..

0 comments on commit f6edb65

Please sign in to comment.