You are here

readme2html.sh in Realistic Dummy Content 3.x

Same filename and directory in other branches
  1. 8.2 scripts/readme2html.sh
#!/bin/bash
#
# Generate html from md. Useful for updating the description on Drupal.
#
set -e

docker pull dcycle/md2html:1
docker run --rm -v "$(pwd):/app/code" \
  dcycle/md2html:1 -t html5 README.md -o README.html

# If one enters <code>&gt;</code> in Drupal.org, it is erroneously
# output as <code class="language-php">&amp;gt;</code>; because we know
# that this only happens in certain contexts (")->") in our case, we can
# simply reconvert it to something which will appear correctly in
# Drupal.org.
# See https://www.drupal.org/node/3103954
# To fix it we cannot use sed because it's used differently on different
# systems, perl seems a good alternative, see
# https://stackoverflow.com/a/4247319/1207752
perl -i -pe's/&amp;&amp;/&&/g' README.html

File

scripts/readme2html.sh
View source
  1. #!/bin/bash
  2. #
  3. # Generate html from md. Useful for updating the description on Drupal.
  4. #
  5. set -e
  6. docker pull dcycle/md2html:1
  7. docker run --rm -v "$(pwd):/app/code" \
  8. dcycle/md2html:1 -t html5 README.md -o README.html
  9. # If one enters > in Drupal.org, it is erroneously
  10. # output as &gt;; because we know
  11. # that this only happens in certain contexts (")->") in our case, we can
  12. # simply reconvert it to something which will appear correctly in
  13. # Drupal.org.
  14. # See https://www.drupal.org/node/3103954
  15. # To fix it we cannot use sed because it's used differently on different
  16. # systems, perl seems a good alternative, see
  17. # https://stackoverflow.com/a/4247319/1207752
  18. perl -i -pe's/&&/&&/g' README.html