Last active
November 9, 2019 11:29
-
-
Save nabinno/797f20072b19ca7190003c15b43fd716 to your computer and use it in GitHub Desktop.
Generate markdown files from titles.
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 | |
set -e | |
generateContent() { | |
local tags="$1" | |
local title="$2" | |
cat <<EOF | |
--- | |
title: ${title} | |
tags: ${tags} | |
url: | |
--- | |
EOF | |
} | |
convertToSnakeCase() { | |
local string="$1" | |
echo "${string}" | | |
tr '[:upper:]' '[:lower:]' | | |
sed -r 's/(\(|\))//g' | | |
sed -r 's/( )([a-z0-9])/_\2/g' | |
} | |
while read TAGS TITLE; do | |
generateContent "${TAGS}" "${TITLE}" >"$(convertToSnakeCase "${TITLE}").md" | |
done <title.tsv |
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
python,database | Big Data Fundamentals via PySpark | |
---|---|---|
python,database | Building Recommendation Engines with PySpark | |
python,database | Data Types for Data Science | |
python,database | Feature Engineering with PySpark |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment