|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- #!/bin/sh
-
-
-
-
- sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA
-
-
-
-
-
-
-
- pip3 install m2r2
-
-
- cp ./*.md docs/
- cd docs/ || exit
- m2r2 --overwrite ./*.md
-
-
- sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst
- sed -i -e '1,4s/-/=/g' CHANGELOG.rst
-
-
-
-
-
-
- cd ..
-
-
-
-
-
-
-
-
-
- sed -i -e "/^\(version: '\).*\('\)$/s//\1${1}\2/" docs/antora.yml
-
-
- FROM=rst && FN=CHANGELOG && pandoc -t asciidoctor -f ${FROM} -o docs/modules/ROOT/pages/${FN}.adoc docs/${FN}.${FROM}
- FROM=rst && FN=AUTHORS && pandoc -t asciidoctor -f ${FROM} -o docs/modules/ROOT/pages/${FN}.adoc docs/${FN}.${FROM}
- FROM=rst && FN=README && pandoc -t asciidoctor -f ${FROM} -o docs/modules/ROOT/pages/${FN}.adoc docs/${FN}.${FROM}
-
-
- ADOC="docs/modules/ROOT/pages/CHANGELOG.adoc"
-
-
- sed -i -e '/^\(=== \)\(https.*\)\(\[.*\)\(]\)/s//\1link:++\2++\3^\4/' "${ADOC}"
-
- sed -i -e '/^\((https.*\)\(]\)/s//\1^\2/' "${ADOC}"
- sed -i -e '/^\(https.*\)\(]\)/s//\1^\2/' "${ADOC}"
-
-
- sed -i -e '\_^\((https.*/commit/\)\(.......\)\()\)$_s__\1\2[\2^]\3_' "${ADOC}"
-
- sed -i -e '/^=/s///' "${ADOC}"
-
- sed -i -e '/^\[skip ci]$/s// &/' "${ADOC}"
-
- sed -i -e '/{\w\+}/s//\\&/' "${ADOC}"
-
- sed -i -e '2 i \\n:sectnums!:' "${ADOC}"
-
-
- ADOC="docs/modules/ROOT/pages/AUTHORS.adoc"
-
- sed -i -e '/^=/s///' "${ADOC}"
-
-
- sed -i -e '/^|:raw-html-m2r/N;s/\n/ /' "${ADOC}"
- sed -i -e '/^|:raw-html-m2r/N;s/\n/ /' "${ADOC}"
- sed -i -e '/^|:raw-html-m2r/N;s/\n/ /' "${ADOC}"
-
- sed -i -e '/^|:raw-html-m2r/{G;}' "${ADOC}"
-
- sed -i -e '/^$/N;/\n$/D' "${ADOC}"
-
- sed -i -e '/^|:raw-html-m2r/s/ |/\n|/g' "${ADOC}"
-
- sed -i -e "/^\(|\):raw-html-m2r.*src='\(.*\)' width='\(.*\)' height='\(.*\)' alt='\(.*\)'.*/s//\1image::\2[\5,\3,\4]/" "${ADOC}"
-
- sed -i -e '/^|===.*/s//|===/' "${ADOC}"
-
- sed -i -e '/^|Avatar |Contributor |Contributions/s//^.^|Avatar\n<.^|Contributor\n^.^|Contributions\n/' "${ADOC}"
-
- sed -i -e '/^\[cols=".*/s//.List of contributors\n[format="psv", separator="|", options="header", cols="^.<30a,<.<40a,^.<40d", width="100"]/' "${ADOC}"
-
- sed -i -e '/^\(|https.*\)\(]\)/s//\1^\2/' "${ADOC}"
-
- sed -i -e '/\(\[forked version\)\(]\)/s//\1^\2/' "${ADOC}"
- sed -i -e '/\(\[.*maintainer\)\(]\)/s//\1^\2/' "${ADOC}"
-
-
- ADOC="docs/modules/ROOT/pages/README.adoc"
-
- sed -i -e '/^=/s///' "${ADOC}"
-
- sed -i -e '/^\[\[readme]]$/d' "${ADOC}"
-
- sed -i -e '/^\*Table of Contents\*$/,+1d' "${ADOC}"
-
-
- sed -i -e '/^Please see `How to contribute <CONTRIBUTING>` for more details.$/s//Please see\nxref:main::CONTRIBUTING.adoc[How to contribute]\nfor more details./' "${ADOC}"
-
- sed -i -e '\_https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst_s__xref:main::CONTRIBUTING.adoc_' "${ADOC}"
-
- sed -i -e '/^\* link:map.jinja.rst/s//* xref:main::map.jinja.adoc/' "${ADOC}"
-
- sed -i -e '/#special-notes/s//#_special_notes/' "${ADOC}"
-
- sed -i -e '/^\(\[source,\)sourceCode,/s//\1/' "${ADOC}"
-
- sed -i -e '/^\(\[source,jinja\)2/s//\1/' "${ADOC}"
-
- sed -i -e '/^\(\[source,\)sls/s//\1yaml/' "${ADOC}"
|