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 6d68925
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
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
4 changes: 3 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ Welcome to template-formula's documentation!
============================================

.. toctree::
:maxdepth: 3
:maxdepth: 2
:caption: Contents
:numbered:
:glob:

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
11 changes: 11 additions & 0 deletions update_FORMULA.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
#!/bin/sh
sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA

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

0 comments on commit 6d68925

Please sign in to comment.