diff --git a/.github/workflows/announcements.yml b/.github/workflows/announcements.yml new file mode 100644 index 00000000..7d712e73 --- /dev/null +++ b/.github/workflows/announcements.yml @@ -0,0 +1,67 @@ +name: Publish Blog Post to Telegram/Discord +on: + pull_request: + branches: [announcements] + types: [closed] + paths: + - "announcements/*.md" +jobs: + publish: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y jq curl pandoc + + - name: Identify Markdown Files + id: files + run: | + base_sha=${{ github.event.pull_request.base.sha }} + head_sha=${{ github.event.pull_request.head.sha }} + git fetch origin $base_sha + git fetch origin $head_sha + files=$(git diff --name-only --diff-filter=A "$base_sha" "$head_sha" -- 'announcements/*.md') + files_comma_separated=$(echo "$files" | tr '\n' ',') + echo "Changed Markdown Files: $files_comma_separated" + echo "::set-output name=markdown_files::$files_comma_separated" + + - name: Publish to Telegram/Discord + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} + run: | + IFS=',' read -ra files_arr <<< "${{ steps.files.outputs.markdown_files }}" + for file in "${files_arr[@]}"; do + # Skip empty strings which may occur if there's a trailing comma + [ -z "$file" ] && continue + echo "Processing file: $file" + + pandoc -f markdown -t plain "$file" -o "$file.txt" + content=$(cat "$file.txt") + + response=$(curl -s -w "HTTPSTATUS:%{http_code}" -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \ + -d chat_id="${TELEGRAM_TO}" -d text="$content" -d parse_mode="Markdown") + http_status=$(echo "$response" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + if [ "$http_status" -ne 200 ] && [ "$http_status" -ne 204 ]; then + echo "Error sending to Telegram. HTTP Status: $http_status" + exit 1 + fi + + # Escape content for Discord JSON payload + escaped_content=$(echo "$content" | jq -Rs .) + + response=$(curl -s -w "HTTPSTATUS:%{http_code}" -X POST -H "Content-Type: application/json" \ + -d "{\"content\": $escaped_content}" https://discord.com/api/webhooks/1155501986532307056/POOHKkxip-2n4NA3Fe7ye1iPhrKeEwZOHiU2CSWCRt7TYv1uxvriNhZ0mat1JvLKpEsI) + http_status=$(echo "$response" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + if [ "$http_status" -ne 200 ] && [ "$http_status" -ne 204 ]; then + echo "Error sending to Discord. HTTP Status: $http_status" + exit 1 + fi + done diff --git a/announcements/a16.md b/announcements/a16.md new file mode 100644 index 00000000..2ce934b5 --- /dev/null +++ b/announcements/a16.md @@ -0,0 +1,3 @@ +# Test announcement + +Nothing to see here. diff --git a/announcements/a17.md b/announcements/a17.md new file mode 100644 index 00000000..9cccba72 --- /dev/null +++ b/announcements/a17.md @@ -0,0 +1,6 @@ +# Test announcement + +Nothing to see **here**. + +- one +- two diff --git a/announcements/a18.md b/announcements/a18.md new file mode 100644 index 00000000..9cccba72 --- /dev/null +++ b/announcements/a18.md @@ -0,0 +1,6 @@ +# Test announcement + +Nothing to see **here**. + +- one +- two diff --git a/announcements/a19.md b/announcements/a19.md new file mode 100644 index 00000000..9cccba72 --- /dev/null +++ b/announcements/a19.md @@ -0,0 +1,6 @@ +# Test announcement + +Nothing to see **here**. + +- one +- two diff --git a/announcements/a20.md b/announcements/a20.md new file mode 100644 index 00000000..f894c1d3 --- /dev/null +++ b/announcements/a20.md @@ -0,0 +1,245 @@ +--- +__Advertisement :)__ + +- __[pica](https://nodeca.github.io/pica/demo/)__ - high quality and fast image + resize in browser. +- __[babelfish](https://github.com/nodeca/babelfish/)__ - developer friendly + i18n with plurals support and easy syntax. + +You will like those projects! + +--- + +# h1 Heading 8-) +## h2 Heading +### h3 Heading +#### h4 Heading +##### h5 Heading +###### h6 Heading + + +## Horizontal Rules + +___ + +--- + +*** + + +## Typographic replacements + +Enable typographer option to see result. + +(c) (C) (r) (R) (tm) (TM) (p) (P) +- + +test.. test... test..... test?..... test!.... + +!!!!!! ???? ,, -- --- + +"Smartypants, double quotes" and 'single quotes' + + +## Emphasis + +**This is bold text** + +__This is bold text__ + +*This is italic text* + +_This is italic text_ + +~~Strikethrough~~ + + +## Blockquotes + + +> Blockquotes can also be nested... +>> ...by using additional greater-than signs right next to each other... +> > > ...or with spaces between arrows. + + +## Lists + +Unordered + ++ Create a list by starting a line with `+`, `-`, or `*` ++ Sub-lists are made by indenting 2 spaces: + - Marker character change forces new list start: + * Ac tristique libero volutpat at + + Facilisis in pretium nisl aliquet + - Nulla volutpat aliquam velit ++ Very easy! + +Ordered + +1. Lorem ipsum dolor sit amet +2. Consectetur adipiscing elit +3. Integer molestie lorem at massa + + +1. You can use sequential numbers... +1. ...or keep all the numbers as `1.` + +Start numbering with offset: + +57. foo +1. bar + + +## Code + +Inline `code` + +Indented code + + // Some comments + line 1 of code + line 2 of code + line 3 of code + + +Block code "fences" + +``` +Sample text here... +``` + +Syntax highlighting + +``` js +var foo = function (bar) { + return bar++; +}; + +console.log(foo(5)); +``` + +## Tables + +| Option | Description | +| ------ | ----------- | +| data | path to data files to supply the data that will be passed into templates. | +| engine | engine to be used for processing templates. Handlebars is the default. | +| ext | extension to be used for dest files. | + +Right aligned columns + +| Option | Description | +| ------:| -----------:| +| data | path to data files to supply the data that will be passed into templates. | +| engine | engine to be used for processing templates. Handlebars is the default. | +| ext | extension to be used for dest files. | + + +## Links + +[link text](http://dev.nodeca.com) + +[link with title](http://nodeca.github.io/pica/demo/ "title text!") + +Autoconverted link https://github.com/nodeca/pica (enable linkify to see) + + +## Images + +![Minion](https://octodex.github.com/images/minion.png) +![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat") + +Like links, Images also have a footnote style syntax + +![Alt text][id] + +With a reference later in the document defining the URL location: + +[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat" + + +## Plugins + +The killer feature of `markdown-it` is very effective support of +[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin). + + +### [Emojies](https://github.com/markdown-it/markdown-it-emoji) + +> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum: +> +> Shortcuts (emoticons): :-) :-( 8-) ;) + +see [how to change output](https://github.com/markdown-it/markdown-it-emoji#change-output) with twemoji. + + +### [Subscript](https://github.com/markdown-it/markdown-it-sub) / [Superscript](https://github.com/markdown-it/markdown-it-sup) + +- 19^th^ +- H~2~O + + +### [\](https://github.com/markdown-it/markdown-it-ins) + +++Inserted text++ + + +### [\](https://github.com/markdown-it/markdown-it-mark) + +==Marked text== + + +### [Footnotes](https://github.com/markdown-it/markdown-it-footnote) + +Footnote 1 link[^first]. + +Footnote 2 link[^second]. + +Inline footnote^[Text of inline footnote] definition. + +Duplicated footnote reference[^second]. + +[^first]: Footnote **can have markup** + + and multiple paragraphs. + +[^second]: Footnote text. + + +### [Definition lists](https://github.com/markdown-it/markdown-it-deflist) + +Term 1 + +: Definition 1 +with lazy continuation. + +Term 2 with *inline markup* + +: Definition 2 + + { some code, part of Definition 2 } + + Third paragraph of definition 2. + +_Compact style:_ + +Term 1 + ~ Definition 1 + +Term 2 + ~ Definition 2a + ~ Definition 2b + + +### [Abbreviations](https://github.com/markdown-it/markdown-it-abbr) + +This is HTML abbreviation example. + +It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on. + +*[HTML]: Hyper Text Markup Language + +### [Custom containers](https://github.com/markdown-it/markdown-it-container) + +::: warning +*here be dragons* +::: diff --git a/announcements/a21.md b/announcements/a21.md new file mode 100644 index 00000000..95303782 --- /dev/null +++ b/announcements/a21.md @@ -0,0 +1,101 @@ +--- +__Advertisement :)__ + +- __[pica](https://nodeca.github.io/pica/demo/)__ - high quality and fast image + resize in browser. +- __[babelfish](https://github.com/nodeca/babelfish/)__ - developer friendly + i18n with plurals support and easy syntax. + +You will like those projects! + +--- + +# h1 Heading 8-) +## h2 Heading +### h3 Heading +#### h4 Heading +##### h5 Heading +###### h6 Heading + + +## Horizontal Rules + +___ + +--- + +*** + + +## Typographic replacements + +Enable typographer option to see result. + +(c) (C) (r) (R) (tm) (TM) (p) (P) +- + +test.. test... test..... test?..... test!.... + +!!!!!! ???? ,, -- --- + +"Smartypants, double quotes" and 'single quotes' + + +## Emphasis + +**This is bold text** + +__This is bold text__ + +*This is italic text* + +_This is italic text_ + +~~Strikethrough~~ + + +## Blockquotes + + +> Blockquotes can also be nested... +>> ...by using additional greater-than signs right next to each other... +> > > ...or with spaces between arrows. + + +## Lists + +Unordered + ++ Create a list by starting a line with `+`, `-`, or `*` ++ Sub-lists are made by indenting 2 spaces: + - Marker character change forces new list start: + * Ac tristique libero volutpat at + + Facilisis in pretium nisl aliquet + - Nulla volutpat aliquam velit ++ Very easy! + +Ordered + +1. Lorem ipsum dolor sit amet +2. Consectetur adipiscing elit +3. Integer molestie lorem at massa + + +1. You can use sequential numbers... +1. ...or keep all the numbers as `1.` + +Start numbering with offset: + +57. foo +1. bar + + +## Code + +Inline `code` + +Indented code + + // Some comments + line 1 of code + line 2 of code + line 3 of code \ No newline at end of file diff --git a/announcements/a22.md b/announcements/a22.md new file mode 100644 index 00000000..a92a1abf --- /dev/null +++ b/announcements/a22.md @@ -0,0 +1,46 @@ +Markdown: Syntax +================ + + + + +* [Overview](#overview) + * [Philosophy](#philosophy) + * [Inline HTML](#html) + * [Automatic Escaping for Special Characters](#autoescape) +* [Block Elements](#block) + * [Paragraphs and Line Breaks](#p) + * [Headers](#header) + * [Blockquotes](#blockquote) + * [Lists](#list) + * [Code Blocks](#precode) + * [Horizontal Rules](#hr) +* [Span Elements](#span) + * [Links](#link) + * [Emphasis](#em) + * [Code](#code) + * [Images](#img) +* [Miscellaneous](#misc) + * [Backslash Escapes](#backslash) + * [Automatic Links](#autolink) + + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL][src]. + + [src]: /projects/markdown/syntax.text + +* * * + +

Overview

+ +

Philosophy

+ +Markdown is intended to be as easy-to-read and easy-to-write as is feasible. + diff --git a/announcements/a23.md b/announcements/a23.md new file mode 100644 index 00000000..0dd5f65c --- /dev/null +++ b/announcements/a23.md @@ -0,0 +1,37 @@ +# An h1 header + +Paragraphs are separated by a blank line. + +2nd paragraph. _Italic_, **bold**, and `monospace`. Itemized lists look like: + +- this one +- that one +- the other one + +Note that --- not considering the asterisk --- the actual text content starts at +4-columns in. + +> Block quotes are written like so. +> +> They can span multiple paragraphs, if you like. + +Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all in chapters +12--14"). Three dots ... will be converted to an ellipsis. Unicode is supported. +☺ + +## An h2 header + +Here's a numbered list: + +1. first item +2. second item +3. third item + +Note again how the actual text starts at 4 columns in (4 characters from the +left side). Here's a code sample: + + # Let me re-iterate ... + for i in 1 .. 10 { do-something(i) } + +As you probably guessed, indented 4 spaces. By the way, instead of indenting the +block, you can use delimited blocks, if you like: diff --git a/announcements/a24.md b/announcements/a24.md new file mode 100644 index 00000000..bac3433d --- /dev/null +++ b/announcements/a24.md @@ -0,0 +1,41 @@ +# An h1 header + +Paragraphs are separated by a blank line. + +2nd paragraph. _Italic_, **bold**, and `monospace`. Itemized lists look like: + +- this one +- that one +- the other one + +Note that --- not considering the asterisk --- the actual text content starts at +4-columns in. + +> Block quotes are written like so. +> +> They can span multiple paragraphs, if you like. + +Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all in chapters +12--14"). Three dots ... will be converted to an ellipsis. Unicode is supported. +☺ + +https://www.youtube.com/watch?v=_HDjDUDkdnQ + +## An h2 header + +[A link](https://www.youtube.com/watch?v=_HDjDUDkdnQ) + +Here's a numbered list: + +1. first item +2. second item +3. third item + +Note again how the actual text starts at 4 columns in (4 characters from the +left side). Here's a code sample: + + # Let me re-iterate ... + for i in 1 .. 10 { do-something(i) } + +As you probably guessed, indented 4 spaces. By the way, instead of indenting the +block, you can use delimited blocks, if you like: diff --git a/announcements/a25.md b/announcements/a25.md new file mode 100644 index 00000000..bac3433d --- /dev/null +++ b/announcements/a25.md @@ -0,0 +1,41 @@ +# An h1 header + +Paragraphs are separated by a blank line. + +2nd paragraph. _Italic_, **bold**, and `monospace`. Itemized lists look like: + +- this one +- that one +- the other one + +Note that --- not considering the asterisk --- the actual text content starts at +4-columns in. + +> Block quotes are written like so. +> +> They can span multiple paragraphs, if you like. + +Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all in chapters +12--14"). Three dots ... will be converted to an ellipsis. Unicode is supported. +☺ + +https://www.youtube.com/watch?v=_HDjDUDkdnQ + +## An h2 header + +[A link](https://www.youtube.com/watch?v=_HDjDUDkdnQ) + +Here's a numbered list: + +1. first item +2. second item +3. third item + +Note again how the actual text starts at 4 columns in (4 characters from the +left side). Here's a code sample: + + # Let me re-iterate ... + for i in 1 .. 10 { do-something(i) } + +As you probably guessed, indented 4 spaces. By the way, instead of indenting the +block, you can use delimited blocks, if you like: diff --git a/announcements/file.md b/announcements/file.md new file mode 100644 index 00000000..20d5b672 --- /dev/null +++ b/announcements/file.md @@ -0,0 +1 @@ +Second file diff --git a/announcements/file11.md b/announcements/file11.md new file mode 100644 index 00000000..382ed53c --- /dev/null +++ b/announcements/file11.md @@ -0,0 +1 @@ +file 11 diff --git a/announcements/file12.md b/announcements/file12.md new file mode 100644 index 00000000..1cebc092 --- /dev/null +++ b/announcements/file12.md @@ -0,0 +1 @@ +file 12 diff --git a/announcements/file13.md b/announcements/file13.md new file mode 100644 index 00000000..f2c2566c --- /dev/null +++ b/announcements/file13.md @@ -0,0 +1,3 @@ +# Hello world + +This is a test **announcement**. diff --git a/announcements/file3.md b/announcements/file3.md new file mode 100644 index 00000000..c9e07acd --- /dev/null +++ b/announcements/file3.md @@ -0,0 +1,16 @@ +*bold \*text* +_italic \*text_ +__underline__ +~strikethrough~ +||spoiler|| +*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold* +[inline URL](http://www.example.com/) +[inline mention of a user](tg://user?id=123456789) +![👍](tg://emoji?id=5368324170671202286) +`inline fixed-width code` +``` +pre-formatted fixed-width code block +``` +```python +pre-formatted fixed-width code block written in the Python programming language +``` \ No newline at end of file diff --git a/announcements/file6.md b/announcements/file6.md new file mode 100644 index 00000000..f20d94c4 --- /dev/null +++ b/announcements/file6.md @@ -0,0 +1 @@ +test file 6 diff --git a/announcements/file7.md b/announcements/file7.md new file mode 100644 index 00000000..6ae23d7a --- /dev/null +++ b/announcements/file7.md @@ -0,0 +1 @@ +file 7 modified diff --git a/announcements/file8.md b/announcements/file8.md new file mode 100644 index 00000000..18890f04 --- /dev/null +++ b/announcements/file8.md @@ -0,0 +1 @@ +file 8 diff --git a/announcements/foobar.md b/announcements/foobar.md new file mode 100644 index 00000000..c9e07acd --- /dev/null +++ b/announcements/foobar.md @@ -0,0 +1,16 @@ +*bold \*text* +_italic \*text_ +__underline__ +~strikethrough~ +||spoiler|| +*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold* +[inline URL](http://www.example.com/) +[inline mention of a user](tg://user?id=123456789) +![👍](tg://emoji?id=5368324170671202286) +`inline fixed-width code` +``` +pre-formatted fixed-width code block +``` +```python +pre-formatted fixed-width code block written in the Python programming language +``` \ No newline at end of file diff --git a/announcements/hello.md b/announcements/hello.md new file mode 100644 index 00000000..84611bf7 --- /dev/null +++ b/announcements/hello.md @@ -0,0 +1,3 @@ +# Something + +text text diff --git a/announcements/something.md b/announcements/something.md new file mode 100644 index 00000000..c9e07acd --- /dev/null +++ b/announcements/something.md @@ -0,0 +1,16 @@ +*bold \*text* +_italic \*text_ +__underline__ +~strikethrough~ +||spoiler|| +*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold* +[inline URL](http://www.example.com/) +[inline mention of a user](tg://user?id=123456789) +![👍](tg://emoji?id=5368324170671202286) +`inline fixed-width code` +``` +pre-formatted fixed-width code block +``` +```python +pre-formatted fixed-width code block written in the Python programming language +``` \ No newline at end of file diff --git a/announcements/test-one.md b/announcements/test-one.md new file mode 100644 index 00000000..d1e30beb --- /dev/null +++ b/announcements/test-one.md @@ -0,0 +1 @@ +test-one diff --git a/announcements/test-two.md b/announcements/test-two.md new file mode 100644 index 00000000..c9e07acd --- /dev/null +++ b/announcements/test-two.md @@ -0,0 +1,16 @@ +*bold \*text* +_italic \*text_ +__underline__ +~strikethrough~ +||spoiler|| +*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold* +[inline URL](http://www.example.com/) +[inline mention of a user](tg://user?id=123456789) +![👍](tg://emoji?id=5368324170671202286) +`inline fixed-width code` +``` +pre-formatted fixed-width code block +``` +```python +pre-formatted fixed-width code block written in the Python programming language +``` \ No newline at end of file diff --git a/announcements/testfile.md b/announcements/testfile.md new file mode 100644 index 00000000..26918572 --- /dev/null +++ b/announcements/testfile.md @@ -0,0 +1 @@ +testfile