Last active
March 1, 2020 03:57
-
-
Save capsulecorplab/8a160faed0006c0766eca2701b0cf0e9 to your computer and use it in GitHub Desktop.
bash script for converting multiple (GitHub flavored) markdown to asciidoc files
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
2.4.5 |
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
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
# gem "rails" | |
gem "kramdown-asciidoc", "~> 1.0" |
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
GEM | |
remote: https://rubygems.org/ | |
specs: | |
kramdown (1.17.0) | |
kramdown-asciidoc (1.0.1) | |
kramdown (~> 1.17.0) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
kramdown-asciidoc (~> 1.0) | |
BUNDLED WITH | |
2.1.4 |
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
#!/usr/bin/env bash | |
############################################################################### | |
# bash script for converting multiple (GH-flavored) markdown to asciidoc files. | |
# Inspired by | |
# https://matthewsetter.com/convert-markdown-to-asciidoc-with-kramdown-asciidoc | |
# | |
# Requirements: | |
# * Ruby 2.4+ (2.4.5 recommended) | |
# * bundler 2.1.4 | |
# | |
# Usage: | |
# $ ./md_to_adoc.sh | |
############################################################################### | |
if ! command -v gem 1>/dev/null 2>&1; then | |
echo "Ruby not installed! To install ruby using rbenv, please refer to https://gist.github.com/aa4c5a8167509b94ac43405f99bc9ffd" | |
elif ! command -v bundler 1>/dev/null 2>&1; then | |
echo "bundler not installed!, please run: | |
gem install bundler:2.1.4" | |
elif ! command -v kramdoc 1>/dev/null 2>&1; then | |
echo "kramdoc not installed!, please run: | |
bundle install" | |
fi | |
find . -name "*.md" -type f -exec sh -c 'kramdoc --format=GFM --wrap=ventilate {}' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment