forked from saltstack-formulas/template-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(m2r): use
m2r
to convert automatic .md
files to .rst
* https://github.com/miyakogi/m2r - Markdown to reStructuredText converter
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,3 +101,6 @@ ENV/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# copied `.md` files used for conversion to `.rst` using `m2r` | ||
docs/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,30 @@ | ||
#!/bin/sh | ||
|
||
############################################################################### | ||
# (A) Update `FORMULA` with `${nextRelease.version}` | ||
############################################################################### | ||
sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA | ||
|
||
|
||
############################################################################### | ||
# (B) Use `m2r` to convert automatically produced `.md` docs to `.rst` | ||
############################################################################### | ||
|
||
# Install `m2r` | ||
sudo -H pip install m2r | ||
|
||
# Copy and then convert the `.md` docs | ||
cp *.md docs/ | ||
cd docs/ | ||
m2r --overwrite *.md | ||
|
||
# Change excess `H1` headings to `H2` in converted `CHANGELOG.rst` | ||
sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst | ||
sed -i -e '1,4s/-/=/g' CHANGELOG.rst | ||
|
||
# Use for debugging output, when required | ||
# cat AUTHORS.rst | ||
# cat CHANGELOG.rst | ||
|
||
# Return back to the main directory | ||
cd .. |