From 381bff129b70471e86e99a2d6b6a7e090f13287e Mon Sep 17 00:00:00 2001 From: Jefferson Julio Date: Sun, 30 May 2021 22:53:32 -0300 Subject: Better article parsing, support for article code parsing (add line numbers to code blocks) --- utils/parse-article.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/parse-article.sh') diff --git a/utils/parse-article.sh b/utils/parse-article.sh index c3e540a..b64c0ff 100755 --- a/utils/parse-article.sh +++ b/utils/parse-article.sh @@ -1,6 +1,7 @@ #!/bin/bash ARTICLE_TITLE=$(basename "$ARTICLE_FILE") +ARTICLE_FILE_SANITIZED="$(sanitize-filename "$ARTICLE_FILE")" # Pick all file content ARTICLE_FILE_CONTENT=$(cat "$ARTICLE_FILE") @@ -8,8 +9,7 @@ ARTICLE_FILE_CONTENT=$(cat "$ARTICLE_FILE") # The first 3 lines of the file are metadata information ARTICLE_METADATA=$(echo "$ARTICLE_FILE_CONTENT" | head -n 3) -# Skip file metadata, first 3 lines -ARTICLE_CONTENT=$(echo "$ARTICLE_FILE_CONTENT" | tail -n +3) +source $SCRIPT_DIR/utils/parse-article-content.sh # Tags are placed on the first line of the file, delimited by commas IFS=',' read -ra ARTICLE_TAGS <<< "$(echo "$ARTICLE_METADATA" | head -n 1)" -- cgit v1.2.3