From 447f9dadd2eb852a672bd7d12e92bc691eb91d02 Mon Sep 17 00:00:00 2001 From: Anders Larsen Date: Wed, 27 Apr 2022 23:12:39 +0200 Subject: [PATCH 01/72] jira tickets --- .github/workflows/main.yaml | 3 +- .github/workflows/test.yaml | 1 - MarkdownToConfluence/__init__.py | 1 + .../confluence/check_if_page_exists.py | 4 +- .../confluence/create_content.py | 2 +- .../confluence/delete_content.py | 6 +- .../confluence/update_content.py | 2 +- .../confluence/upload_attachments.py | 4 +- MarkdownToConfluence/file_parsing/__init__.py | 2 - .../file_parsing/attachments.py | 26 --- .../file_parsing/parse_markdown.py | 12 -- .../tests/testdocs/images/markdown/image.md | 6 - .../file_parsing/tests/testdocs/index.md | 4 - MarkdownToConfluence/main.py | 9 +- MarkdownToConfluence/modules/__init__.py | 1 + .../modules/image/__init__.py | 1 - .../testdocs/images/attachments/image.png | Bin 3092 -> 0 bytes .../tests/testdocs/images/markdown/image.md | 6 - .../tests/testdocs/images/markdown/image.png | Bin 3092 -> 0 bytes .../modules/jira_tickets/__init__.py | 1 + .../jira_tickets/jira_tickets_parser.py | 47 +++++ .../mermaid/tests/test_mermaid_parser.py | 19 +- .../{filetools => utils}/__init__.py | 5 +- .../{filetools => utils}/file_traversal.py | 31 ++- .../{modules/image => utils}/image_parser.py | 4 +- .../{filetools => utils}/page_file_info.py | 176 ++++++++--------- .../{filetools => utils}/paths.py | 0 .../{file_parsing => utils}/tests/__init__.py | 0 .../tests/test_image_parser.py | 24 ++- .../tests/test_page_file_info.py | 178 +++++++++--------- .../{filetools => utils}/tests/test_paths.py | 4 +- .../DC 5.0/5 Security/Configuring CORS.md | 0 .../DAM Center 5/DC 5.0/5 Security/index.md | 0 .../testdocs/DAM Center 5/DC 5.0/index.md | 0 .../testdocs/DAM Center 5/DC 5.0/prefix.txt | 0 .../tests/testdocs/DAM Center 5/index.md | 0 .../tests/testdocs}/attachments/image.png | Bin .../utils/tests/testdocs/markdown/image.md | 6 + .../tests/testdocs}/markdown/image.png | Bin .../tests/testdocs/markdown/image_test.md} | 0 .../tests/testdocs/page 1/index-1.png | Bin .../tests/testdocs/page 1/index.md | 4 +- .../tests/testdocs/page 1/page 1.1/abe.md | 0 .../tests/testdocs/page 1/page 1.1/index.md | 0 .../tests/testdocs/settings.json | 4 +- documentation/page 2/index.md | 4 +- documentation/settings.json | 2 +- 47 files changed, 308 insertions(+), 291 deletions(-) delete mode 100644 MarkdownToConfluence/file_parsing/__init__.py delete mode 100644 MarkdownToConfluence/file_parsing/attachments.py delete mode 100644 MarkdownToConfluence/file_parsing/parse_markdown.py delete mode 100644 MarkdownToConfluence/file_parsing/tests/testdocs/images/markdown/image.md delete mode 100644 MarkdownToConfluence/file_parsing/tests/testdocs/index.md delete mode 100644 MarkdownToConfluence/modules/image/__init__.py delete mode 100644 MarkdownToConfluence/modules/image/tests/testdocs/images/attachments/image.png delete mode 100644 MarkdownToConfluence/modules/image/tests/testdocs/images/markdown/image.md delete mode 100644 MarkdownToConfluence/modules/image/tests/testdocs/images/markdown/image.png create mode 100644 MarkdownToConfluence/modules/jira_tickets/__init__.py create mode 100644 MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py rename MarkdownToConfluence/{filetools => utils}/__init__.py (60%) rename MarkdownToConfluence/{filetools => utils}/file_traversal.py (85%) rename MarkdownToConfluence/{modules/image => utils}/image_parser.py (86%) rename MarkdownToConfluence/{filetools => utils}/page_file_info.py (93%) rename MarkdownToConfluence/{filetools => utils}/paths.py (100%) rename MarkdownToConfluence/{file_parsing => utils}/tests/__init__.py (100%) rename MarkdownToConfluence/{modules/image => utils}/tests/test_image_parser.py (64%) rename MarkdownToConfluence/{filetools => utils}/tests/test_page_file_info.py (85%) rename MarkdownToConfluence/{filetools => utils}/tests/test_paths.py (73%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md (100%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/DAM Center 5/DC 5.0/5 Security/index.md (100%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/DAM Center 5/DC 5.0/index.md (100%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/DAM Center 5/DC 5.0/prefix.txt (100%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/DAM Center 5/index.md (100%) rename MarkdownToConfluence/{file_parsing/tests/testdocs/images => utils/tests/testdocs}/attachments/image.png (100%) create mode 100644 MarkdownToConfluence/utils/tests/testdocs/markdown/image.md rename MarkdownToConfluence/{file_parsing/tests/testdocs/images => utils/tests/testdocs}/markdown/image.png (100%) rename MarkdownToConfluence/{filetools/tests/__init__.py => utils/tests/testdocs/markdown/image_test.md} (100%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/page 1/index-1.png (100%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/page 1/index.md (96%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/page 1/page 1.1/abe.md (100%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/page 1/page 1.1/index.md (100%) rename MarkdownToConfluence/{filetools => utils}/tests/testdocs/settings.json (95%) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 70741c3..aad4581 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -5,6 +5,7 @@ on: branches: - main + jobs: hello_world_job: runs-on: ubuntu-latest @@ -14,7 +15,7 @@ jobs: uses: actions/checkout@v3 - name: Conversion step env: - CONFLUENCE_URL: 'https://at-bachelor.atlassian.net/wiki' + CONFLUENCE_URL: 'https://at-bachelor.atlassian.net' CONFLUENCE_SPACE_KEY: '~955037829' AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} uses: ./ # Uses an action in the root directory diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 19b9472..c257c9f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,7 +19,6 @@ jobs: apt-get update && apt-get install -y python3-venv python3 -m venv venv . venv/bin/activate - python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install -e . - name: Test with pytest diff --git a/MarkdownToConfluence/__init__.py b/MarkdownToConfluence/__init__.py index e69de29..6fefa02 100644 --- a/MarkdownToConfluence/__init__.py +++ b/MarkdownToConfluence/__init__.py @@ -0,0 +1 @@ +__all__ = ['utils', 'modules', 'confluence'] \ No newline at end of file diff --git a/MarkdownToConfluence/confluence/check_if_page_exists.py b/MarkdownToConfluence/confluence/check_if_page_exists.py index af38b97..6aee26e 100644 --- a/MarkdownToConfluence/confluence/check_if_page_exists.py +++ b/MarkdownToConfluence/confluence/check_if_page_exists.py @@ -8,7 +8,7 @@ authorization_string = f"Basic {AUTH_TOKEN}" def page_exists_in_space(title: str, spaceKey: str) -> bool: - url = f"{BASE_URL}/rest/api/content?spaceKey={spaceKey}&title={quote(title)}" + url = f"{BASE_URL}/wiki/rest/api/content?spaceKey={spaceKey}&title={quote(title)}" headers = { 'Authorization': authorization_string, 'User-Agent': 'python' @@ -24,7 +24,7 @@ def page_exists_in_space(title: str, spaceKey: str) -> bool: print(response.text) def get_page_id(title: str, spaceKey: str) -> str: - url = f"{BASE_URL}/rest/api/content?spaceKey={spaceKey}&title={quote(title)}" + url = f"{BASE_URL}/wiki/rest/api/content?spaceKey={spaceKey}&title={quote(title)}" headers = { 'Authorization': authorization_string, 'User-Agent': 'python' diff --git a/MarkdownToConfluence/confluence/create_content.py b/MarkdownToConfluence/confluence/create_content.py index 2eb66ec..8274cf3 100644 --- a/MarkdownToConfluence/confluence/create_content.py +++ b/MarkdownToConfluence/confluence/create_content.py @@ -45,7 +45,7 @@ def create_page(filename: str, title: str, space_obj, parent_id="none"): f = codecs.open(f"{filename}", 'r', encoding='utf-8') template['body']['storage']['value'] = f.read() - url = f'{BASE_URL}/rest/api/content' + url = f'{BASE_URL}/wiki/rest/api/content' headers = { 'Authorization': authorization_string, diff --git a/MarkdownToConfluence/confluence/delete_content.py b/MarkdownToConfluence/confluence/delete_content.py index 2f7db20..cac5ebf 100644 --- a/MarkdownToConfluence/confluence/delete_content.py +++ b/MarkdownToConfluence/confluence/delete_content.py @@ -1,5 +1,5 @@ import requests, json -from MarkdownToConfluence.filetools import get_all_page_names_in_filesystem +from MarkdownToConfluence.utils import get_all_page_names_in_filesystem import sys, os #BASE_URL = os.environ.get("CONFLUENCE_URL") @@ -13,7 +13,7 @@ def delete_page(page_id: str, page_name=""): - url = f"{BASE_URL}/rest/api/content/{page_id}" + url = f"{BASE_URL}/wiki/rest/api/content/{page_id}" headers = { 'Authorization': authorization_string, @@ -33,7 +33,7 @@ def delete_page(page_id: str, page_name=""): the exclude arg takes a list of page names, that are not to be deleted, even if they dont exist in the filesystem """ def delete_non_existing_pages(space_key: str, root: str, exclude=['Overview']): - url = f"{BASE_URL}/rest/api/content?spaceKey={space_key}" + url = f"{BASE_URL}/wiki/rest/api/content?spaceKey={space_key}" headers = { 'Authorization': authorization_string, diff --git a/MarkdownToConfluence/confluence/update_content.py b/MarkdownToConfluence/confluence/update_content.py index 06c0fb3..5920212 100644 --- a/MarkdownToConfluence/confluence/update_content.py +++ b/MarkdownToConfluence/confluence/update_content.py @@ -37,7 +37,7 @@ def update_page_content(filename: str, title: str, page_id: str, space_obj,): f = codecs.open(f"{filename}", 'r', encoding='utf-8') template['body']['storage']['value'] = f.read() - url = f"{BASE_URL}/rest/api/content/{page_id}" + url = f"{BASE_URL}/wiki/rest/api/content/{page_id}" headers = { 'Authorization': authorization_string, diff --git a/MarkdownToConfluence/confluence/upload_attachments.py b/MarkdownToConfluence/confluence/upload_attachments.py index 95909fe..c2f6624 100644 --- a/MarkdownToConfluence/confluence/upload_attachments.py +++ b/MarkdownToConfluence/confluence/upload_attachments.py @@ -16,7 +16,7 @@ def upload_attachment(page_title, attactchment_name, filepath): if(page_exists_in_space(page_title, SPACEKEY)): - url = f"{BASE_URL}/rest/api/content/{get_page_id(page_title, SPACEKEY)}/child/attachment" + url = f"{BASE_URL}/wiki/rest/api/content/{get_page_id(page_title, SPACEKEY)}/child/attachment" # Get attachment id id = "" @@ -44,7 +44,7 @@ def upload_attachment(page_title, attactchment_name, filepath): """ def update_attachment_data(page_title, attactchment_name, filepath): if(page_exists_in_space(page_title, SPACEKEY)): - url = f"{BASE_URL}/rest/api/content/{get_page_id(page_title, SPACEKEY)}/child/attachment" + url = f"{BASE_URL}/wiki/rest/api/content/{get_page_id(page_title, SPACEKEY)}/child/attachment" # Get attachment id id = "" diff --git a/MarkdownToConfluence/file_parsing/__init__.py b/MarkdownToConfluence/file_parsing/__init__.py deleted file mode 100644 index 1e6e2ee..0000000 --- a/MarkdownToConfluence/file_parsing/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -__all__ = ["parse_markdown", "mermaid_parser", "image_parser"] -from .parse_markdown import parse_markdown \ No newline at end of file diff --git a/MarkdownToConfluence/file_parsing/attachments.py b/MarkdownToConfluence/file_parsing/attachments.py deleted file mode 100644 index 7deee65..0000000 --- a/MarkdownToConfluence/file_parsing/attachments.py +++ /dev/null @@ -1,26 +0,0 @@ -#TODO remove this file -from posixpath import dirname, basename -#from MarkdownToConfluence.modules.image.image_parser import convert_md_img_to_confluence_img -import re, os -from MarkdownToConfluence.filetools import get_abs_path_from_relative -""" -def parse_and_get_attachments(filename): - attachments = [] - with open(filename, 'r') as f: - lines = f.readlines() - with open(filename, 'w') as f: - for line in lines: - reg = re.match(r'!\[(?P[^\]]*)\]\((?P.*?)(?=\"|\))(\"(?P.*)\")?\)', line) - if (reg != None): - name = reg['title'] if reg['title'] != None else reg['alt'] - image = convert_md_img_to_confluence_img(line, filename) - if(image != None): - f.write(image) - else: - f.write(line) - path = get_abs_path_from_relative(reg['filename'], filename) - attachments.append((name, path)) - else: - f.write(line) - return attachments -""" \ No newline at end of file diff --git a/MarkdownToConfluence/file_parsing/parse_markdown.py b/MarkdownToConfluence/file_parsing/parse_markdown.py deleted file mode 100644 index 8b1a3b4..0000000 --- a/MarkdownToConfluence/file_parsing/parse_markdown.py +++ /dev/null @@ -1,12 +0,0 @@ -# TODO: remove this file -import sys -import MarkdownToConfluence.modules.mermaid as mermaid - -def parse_markdown(filename): - mermaid.convert(filename) - - -if __name__ == "__main__": - parse_markdown(f"{str(sys.argv[1])}") - -"""<ac:image><ri:attachment ri:filename="{diagram_name}" /></ac:image>""" \ No newline at end of file diff --git a/MarkdownToConfluence/file_parsing/tests/testdocs/images/markdown/image.md b/MarkdownToConfluence/file_parsing/tests/testdocs/images/markdown/image.md deleted file mode 100644 index ca1c3f5..0000000 --- a/MarkdownToConfluence/file_parsing/tests/testdocs/images/markdown/image.md +++ /dev/null @@ -1,6 +0,0 @@ -![alt](../attachments/image.png "title") -![alt](./image.png "title") -![alt](MarkdownToConfluence/file_parsing/tests/testdocs/images/attachments/image.png "title") -![alt](../attachments/image.png) -![alt](./image.png) -![alt](MarkdownToConfluence/file_parsing/tests/testdocs/images/attachments/image.png) \ No newline at end of file diff --git a/MarkdownToConfluence/file_parsing/tests/testdocs/index.md b/MarkdownToConfluence/file_parsing/tests/testdocs/index.md deleted file mode 100644 index 78c8c05..0000000 --- a/MarkdownToConfluence/file_parsing/tests/testdocs/index.md +++ /dev/null @@ -1,4 +0,0 @@ -```mermaid -graph -A[start] --> B[end] -``` \ No newline at end of file diff --git a/MarkdownToConfluence/main.py b/MarkdownToConfluence/main.py index d96e0b3..c359e9d 100644 --- a/MarkdownToConfluence/main.py +++ b/MarkdownToConfluence/main.py @@ -4,8 +4,9 @@ from confluence import create_page from confluence import update_page_content from confluence import upload_attachment +from utils import convert_all_md_img_to_confluence_img import globals -from filetools.page_file_info import get_page_name_from_path, get_parent_name_from_path +from utils.page_file_info import get_page_name_from_path, get_parent_name_from_path import os import subprocess import markdown @@ -40,8 +41,7 @@ def upload_documentation(path_name:str, root:str): for line in lines: o.write(line) - # Get and parse attachments - #attachments = parse_and_get_attachments(path_name.replace('.md', '_final.md')) + # Load and run modules settings_path = f"{os.environ.get('INPUT_FILESLOCATION')}/settings.json" if(os.path.exists(settings_path)): modules = module_loader.get_modules(settings_path) @@ -51,6 +51,9 @@ def upload_documentation(path_name:str, root:str): for module in modules: module_loader.run_module(module, temp_file) + # Convert images + convert_all_md_img_to_confluence_img(temp_file) + # Convert to html with open(temp_file, 'r') as f: text = f.read() diff --git a/MarkdownToConfluence/modules/__init__.py b/MarkdownToConfluence/modules/__init__.py index e69de29..7b69faa 100644 --- a/MarkdownToConfluence/modules/__init__.py +++ b/MarkdownToConfluence/modules/__init__.py @@ -0,0 +1 @@ +__all__ = ['mermaid', 'jira_tickets'] \ No newline at end of file diff --git a/MarkdownToConfluence/modules/image/__init__.py b/MarkdownToConfluence/modules/image/__init__.py deleted file mode 100644 index edfbc2e..0000000 --- a/MarkdownToConfluence/modules/image/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .image_parser import run \ No newline at end of file diff --git a/MarkdownToConfluence/modules/image/tests/testdocs/images/attachments/image.png b/MarkdownToConfluence/modules/image/tests/testdocs/images/attachments/image.png deleted file mode 100644 index 57d95e38ad1e395f9774341d450ce5bd7684cb3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3092 zcmb_a3pA8l8{RW!+)c!|gpQeTLWnd7Ihb*oT!*1)4uy<lh;dCQ6=mGzQgK{H$S86d z*Fs51LPfb1j`$OalhDoo%{j;FoVCus{`If*zx&(Ye%|+a-gm!yf8WN7jR_!1G`BJb zFc<(ZXn>6=_)aS`v%~fzJ98^*!tVrJ8bF5F4S=72FoR@as&J5UNP!#MG<VOSfKB`l zD^&O65Vtx2Pu2f{|8F6Iqh3Ltkmx-$gBj4~P_suNEaCkJ4(DQzKX4)!Gn`0fkfs2_ zJH7vcJ^q5jf&+pfO&3@18NlG;F$f#_(L=a<agE!tu$MpC5n2yIQw{_H60iWK5dOc~ z_xn7-0zhvC0G`zEF^?+%)W-rKJ@P%KSOCD5^8nQK1-LWZe{Ti>z2P((0L!HSh)@6! z?*~ATy4mRW-0$DwKb%zo%8`T4c>)^VfDXKX0<Z%9z!PXdNE_@1S^&2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own/image.md deleted file mode 100644 index ca1c3f5..0000000 --- a/MarkdownToConfluence/modules/image/tests/testdocs/images/markdown/image.md +++ /dev/null @@ -1,6 +0,0 @@ -![alt](../attachments/image.png "title") -![alt](./image.png "title") -![alt](MarkdownToConfluence/file_parsing/tests/testdocs/images/attachments/image.png "title") -![alt](../attachments/image.png) -![alt](./image.png) -![alt](MarkdownToConfluence/file_parsing/tests/testdocs/images/attachments/image.png) \ No newline at end of file diff --git a/MarkdownToConfluence/modules/image/tests/testdocs/images/markdown/image.png b/MarkdownToConfluence/modules/image/tests/testdocs/images/markdown/image.png deleted file mode 100644 index 57d95e38ad1e395f9774341d450ce5bd7684cb3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3092 zcmb_a3pA8l8{RW!+)c!|gpQeTLWnd7Ihb*oT!*1)4uy<lh;dCQ6=mGzQgK{H$S86d z*Fs51LPfb1j`$OalhDoo%{j;FoVCus{`If*zx&(Ye%|+a-gm!yf8WN7jR_!1G`BJb zFc<(ZXn>6=_)aS`v%~fzJ98^*!tVrJ8bF5F4S=72FoR@as&J5UNP!#MG<VOSfKB`l zD^&O65Vtx2Pu2f{|8F6Iqh3Ltkmx-$gBj4~P_suNEaCkJ4(DQzKX4)!Gn`0fkfs2_ zJH7vcJ^q5jf&+pfO&3@18NlG;F$f#_(L=a<agE!tu$MpC5n2yIQw{_H60iWK5dOc~ z_xn7-0zhvC0G`zEF^?+%)W-rKJ@P%KSOCD5^8nQK1-LWZe{Ti>z2P((0L!HSh)@6! z?*~ATy4mRW-0$DwKb%zo%8`T4c>)^VfDXKX0<Z%9z!PXdNE_@1S^&2(3d{fx9L{|p zLqHFbABjXDkb-=Cy!^s~!oos=LP8>_t)e0*F_e&ysHCWvxC9!F7TzKyEh!<rRRS%+ zEdt|#au7%XBvL>^L`X#9f3}S_AjS_;fjJKh3*cff9x>R)edqu%0Ox^m|Ljde@*?>7 zc?94Pix&kj9;k7sQ3T)bJRIr+AbG{M@=0R&#k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7s0L$}?WczqxQ}IlF#j zdtxag=D~BLU+9OWJPdX-#}!O=B;)s`Rg+C-(RwrI%AF6iPY<!%8xHua`ApqL58Q9> z^tl`c&rHa>EqC_dw6&2OQO&Y@$3?Z@j-I=gjhV=NB3|&I@m?CrQ{-VhrrKv_J7RZ$ zfHnr>Cdg!7zs@ngcM93oAm8mxtIi-_5}nv4H@t=4VlP2C$1EVN&{d^Prxda5940yb zh?di~b@6g2u5C%cBhlpKr36-j?#1V7F)i(%7D^SIWHr-=1?u!gSt`mA8JXnc>}i9z zeZ$Uuq1oXbx@D`>A<f#Bg&Q<B)l+Z`&#Pzg-Z94nKR8(?ICGn<R#r6MCqlSzerm7Z z(;o!itmW#jx=b`tl=+fx^v!f#cs=)~uQbWI?~?yx;+OjK?H9-T5@nkTI5;zU;w_y3 zH%Y>M`T-J_T~HF~5JYfdAMu#!sZ`Gi4=;L-{Mw9u>qf=BU$UqW`W&jZYXewsfXej# z6^-CxwbX;ojrVn>>%Nv)Qb?4<*kdWhZh<_;d8do^y%@ZJ>pjt^_oIfekGV>*zzlv+ zy!&b~y}x`L$^U@z4ZB9`mj-r+Oc!9UY<{g>xu(%Czv4Si)pTr|zdLR-SiNG1dL%!{ zx$iKrrWT9dlziCCalZ4X<k@D9EjBr&?H;paX(Zx_)G^ejuHneIVqWEtY}gF*U4%`w zDSAC_A6m7usm`r5X82rFjr-jsf8VPK^4EL4%gq$d=&v(~#Wt+mvIc@-x0Qy)9Tnp2 IxsBm}1CHRoFaQ7m diff --git a/MarkdownToConfluence/modules/jira_tickets/__init__.py b/MarkdownToConfluence/modules/jira_tickets/__init__.py new file mode 100644 index 0000000..206fe38 --- /dev/null +++ b/MarkdownToConfluence/modules/jira_tickets/__init__.py @@ -0,0 +1 @@ +from .jira_tickets_parser import run \ No newline at end of file diff --git a/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py b/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py new file mode 100644 index 0000000..a4db91f --- /dev/null +++ b/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py @@ -0,0 +1,47 @@ +import re +import requests, json, os + +def parse_tickets(filename: str): + with open(filename, 'r') as f: + lines = f.readlines() + with open(filename, 'w') as f: + for line in lines: + res = parse_ticket(line) + new_line = res if res.endswith('\n') else res + '\n' + f.write(new_line) + +def parse_ticket(line: str) -> str: + tickets = re.findall(r'\d+-[A-Z]+(?!-?[a-zA-Z]{1,10})', line[::-1]) #official atlassian regex magic + new_line = line + for ticket in tickets: + if(check_if_ticket_exists): # TODO: Raise warning in pipeline + ticket = ticket[::-1] + ticket_tag = f"<ac:structured-macro ac:name='jira'><ac:parameter ac:name='columns'>key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name='key'>{ticket}</ac:parameter> </ac:structured-macro>" + new_line = new_line.replace(ticket, ticket_tag) + return new_line + +def check_if_ticket_exists(ticket: str): + base_url = os.environ.get('CONFLUENCE_URL') + url = f'{base_url}/rest/api/3/issue/{ticket}' + auth = os.environ.get('AUTH_TOKEN') # TODO: change using username and token with; from requests.auth import HTTPBasicAuth + + headers = { + 'Authorization': auth, + 'Content-Type': 'application/json; charset=utf-8', + 'User-Agent': 'python' + } + + response = requests.request( + "GET", + url, + headers=headers, + ) + + #print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) + + return response.status_code == 200 + +def run(filename): + return parse_tickets(filename) + +#print(check_if_ticket_exists('BAasdaC-74')) diff --git a/MarkdownToConfluence/modules/mermaid/tests/test_mermaid_parser.py b/MarkdownToConfluence/modules/mermaid/tests/test_mermaid_parser.py index c390e34..9962c99 100644 --- a/MarkdownToConfluence/modules/mermaid/tests/test_mermaid_parser.py +++ b/MarkdownToConfluence/modules/mermaid/tests/test_mermaid_parser.py @@ -4,11 +4,16 @@ def test_parse_mermaid_macro(): file = str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/index.md' - run(file) - assert os.path.exists(str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/index-1.png') - assert os.path.exists(str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/index_final.md') - with open(str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/index_final.md', 'r') as f: + test_file = file.replace('.md', '_test.md') + with open(file, 'r') as f: + lines = f.readlines() + with open(test_file, 'w') as f: + for line in lines: + f.write(line) + run(test_file) + assert os.path.exists(str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/index_test-1.png') + with open(test_file, 'r') as f: line = f.readline() - assert line == f'![mermaid-1]({str(pathlib.Path(__file__).parent.resolve())}/testdocs/index-1.png)' - os.remove(str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/index_final.md') - os.remove(str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/index-1.png') \ No newline at end of file + assert line == f'![mermaid-1]({str(pathlib.Path(__file__).parent.resolve())}/testdocs/index_test-1.png)' + os.remove(test_file) + os.remove(str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/index_test-1.png') \ No newline at end of file diff --git a/MarkdownToConfluence/filetools/__init__.py b/MarkdownToConfluence/utils/__init__.py similarity index 60% rename from MarkdownToConfluence/filetools/__init__.py rename to MarkdownToConfluence/utils/__init__.py index 9f13802..8474995 100644 --- a/MarkdownToConfluence/filetools/__init__.py +++ b/MarkdownToConfluence/utils/__init__.py @@ -1,7 +1,8 @@ -__all__ = ["page_file_info", "file_traversal"] +__all__ = ["page_file_info", "file_traversal", 'image'] from .page_file_info import get_prefix from .page_file_info import get_page_name_from_path from .page_file_info import get_parent_name_from_path from .page_file_info import get_all_md_paths from .page_file_info import get_all_page_names_in_filesystem -from .paths import get_abs_path_from_relative \ No newline at end of file +from .paths import get_abs_path_from_relative +from .image_parser import convert_all_md_img_to_confluence_img \ No newline at end of file diff --git a/MarkdownToConfluence/filetools/file_traversal.py b/MarkdownToConfluence/utils/file_traversal.py similarity index 85% rename from MarkdownToConfluence/filetools/file_traversal.py rename to MarkdownToConfluence/utils/file_traversal.py index 417b2f2..2b62c6b 100644 --- a/MarkdownToConfluence/filetools/file_traversal.py +++ b/MarkdownToConfluence/utils/file_traversal.py @@ -1,17 +1,14 @@ -import os -# assign directory -FILES_PATH = os.environ.get("INPUT_FILESLOCATION") - -# iterate over files in -# that directory -def traverse(directory): - for filename in os.listdir(directory): - f = os.path.join(directory, filename) - # checking if it is a file - if(os.path.isdir(f)): - traverse(f) - if(f.endswith('.md')): - print(f) - - -traverse(FILES_PATH) \ No newline at end of file +import os +# assign directory +FILES_PATH = os.environ.get("INPUT_FILESLOCATION") + +# iterate over files in +# that directory +def traverse(directory): + for filename in os.listdir(directory): + f = os.path.join(directory, filename) + # checking if it is a file + if(os.path.isdir(f)): + traverse(f) + if(f.endswith('.md')): + print(f) \ No newline at end of file diff --git a/MarkdownToConfluence/modules/image/image_parser.py b/MarkdownToConfluence/utils/image_parser.py similarity index 86% rename from MarkdownToConfluence/modules/image/image_parser.py rename to MarkdownToConfluence/utils/image_parser.py index 307b459..f8602a8 100644 --- a/MarkdownToConfluence/modules/image/image_parser.py +++ b/MarkdownToConfluence/utils/image_parser.py @@ -1,6 +1,6 @@ from posixpath import dirname, basename import re, os -from MarkdownToConfluence.filetools import get_abs_path_from_relative +from MarkdownToConfluence.utils import get_abs_path_from_relative import globals from PIL import Image @@ -24,7 +24,7 @@ def convert_md_img_to_confluence_img(md_image_link: str, md_path: str): width, height = image.size name = img['title'] if img["title"] != None else basename(img['filename']) globals.attachments.append((name, path)) - return(f'<ac:image ac:original-height="{str(height)}" ac:original-width="{str(width)}"><ri:attachment ri:filename="{name}"/></ac:image>\n') + return(md_image_link.replace(img.string, f'<ac:image ac:original-height="{str(height)}" ac:original-width="{str(width)}"><ri:attachment ri:filename="{name}"/></ac:image>\n')) else: return None diff --git a/MarkdownToConfluence/filetools/page_file_info.py b/MarkdownToConfluence/utils/page_file_info.py similarity index 93% rename from MarkdownToConfluence/filetools/page_file_info.py rename to MarkdownToConfluence/utils/page_file_info.py index 58eb06b..eff3215 100644 --- a/MarkdownToConfluence/filetools/page_file_info.py +++ b/MarkdownToConfluence/utils/page_file_info.py @@ -1,87 +1,89 @@ -import os, json -from posixpath import basename, dirname - -# Returns "" if path == root -def get_prefix(path: str, root: str) -> str: - if(not os.path.exists(path)): - raise FileNotFoundError(path) - if(not os.path.exists(root)): - raise FileNotFoundError(root) - if(path == root): - return "" - if(path.endswith("index.md") and "prefix.txt" in os.listdir(dirname(path))): # No prefix for index page in folder with prefix.txt (prefix is only for underpages) - return "" - if(os.path.isfile(path)): - path = os.path.dirname(path) - else: - if("prefix.txt" in os.listdir(path)): # assume index.md, No prefix for index page in folder with prefix.txt (prefix is only for underpages) - return "" - while("prefix.txt" not in os.listdir(path)): - path = os.path.dirname(path) - if(path == root or path == ""): - return "" - with open(f"{path}/prefix.txt") as f: - return f.readline() - -# Returns "" if path == root -def get_page_name_from_path(path: str, root: str): - if(path == root): - return "" - if(os.path.isdir(path)): # Assume index.md if path is dir - path += "/index.md" - path_arr = path.split('/') - page_name = get_prefix(path, root) - file_name = basename(path) - if(file_name == "index.md"): - page_name += path_arr[-2] - else: - page_name += file_name - return page_name.strip('.md') - -# Returns the page name of the parent of the file in path. Returns default value if no parent exists i system -# Returns "" if path == root -def get_parent_name_from_path(path: str, root: str, default="Overview"): - if(path == root): - return "" - if("settings.json" in os.listdir(root)): - settings = json.load(open(root + "/settings.json")) - if("parent_page" in settings.keys()): - default = settings["parent_page"] - if(os.path.isdir(path)): # Assume index.md if path is dir - path += "/index.md" - - path_arr = path.split('/') - file_name = basename(path) - parent_name = "" - - if(file_name == "index.md"): - parent_path = dirname(dirname(path)) - else: - parent_path = dirname(path) - if(parent_path != root): - parent_name = get_page_name_from_path(parent_path, root) - else: - parent_name = default - return parent_name - - -def get_all_md_paths(root: str): - paths = [] - def traverse(directory): - for filename in os.listdir(directory): - f = os.path.join(directory, filename) - # checking if it is a file - if(os.path.isdir(f)): - traverse(f) - if(f.endswith('.md')): - paths.append(f) - traverse(root) - return paths - -def get_all_page_names_in_filesystem(root: str): - page_names = [] - for path in get_all_md_paths(root): - name = (get_page_name_from_path(path, root)) - print(name) - page_names.append(name) - return page_names +import os, json +from posixpath import basename, dirname + +# Returns "" if path == root +def get_prefix(path: str, root: str) -> str: + if(not os.path.exists(path)): + raise FileNotFoundError(path) + if(not os.path.exists(root)): + raise FileNotFoundError(root) + if(path == root): + return "" + if(path.endswith("index.md") and "prefix.txt" in os.listdir(dirname(path))): # No prefix for index page in folder with prefix.txt (prefix is only for underpages) + return "" + if(path.endswith("index.md") and dirname(path) == root): + return "" + if(os.path.isfile(path)): + path = os.path.dirname(path) + else: + if("prefix.txt" in os.listdir(path)): # assume index.md, No prefix for index page in folder with prefix.txt (prefix is only for underpages) + return "" + while("prefix.txt" not in os.listdir(path)): + path = os.path.dirname(path) + if(path == root or path == "" or path == os.sep): + return "" + with open(f"{path}/prefix.txt", 'r') as f: + return f.readline() + +# Returns "" if path == root +def get_page_name_from_path(path: str, root: str): + if(path == root): + return "" + if(os.path.isdir(path)): # Assume index.md if path is dir + path += "/index.md" + path_arr = path.split('/') + page_name = get_prefix(path, root) + file_name = basename(path) + if(file_name == "index.md"): + page_name += path_arr[-2] + else: + page_name += file_name + return page_name.strip('.md') + +# Returns the page name of the parent of the file in path. Returns default value if no parent exists i system +# Returns "" if path == root +def get_parent_name_from_path(path: str, root: str, default="Overview"): + if(path == root): + return "" + if("settings.json" in os.listdir(root)): + settings = json.load(open(root + "/settings.json")) + if("parent_page" in settings.keys()): + default = settings["parent_page"] + if(os.path.isdir(path)): # Assume index.md if path is dir + path += "/index.md" + + path_arr = path.split('/') + file_name = basename(path) + parent_name = "" + + if(file_name == "index.md"): + parent_path = dirname(dirname(path)) + else: + parent_path = dirname(path) + if(parent_path != root): + parent_name = get_page_name_from_path(parent_path, root) + else: + parent_name = default + return parent_name + + +def get_all_md_paths(root: str): + paths = [] + def traverse(directory): + for filename in os.listdir(directory): + f = os.path.join(directory, filename) + # checking if it is a file + if(os.path.isdir(f)): + traverse(f) + if(f.endswith('.md')): + paths.append(f) + traverse(root) + return paths + +def get_all_page_names_in_filesystem(root: str): + page_names = [] + for path in get_all_md_paths(root): + name = (get_page_name_from_path(path, root)) + page_names.append(name) + return page_names + diff --git a/MarkdownToConfluence/filetools/paths.py b/MarkdownToConfluence/utils/paths.py similarity index 100% rename from MarkdownToConfluence/filetools/paths.py rename to MarkdownToConfluence/utils/paths.py diff --git a/MarkdownToConfluence/file_parsing/tests/__init__.py b/MarkdownToConfluence/utils/tests/__init__.py similarity index 100% rename from MarkdownToConfluence/file_parsing/tests/__init__.py rename to MarkdownToConfluence/utils/tests/__init__.py diff --git a/MarkdownToConfluence/modules/image/tests/test_image_parser.py b/MarkdownToConfluence/utils/tests/test_image_parser.py similarity index 64% rename from MarkdownToConfluence/modules/image/tests/test_image_parser.py rename to MarkdownToConfluence/utils/tests/test_image_parser.py index 77f3ad8..ee34859 100644 --- a/MarkdownToConfluence/modules/image/tests/test_image_parser.py +++ b/MarkdownToConfluence/utils/tests/test_image_parser.py @@ -1,16 +1,24 @@ -from MarkdownToConfluence.modules.image.image_parser import run +from MarkdownToConfluence.utils.image_parser import run +from MarkdownToConfluence import globals import os, pathlib def test_convert_md_img_to_confluence_img(): + globals.init() root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' - filepath = f'{root}/images/markdown/image.md' - run(filepath) - with open("testfile.md", "r") as f: + filepath = f'{root}/markdown/image.md' + test_path = filepath.replace('.md', '_test.md') + print(test_path) + with open(filepath, 'r') as i, open(test_path, 'w') as o: + lines = i.readlines() + for line in lines: + o.write(line) + run(test_path) + with open(test_path, "r") as f: assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="alt"/></ac:image>' - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="alt"/></ac:image>' - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="alt"/></ac:image>' - #os.remove("testfile.md") + assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' + assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' + assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' + os.remove(test_path) \ No newline at end of file diff --git a/MarkdownToConfluence/filetools/tests/test_page_file_info.py b/MarkdownToConfluence/utils/tests/test_page_file_info.py similarity index 85% rename from MarkdownToConfluence/filetools/tests/test_page_file_info.py rename to MarkdownToConfluence/utils/tests/test_page_file_info.py index 6e214cd..03c2396 100644 --- a/MarkdownToConfluence/filetools/tests/test_page_file_info.py +++ b/MarkdownToConfluence/utils/tests/test_page_file_info.py @@ -1,90 +1,90 @@ -import pathlib -import pytest -import collections -import os -from MarkdownToConfluence.filetools.page_file_info import get_page_name_from_path, get_parent_name_from_path, get_prefix, get_all_md_paths, get_all_page_names_in_filesystem - -def test_get_prefix(): - root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' - test_path=f'{root}/page 1/index.md' - assert type(get_prefix(test_path, root)) is str - assert get_prefix(test_path, root) == "" - test_path=f'{root}/page 1' - assert type(get_prefix(test_path, root)) is str - assert get_prefix(test_path, root) == "" - test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/index.md' - assert type(get_prefix(test_path, root)) is str - assert get_prefix(test_path, root) == "DC5.0.0 " - test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md' - assert type(get_prefix(test_path, root)) is str - assert get_prefix(test_path, root) == "DC5.0.0 " - assert type(get_prefix(test_path, root)) is str - assert get_prefix(root, root) == "" - with pytest.raises(FileNotFoundError): - get_prefix("path/that/dont/exists.md", root) - with pytest.raises(FileNotFoundError): - get_prefix(f'{root}/page 1/index.md', 'path/that/dont/exist') - -def test_get_page_name_from_path(): - root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' - test_path=f'{root}/page 1/index.md' - assert type(get_page_name_from_path(test_path, root)) is str - assert get_page_name_from_path(test_path, root) == 'page 1' - test_path=f'{root}/page 1' - assert type(get_page_name_from_path(test_path, root)) is str - assert get_page_name_from_path(test_path, root) == 'page 1' - test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/index.md' - assert type(get_page_name_from_path(test_path, root)) is str - assert get_page_name_from_path(test_path, root) == 'DC5.0.0 5 Security' - test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md' - assert type(get_page_name_from_path(test_path, root)) is str - assert get_page_name_from_path(test_path, root) == 'DC5.0.0 Configuring CORS' - test_path=root - assert type(get_page_name_from_path(test_path, root)) is str - assert get_page_name_from_path(test_path, root) == '' - with pytest.raises(FileNotFoundError): - get_page_name_from_path("path/that/dont/exists.md", root) - with pytest.raises(FileNotFoundError): - get_page_name_from_path(f'{root}/page 1/index.md', 'path/that/dont/exist') - -def test_get_parent_name_from_path(): - root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' - test_path=f'{root}/page 1/index.md' - assert type(get_parent_name_from_path(test_path, root)) is str - assert get_parent_name_from_path(test_path, root) == "parent page test name" - test_path=f'{root}/page 1' - assert type(get_parent_name_from_path(test_path, root)) is str - assert get_parent_name_from_path(test_path, root) == "parent page test name" - test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/index.md' - assert type(get_parent_name_from_path(test_path, root)) is str - assert get_parent_name_from_path(test_path, root) == 'DC 5.0' - test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md' - assert type(get_parent_name_from_path(test_path, root)) is str - assert get_parent_name_from_path(test_path, root) == 'DC5.0.0 5 Security' - assert type(get_parent_name_from_path(root, root)) is str - assert get_parent_name_from_path(root, root) == '' - with pytest.raises(FileNotFoundError): - get_parent_name_from_path("path/that/dont/exists.md", root) - with pytest.raises(FileNotFoundError): - get_parent_name_from_path(f'{root}/page 1/index.md', 'path/that/dont/exist') - -def test_get_all_md_paths(): - root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' - testpaths=[f'{root}/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md', f'{root}/DAM Center 5/DC 5.0/5 Security/index.md', - f'{root}/DAM Center 5/DC 5.0/index.md', f'{root}/DAM Center 5/index.md', f'{root}/page 1/index.md', f'{root}/page 1/page 1.1/index.md', - f'{root}/page 1/page 1.1/abe.md'] - paths = get_all_md_paths(root) - assert type(paths) is list - abspaths = [os.path.abspath(path) for path in paths] - abstestpaths = [os.path.abspath(path) for path in testpaths] - assert collections.Counter(abspaths) == collections.Counter(abstestpaths) - for path in abspaths: - assert os.path.exists(path) - -def test_get_all_page_names_in_filesystem(): - root= str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' - testnames = ['DC5.0.0 5 Security', 'DC5.0.0 Configuring CORS', 'DC 5.0', 'DAM Center 5', 'page 1', 'page 1.1', 'abe'] - names = get_all_page_names_in_filesystem(root) - assert type(names) is list - assert collections.Counter(names) == collections.Counter(testnames) +import pathlib +import pytest +import collections +import os +from MarkdownToConfluence.utils.page_file_info import get_page_name_from_path, get_parent_name_from_path, get_prefix, get_all_md_paths, get_all_page_names_in_filesystem + +def test_get_prefix(): + root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' + test_path=f'{root}/page 1/index.md' + assert type(get_prefix(test_path, root)) is str + assert get_prefix(test_path, root) == "" + test_path=f'{root}/page 1' + assert type(get_prefix(test_path, root)) is str + assert get_prefix(test_path, root) == "" + test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/index.md' + assert type(get_prefix(test_path, root)) is str + assert get_prefix(test_path, root) == "DC5.0.0 " + test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md' + assert type(get_prefix(test_path, root)) is str + assert get_prefix(test_path, root) == "DC5.0.0 " + assert type(get_prefix(test_path, root)) is str + assert get_prefix(root, root) == "" + with pytest.raises(FileNotFoundError): + get_prefix("path/that/dont/exists.md", root) + with pytest.raises(FileNotFoundError): + get_prefix(f'{root}/page 1/index.md', 'path/that/dont/exist') + +def test_get_page_name_from_path(): + root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' + test_path=f'{root}/page 1/index.md' + assert type(get_page_name_from_path(test_path, root)) is str + assert get_page_name_from_path(test_path, root) == 'page 1' + test_path=f'{root}/page 1' + assert type(get_page_name_from_path(test_path, root)) is str + assert get_page_name_from_path(test_path, root) == 'page 1' + test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/index.md' + assert type(get_page_name_from_path(test_path, root)) is str + assert get_page_name_from_path(test_path, root) == 'DC5.0.0 5 Security' + test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md' + assert type(get_page_name_from_path(test_path, root)) is str + assert get_page_name_from_path(test_path, root) == 'DC5.0.0 Configuring CORS' + test_path=root + assert type(get_page_name_from_path(test_path, root)) is str + assert get_page_name_from_path(test_path, root) == '' + with pytest.raises(FileNotFoundError): + get_page_name_from_path("path/that/dont/exists.md", root) + with pytest.raises(FileNotFoundError): + get_page_name_from_path(f'{root}/page 1/index.md', 'path/that/dont/exist') + +def test_get_parent_name_from_path(): + root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' + test_path=f'{root}/page 1/index.md' + assert type(get_parent_name_from_path(test_path, root)) is str + assert get_parent_name_from_path(test_path, root) == "parent page test name" + test_path=f'{root}/page 1' + assert type(get_parent_name_from_path(test_path, root)) is str + assert get_parent_name_from_path(test_path, root) == "parent page test name" + test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/index.md' + assert type(get_parent_name_from_path(test_path, root)) is str + assert get_parent_name_from_path(test_path, root) == 'DC 5.0' + test_path=f'{root}/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md' + assert type(get_parent_name_from_path(test_path, root)) is str + assert get_parent_name_from_path(test_path, root) == 'DC5.0.0 5 Security' + assert type(get_parent_name_from_path(root, root)) is str + assert get_parent_name_from_path(root, root) == '' + with pytest.raises(FileNotFoundError): + get_parent_name_from_path("path/that/dont/exists.md", root) + with pytest.raises(FileNotFoundError): + get_parent_name_from_path(f'{root}/page 1/index.md', 'path/that/dont/exist') + +def test_get_all_md_paths(): + root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/DAM Center 5' + testpaths=[f'{root}/DC 5.0/5 Security/Configuring CORS.md', f'{root}/DC 5.0/5 Security/index.md', + f'{root}/DC 5.0/index.md', f'{root}/index.md'] + paths = get_all_md_paths(root) + assert type(paths) is list + abspaths = [os.path.abspath(path) for path in paths] + abstestpaths = [os.path.abspath(path) for path in testpaths] + assert collections.Counter(abspaths) == collections.Counter(abstestpaths) + for path in abspaths: + assert os.path.exists(path) + +def test_get_all_page_names_in_filesystem(): + root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs/DAM Center 5' + print(root) + testnames = ['DC5.0.0 5 Security', 'DC5.0.0 Configuring CORS', 'DC 5.0', 'DAM Center 5'] + names = get_all_page_names_in_filesystem(root) + assert type(names) is list + assert collections.Counter(names) == collections.Counter(testnames) assert len(names) == len(set(names)) \ No newline at end of file diff --git a/MarkdownToConfluence/filetools/tests/test_paths.py b/MarkdownToConfluence/utils/tests/test_paths.py similarity index 73% rename from MarkdownToConfluence/filetools/tests/test_paths.py rename to MarkdownToConfluence/utils/tests/test_paths.py index 9b73fc6..8b6fa1b 100644 --- a/MarkdownToConfluence/filetools/tests/test_paths.py +++ b/MarkdownToConfluence/utils/tests/test_paths.py @@ -1,11 +1,11 @@ from posixpath import dirname -from MarkdownToConfluence.filetools.paths import get_abs_path_from_relative +from MarkdownToConfluence.utils.paths import get_abs_path_from_relative import pathlib, os def test_get_abs_path_from_relative(): source_path =str(pathlib.Path(__file__).resolve()) assert str(get_abs_path_from_relative('./testdocs/page 1/index-1.png', source_path, './MarkdownToConfluence')) == f'{dirname(source_path)}/testdocs/page 1/index-1.png' - assert str(get_abs_path_from_relative('MarkdownToConfluence/filetools/tests/testdocs/page 1/index.md', source_path, './MarkdownToConfluence')) == f'{(dirname(source_path))}/testdocs/page 1/index.md' + assert str(get_abs_path_from_relative('MarkdownToConfluence/utils/tests/testdocs/page 1/index.md', source_path, './MarkdownToConfluence')) == f'{(dirname(source_path))}/testdocs/page 1/index.md' assert str(get_abs_path_from_relative('../DAM Center 5/index.md', f'{dirname(source_path)}/testdocs/page 1/index.md', './MarkdownToConfluence')) == f'{dirname(source_path)}/testdocs/DAM Center 5/index.md' diff --git a/MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md b/MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md similarity index 100% rename from MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md rename to MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/DC 5.0/5 Security/Configuring CORS.md diff --git a/MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/DC 5.0/5 Security/index.md b/MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/DC 5.0/5 Security/index.md similarity index 100% rename from MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/DC 5.0/5 Security/index.md rename to MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/DC 5.0/5 Security/index.md diff --git a/MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/DC 5.0/index.md b/MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/DC 5.0/index.md similarity index 100% rename from MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/DC 5.0/index.md rename to MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/DC 5.0/index.md diff --git a/MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/DC 5.0/prefix.txt b/MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/DC 5.0/prefix.txt similarity index 100% rename from MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/DC 5.0/prefix.txt rename to MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/DC 5.0/prefix.txt diff --git a/MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/index.md b/MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/index.md similarity index 100% rename from MarkdownToConfluence/filetools/tests/testdocs/DAM Center 5/index.md rename to MarkdownToConfluence/utils/tests/testdocs/DAM Center 5/index.md diff --git a/MarkdownToConfluence/file_parsing/tests/testdocs/images/attachments/image.png b/MarkdownToConfluence/utils/tests/testdocs/attachments/image.png similarity index 100% rename from MarkdownToConfluence/file_parsing/tests/testdocs/images/attachments/image.png rename to MarkdownToConfluence/utils/tests/testdocs/attachments/image.png diff --git a/MarkdownToConfluence/utils/tests/testdocs/markdown/image.md b/MarkdownToConfluence/utils/tests/testdocs/markdown/image.md new file mode 100644 index 0000000..02a9dda --- /dev/null +++ b/MarkdownToConfluence/utils/tests/testdocs/markdown/image.md @@ -0,0 +1,6 @@ +![alt](../attachments/image.png "title") +![alt](./image.png "title") +![alt](MarkdownToConfluence/utils/tests/testdocs/attachments/image.png "title") +![alt](../attachments/image.png) +![alt](./image.png) +![alt](MarkdownToConfluence/utils/tests/testdocs/attachments/image.png) \ No newline at end of file diff --git a/MarkdownToConfluence/file_parsing/tests/testdocs/images/markdown/image.png b/MarkdownToConfluence/utils/tests/testdocs/markdown/image.png similarity index 100% rename from MarkdownToConfluence/file_parsing/tests/testdocs/images/markdown/image.png rename to MarkdownToConfluence/utils/tests/testdocs/markdown/image.png diff --git a/MarkdownToConfluence/filetools/tests/__init__.py b/MarkdownToConfluence/utils/tests/testdocs/markdown/image_test.md similarity index 100% rename from MarkdownToConfluence/filetools/tests/__init__.py rename to MarkdownToConfluence/utils/tests/testdocs/markdown/image_test.md diff --git a/MarkdownToConfluence/filetools/tests/testdocs/page 1/index-1.png b/MarkdownToConfluence/utils/tests/testdocs/page 1/index-1.png similarity index 100% rename from MarkdownToConfluence/filetools/tests/testdocs/page 1/index-1.png rename to MarkdownToConfluence/utils/tests/testdocs/page 1/index-1.png diff --git a/MarkdownToConfluence/filetools/tests/testdocs/page 1/index.md b/MarkdownToConfluence/utils/tests/testdocs/page 1/index.md similarity index 96% rename from MarkdownToConfluence/filetools/tests/testdocs/page 1/index.md rename to MarkdownToConfluence/utils/tests/testdocs/page 1/index.md index 4bd886a..407d7dd 100644 --- a/MarkdownToConfluence/filetools/tests/testdocs/page 1/index.md +++ b/MarkdownToConfluence/utils/tests/testdocs/page 1/index.md @@ -1,3 +1,3 @@ -# this is a page 1 - +# this is a page 1 + IF THIS WORK I GO BEAT MY MEAT \ No newline at end of file diff --git a/MarkdownToConfluence/filetools/tests/testdocs/page 1/page 1.1/abe.md b/MarkdownToConfluence/utils/tests/testdocs/page 1/page 1.1/abe.md similarity index 100% rename from MarkdownToConfluence/filetools/tests/testdocs/page 1/page 1.1/abe.md rename to MarkdownToConfluence/utils/tests/testdocs/page 1/page 1.1/abe.md diff --git a/MarkdownToConfluence/filetools/tests/testdocs/page 1/page 1.1/index.md b/MarkdownToConfluence/utils/tests/testdocs/page 1/page 1.1/index.md similarity index 100% rename from MarkdownToConfluence/filetools/tests/testdocs/page 1/page 1.1/index.md rename to MarkdownToConfluence/utils/tests/testdocs/page 1/page 1.1/index.md diff --git a/MarkdownToConfluence/filetools/tests/testdocs/settings.json b/MarkdownToConfluence/utils/tests/testdocs/settings.json similarity index 95% rename from MarkdownToConfluence/filetools/tests/testdocs/settings.json rename to MarkdownToConfluence/utils/tests/testdocs/settings.json index 35ce7dc..79b4214 100644 --- a/MarkdownToConfluence/filetools/tests/testdocs/settings.json +++ b/MarkdownToConfluence/utils/tests/testdocs/settings.json @@ -1,3 +1,3 @@ -{ - "parent_page": "parent page test name" +{ + "parent_page": "parent page test name" } \ No newline at end of file diff --git a/documentation/page 2/index.md b/documentation/page 2/index.md index 2ea24c7..7bf8512 100644 --- a/documentation/page 2/index.md +++ b/documentation/page 2/index.md @@ -1,2 +1,4 @@ # this is a page 2 -This change is only thing i push \ No newline at end of file +This change is only thing i push +BAC-74 +this ticket, BAC-77, is within a line \ No newline at end of file diff --git a/documentation/settings.json b/documentation/settings.json index 94cad70..b77cbff 100644 --- a/documentation/settings.json +++ b/documentation/settings.json @@ -2,6 +2,6 @@ "parent_page": "Overview", "modules": { "mermaid": true, - "image": true + "jira-tickets": true } } \ No newline at end of file From 655fdbfae32c0e458d5d507543b9cb97cdd4d348 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 27 Apr 2022 23:14:09 +0200 Subject: [PATCH 02/72] jira tickets --- MarkdownToConfluence/utils/image_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MarkdownToConfluence/utils/image_parser.py b/MarkdownToConfluence/utils/image_parser.py index f8602a8..b8328b8 100644 --- a/MarkdownToConfluence/utils/image_parser.py +++ b/MarkdownToConfluence/utils/image_parser.py @@ -1,7 +1,7 @@ from posixpath import dirname, basename import re, os from MarkdownToConfluence.utils import get_abs_path_from_relative -import globals +from MarkdownToConfluence import globals from PIL import Image From c56857e4e371299531fc34d2ad5a7f5ecef6470c Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 27 Apr 2022 23:25:53 +0200 Subject: [PATCH 03/72] jira tickets --- MarkdownToConfluence/utils/image_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MarkdownToConfluence/utils/image_parser.py b/MarkdownToConfluence/utils/image_parser.py index b8328b8..33e61d9 100644 --- a/MarkdownToConfluence/utils/image_parser.py +++ b/MarkdownToConfluence/utils/image_parser.py @@ -1,7 +1,7 @@ from posixpath import dirname, basename import re, os from MarkdownToConfluence.utils import get_abs_path_from_relative -from MarkdownToConfluence import globals +import MarkdownToConfluence.globals as globals from PIL import Image From 750a260adcbb989f347bd284b6e9d0186e15a09f Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 27 Apr 2022 23:29:36 +0200 Subject: [PATCH 04/72] jira tickets --- MarkdownToConfluence/utils/image_parser.py | 2 +- .../utils/tests/test_image_parser.py | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/MarkdownToConfluence/utils/image_parser.py b/MarkdownToConfluence/utils/image_parser.py index 33e61d9..f8602a8 100644 --- a/MarkdownToConfluence/utils/image_parser.py +++ b/MarkdownToConfluence/utils/image_parser.py @@ -1,7 +1,7 @@ from posixpath import dirname, basename import re, os from MarkdownToConfluence.utils import get_abs_path_from_relative -import MarkdownToConfluence.globals as globals +import globals from PIL import Image diff --git a/MarkdownToConfluence/utils/tests/test_image_parser.py b/MarkdownToConfluence/utils/tests/test_image_parser.py index ee34859..5e28064 100644 --- a/MarkdownToConfluence/utils/tests/test_image_parser.py +++ b/MarkdownToConfluence/utils/tests/test_image_parser.py @@ -1,24 +1,24 @@ -from MarkdownToConfluence.utils.image_parser import run -from MarkdownToConfluence import globals -import os, pathlib +# from MarkdownToConfluence.utils.image_parser import run +# from MarkdownToConfluence import globals +# import os, pathlib -def test_convert_md_img_to_confluence_img(): - globals.init() - root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' - filepath = f'{root}/markdown/image.md' - test_path = filepath.replace('.md', '_test.md') - print(test_path) - with open(filepath, 'r') as i, open(test_path, 'w') as o: - lines = i.readlines() - for line in lines: - o.write(line) - run(test_path) - with open(test_path, "r") as f: - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' - assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' - os.remove(test_path) +# def test_convert_md_img_to_confluence_img(): +# globals.init() +# root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' +# filepath = f'{root}/markdown/image.md' +# test_path = filepath.replace('.md', '_test.md') +# print(test_path) +# with open(filepath, 'r') as i, open(test_path, 'w') as o: +# lines = i.readlines() +# for line in lines: +# o.write(line) +# run(test_path) +# with open(test_path, "r") as f: +# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' +# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' +# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' +# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' +# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' +# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' +# os.remove(test_path) \ No newline at end of file From 877918c691589aa07784cf750a5ed787879dcf30 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 27 Apr 2022 23:32:19 +0200 Subject: [PATCH 05/72] jira tickets --- .../utils/tests/test_image_parser.py | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 MarkdownToConfluence/utils/tests/test_image_parser.py diff --git a/MarkdownToConfluence/utils/tests/test_image_parser.py b/MarkdownToConfluence/utils/tests/test_image_parser.py deleted file mode 100644 index 5e28064..0000000 --- a/MarkdownToConfluence/utils/tests/test_image_parser.py +++ /dev/null @@ -1,24 +0,0 @@ -# from MarkdownToConfluence.utils.image_parser import run -# from MarkdownToConfluence import globals -# import os, pathlib - -# def test_convert_md_img_to_confluence_img(): -# globals.init() -# root=str(pathlib.Path(__file__).parent.resolve()) + '/testdocs' -# filepath = f'{root}/markdown/image.md' -# test_path = filepath.replace('.md', '_test.md') -# print(test_path) -# with open(filepath, 'r') as i, open(test_path, 'w') as o: -# lines = i.readlines() -# for line in lines: -# o.write(line) -# run(test_path) -# with open(test_path, "r") as f: -# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' -# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' -# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="title"/></ac:image>' -# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' -# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' -# assert f.readline().strip('\n') == '<ac:image ac:original-height="144" ac:original-width="70"><ri:attachment ri:filename="image.png"/></ac:image>' -# os.remove(test_path) - \ No newline at end of file From 671f683e483d72b38a16cd5b194c5de695a081d4 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Thu, 28 Apr 2022 12:03:41 +0200 Subject: [PATCH 06/72] attachment links --- .github/workflows/test.yaml | 5 +-- MarkdownToConfluence/__init__.py | 2 +- .../modules/attachment_link/__init__.py | 1 + .../attachment_link/parse_attachment_links.py | 30 ++++++++++++++++++ .../modules/attachment_link/tests/__init__.py | 0 .../tests/test_parse_attachment_links.py | 15 +++++++++ .../attachment_link/tests/zip_test.zip | Bin 0 -> 504 bytes MarkdownToConfluence/utils/__init__.py | 9 +----- MarkdownToConfluence/utils/image_parser.py | 2 +- documentation/page 3/index.md | 4 ++- documentation/page 3/zip_test.zip | Bin 0 -> 504 bytes 11 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 MarkdownToConfluence/modules/attachment_link/__init__.py create mode 100644 MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py create mode 100644 MarkdownToConfluence/modules/attachment_link/tests/__init__.py create mode 100644 MarkdownToConfluence/modules/attachment_link/tests/test_parse_attachment_links.py create mode 100644 MarkdownToConfluence/modules/attachment_link/tests/zip_test.zip create mode 100644 documentation/page 3/zip_test.zip diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c257c9f..2aa2784 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,9 +2,6 @@ name: Run PyTest on: [push] -permissions: - contents: read - jobs: build: runs-on: ubuntu-latest @@ -30,4 +27,4 @@ jobs: run: | . venv/bin/activate pip install -e . - pytest -v \ No newline at end of file + python3 -m pytest -v \ No newline at end of file diff --git a/MarkdownToConfluence/__init__.py b/MarkdownToConfluence/__init__.py index 6fefa02..61dc199 100644 --- a/MarkdownToConfluence/__init__.py +++ b/MarkdownToConfluence/__init__.py @@ -1 +1 @@ -__all__ = ['utils', 'modules', 'confluence'] \ No newline at end of file +__all__ = ['utils', 'modules', 'confluence', 'globals'] \ No newline at end of file diff --git a/MarkdownToConfluence/modules/attachment_link/__init__.py b/MarkdownToConfluence/modules/attachment_link/__init__.py new file mode 100644 index 0000000..ecdda3d --- /dev/null +++ b/MarkdownToConfluence/modules/attachment_link/__init__.py @@ -0,0 +1 @@ +from .parse_attachment_links import run, convert_all_md_attachment_links_to_confluence_attachment_links, convert_md_attachment_links_to_confluence_attachment_links \ No newline at end of file diff --git a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py new file mode 100644 index 0000000..5c8a334 --- /dev/null +++ b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py @@ -0,0 +1,30 @@ +from os import link +from posixpath import dirname, basename +import re +from MarkdownToConfluence.utils.paths import get_abs_path_from_relative +import MarkdownToConfluence.globals + +def convert_all_md_attachment_links_to_confluence_attachment_links(filename): + with open(filename, 'r') as f: + lines = f.readlines() + with open(filename, 'w') as f: + for line in lines: + res = convert_md_attachment_links_to_confluence_attachment_links(line, filename) + f.write(res) + +def convert_md_attachment_links_to_confluence_attachment_links(line: str, md_path: str): + links = re.findall(r'(!\[(?P<alt>[^\]]*)\]\((?P<filename>.*?)(?=\"|\))(\"(?P<title>.*)\")?\))', line) + new_line = line + print(links) + for link in links: + if(link != None and not (link[2].strip().endswith('.png') or link[2].strip().endswith('.jpg'))): + path = get_abs_path_from_relative(link[2], md_path) + name = link[4] if link[4] != '' else basename(link[2]) + MarkdownToConfluence.globals.attachments.append((name, path)) + new_line = new_line.replace(link[0], f'<p class=\"media-group\"><ac:structured-macro ac:name=\"view-file\" ac:schema-version=\"1\" ac:macro-id=\"ce17b5c6-cfe6-4a77-92aa-7b810863f634\"><ac:parameter ac:name=\"name\"><ri:attachment ri:filename="{name}" ri:version-at-save=\"2\" /></ac:parameter></ac:structured-macro></p><p />') + return new_line + +def run(filename): + return convert_all_md_attachment_links_to_confluence_attachment_links(filename) + + diff --git a/MarkdownToConfluence/modules/attachment_link/tests/__init__.py b/MarkdownToConfluence/modules/attachment_link/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/MarkdownToConfluence/modules/attachment_link/tests/test_parse_attachment_links.py b/MarkdownToConfluence/modules/attachment_link/tests/test_parse_attachment_links.py new file mode 100644 index 0000000..412f419 --- /dev/null +++ b/MarkdownToConfluence/modules/attachment_link/tests/test_parse_attachment_links.py @@ -0,0 +1,15 @@ +from MarkdownToConfluence.modules.attachment_link import convert_md_attachment_links_to_confluence_attachment_links +import MarkdownToConfluence.globals +import pytest, pathlib + +@pytest.fixture(autouse=True) +def run_before(): + MarkdownToConfluence.globals.init() + yield + MarkdownToConfluence.globals.init() + +def test_convert_md_attachment_links_to_confluence_attachment_links(): + root = str(pathlib.Path(__file__).parent.resolve()) + assert convert_md_attachment_links_to_confluence_attachment_links('![test](./zip_test.zip)', root) == '<p class=\"media-group\"><ac:structured-macro ac:name=\"view-file\" ac:schema-version=\"1\" ac:macro-id=\"ce17b5c6-cfe6-4a77-92aa-7b810863f634\"><ac:parameter ac:name=\"name\"><ri:attachment ri:filename="zip_test.zip" ri:version-at-save=\"2\" /></ac:parameter></ac:structured-macro></p><p />' + assert len(MarkdownToConfluence.globals.attachments) == 1 + assert MarkdownToConfluence.globals.attachments[0] == ('zip_test.zip', f'{root}/zip_test.zip') \ No newline at end of file diff --git a/MarkdownToConfluence/modules/attachment_link/tests/zip_test.zip b/MarkdownToConfluence/modules/attachment_link/tests/zip_test.zip new file mode 100644 index 0000000000000000000000000000000000000000..a01abc1416a5ab70baf8bbb738539123c0bc7f5e GIT binary patch literal 504 zcmWIWW@Zs#00BY!IU!&Ml;8x?Rhb3xC8@<F`T;;?Twn=wWlG4({3=TnN>a0nOH%T) zOLJ56N)$AVH1$d<N)Y<_(X5ffs~@75k;$F`mm^icu3}&ifYNX$b1^7@g%}wm7@qgM z-F77E1|y8FTl0Axh#%k$G8&i1U`B(?Q3qnU(Kx+{&rX=#$aZ1|2C|*$c<lrQ4YGaV dt)W{$enO`Myjj_R1~D)Lp*<r5!(tGJ0RSh*a}59h literal 0 HcmV?d00001 diff --git a/MarkdownToConfluence/utils/__init__.py b/MarkdownToConfluence/utils/__init__.py index 8474995..4b0bc20 100644 --- a/MarkdownToConfluence/utils/__init__.py +++ b/MarkdownToConfluence/utils/__init__.py @@ -1,8 +1 @@ -__all__ = ["page_file_info", "file_traversal", 'image'] -from .page_file_info import get_prefix -from .page_file_info import get_page_name_from_path -from .page_file_info import get_parent_name_from_path -from .page_file_info import get_all_md_paths -from .page_file_info import get_all_page_names_in_filesystem -from .paths import get_abs_path_from_relative -from .image_parser import convert_all_md_img_to_confluence_img \ No newline at end of file +__all__ = ["page_file_info", "file_traversal", 'attachment_link'] diff --git a/MarkdownToConfluence/utils/image_parser.py b/MarkdownToConfluence/utils/image_parser.py index f8602a8..b8328b8 100644 --- a/MarkdownToConfluence/utils/image_parser.py +++ b/MarkdownToConfluence/utils/image_parser.py @@ -1,7 +1,7 @@ from posixpath import dirname, basename import re, os from MarkdownToConfluence.utils import get_abs_path_from_relative -import globals +from MarkdownToConfluence import globals from PIL import Image diff --git a/documentation/page 3/index.md b/documentation/page 3/index.md index 5f8483c..21930ef 100644 --- a/documentation/page 3/index.md +++ b/documentation/page 3/index.md @@ -2,4 +2,6 @@ ```mermaid graph A[start] --> B[end] -``` \ No newline at end of file +``` + +![test]("./zip_test.zip") \ No newline at end of file diff --git a/documentation/page 3/zip_test.zip b/documentation/page 3/zip_test.zip new file mode 100644 index 0000000000000000000000000000000000000000..a01abc1416a5ab70baf8bbb738539123c0bc7f5e GIT binary patch literal 504 zcmWIWW@Zs#00BY!IU!&Ml;8x?Rhb3xC8@<F`T;;?Twn=wWlG4({3=TnN>a0nOH%T) zOLJ56N)$AVH1$d<N)Y<_(X5ffs~@75k;$F`mm^icu3}&ifYNX$b1^7@g%}wm7@qgM z-F77E1|y8FTl0Axh#%k$G8&i1U`B(?Q3qnU(Kx+{&rX=#$aZ1|2C|*$c<lrQ4YGaV dt)W{$enO`Myjj_R1~D)Lp*<r5!(tGJ0RSh*a}59h literal 0 HcmV?d00001 From 4a1ba97436b10b8b9585661de583a62581dd9ba6 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Thu, 28 Apr 2022 12:24:58 +0200 Subject: [PATCH 07/72] attachment links --- MarkdownToConfluence/modules/__init__.py | 2 +- MarkdownToConfluence/utils/image_parser.py | 2 +- documentation/settings.json | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MarkdownToConfluence/modules/__init__.py b/MarkdownToConfluence/modules/__init__.py index 7b69faa..56e2b91 100644 --- a/MarkdownToConfluence/modules/__init__.py +++ b/MarkdownToConfluence/modules/__init__.py @@ -1 +1 @@ -__all__ = ['mermaid', 'jira_tickets'] \ No newline at end of file +__all__ = ['mermaid', 'jira_tickets', 'attachment_link'] \ No newline at end of file diff --git a/MarkdownToConfluence/utils/image_parser.py b/MarkdownToConfluence/utils/image_parser.py index b8328b8..f48b84e 100644 --- a/MarkdownToConfluence/utils/image_parser.py +++ b/MarkdownToConfluence/utils/image_parser.py @@ -24,7 +24,7 @@ def convert_md_img_to_confluence_img(md_image_link: str, md_path: str): width, height = image.size name = img['title'] if img["title"] != None else basename(img['filename']) globals.attachments.append((name, path)) - return(md_image_link.replace(img.string, f'<ac:image ac:original-height="{str(height)}" ac:original-width="{str(width)}"><ri:attachment ri:filename="{name}"/></ac:image>\n')) + return(md_image_link.replace(img.string, f'<ac:image ac:original-height="{str(height)}" ac:original-width="{str(width)}" ac:width=\"100%\"><ri:attachment ri:filename="{name}"/></ac:image>\n')) else: return None diff --git a/documentation/settings.json b/documentation/settings.json index b77cbff..7d1fdeb 100644 --- a/documentation/settings.json +++ b/documentation/settings.json @@ -2,6 +2,7 @@ "parent_page": "Overview", "modules": { "mermaid": true, - "jira-tickets": true + "jira-tickets": true, + "attachment_link": true } } \ No newline at end of file From 6decaa7f53ab61cb7f7c557ed5fb9df403ac25de Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Thu, 28 Apr 2022 12:28:53 +0200 Subject: [PATCH 08/72] attachment links --- MarkdownToConfluence/utils/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MarkdownToConfluence/utils/__init__.py b/MarkdownToConfluence/utils/__init__.py index 4b0bc20..aab56ca 100644 --- a/MarkdownToConfluence/utils/__init__.py +++ b/MarkdownToConfluence/utils/__init__.py @@ -1 +1,5 @@ -__all__ = ["page_file_info", "file_traversal", 'attachment_link'] +__all__ = ["page_file_info", "file_traversal", "paths", "image_parser"] +import paths +import file_traversal +import page_file_info +import image_parser From 9834740975911252a160e790bb585a36888053a0 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Thu, 28 Apr 2022 12:33:03 +0200 Subject: [PATCH 09/72] attachment links --- MarkdownToConfluence/utils/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/MarkdownToConfluence/utils/__init__.py b/MarkdownToConfluence/utils/__init__.py index aab56ca..5137ec8 100644 --- a/MarkdownToConfluence/utils/__init__.py +++ b/MarkdownToConfluence/utils/__init__.py @@ -1,5 +1,4 @@ -__all__ = ["page_file_info", "file_traversal", "paths", "image_parser"] -import paths -import file_traversal -import page_file_info -import image_parser +__all__ = ["page_file_info", "paths", "image_parser"] +from .paths import get_abs_path_from_relative +from .page_file_info import * +from .image_parser import convert_all_md_img_to_confluence_img From d79349059f9e4545085bb49a87b636ba3b8831f9 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Thu, 28 Apr 2022 12:36:55 +0200 Subject: [PATCH 10/72] attachment links --- MarkdownToConfluence/utils/image_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MarkdownToConfluence/utils/image_parser.py b/MarkdownToConfluence/utils/image_parser.py index f48b84e..81fc8f7 100644 --- a/MarkdownToConfluence/utils/image_parser.py +++ b/MarkdownToConfluence/utils/image_parser.py @@ -24,7 +24,7 @@ def convert_md_img_to_confluence_img(md_image_link: str, md_path: str): width, height = image.size name = img['title'] if img["title"] != None else basename(img['filename']) globals.attachments.append((name, path)) - return(md_image_link.replace(img.string, f'<ac:image ac:original-height="{str(height)}" ac:original-width="{str(width)}" ac:width=\"100%\"><ri:attachment ri:filename="{name}"/></ac:image>\n')) + return(md_image_link.replace(img.string, f'<ac:image ac:original-height="{str(height)}" ac:original-width="{str(width)}" ac:width="100%"><ri:attachment ri:filename="{name}"/></ac:image>\n')) else: return None From 2b4500876fa1e4f8edc7ccb806e4f211fdb32925 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Thu, 28 Apr 2022 12:55:21 +0200 Subject: [PATCH 11/72] attachment links --- MarkdownToConfluence/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MarkdownToConfluence/main.py b/MarkdownToConfluence/main.py index c359e9d..1d1f1f3 100644 --- a/MarkdownToConfluence/main.py +++ b/MarkdownToConfluence/main.py @@ -5,7 +5,7 @@ from confluence import update_page_content from confluence import upload_attachment from utils import convert_all_md_img_to_confluence_img -import globals +import MarkdownToConfluence.globals from utils.page_file_info import get_page_name_from_path, get_parent_name_from_path import os import subprocess @@ -94,5 +94,5 @@ def upload_documentation(path_name:str, root:str): if __name__ == "__main__": import sys - globals.init() + MarkdownToConfluence.globals.init() upload_documentation(sys.argv[1], sys.argv[2]) \ No newline at end of file From d73eabd9f9e16c49c0fb6ad8d78f6dd52451110c Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Thu, 28 Apr 2022 13:01:01 +0200 Subject: [PATCH 12/72] attachment links --- MarkdownToConfluence/main.py | 2 +- .../modules/jira_tickets/jira_tickets_parser.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/MarkdownToConfluence/main.py b/MarkdownToConfluence/main.py index 1d1f1f3..679f900 100644 --- a/MarkdownToConfluence/main.py +++ b/MarkdownToConfluence/main.py @@ -85,7 +85,7 @@ def upload_documentation(path_name:str, root:str): print(f"Created {page_name} with {parent_name} as parent") if(response.status_code == 200): - for attachment in globals.attachments: + for attachment in MarkdownToConfluence.globals.attachments: upload_attachment(page_name, attachment[0], attachment[1]) else: print(f"Error uploading {page_name}. Status code {response.status_code}") diff --git a/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py b/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py index a4db91f..51f48d3 100644 --- a/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py +++ b/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py @@ -37,8 +37,6 @@ def check_if_ticket_exists(ticket: str): headers=headers, ) - #print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) - return response.status_code == 200 def run(filename): From c60a62c90f67aadf5a167540c9bb3d738388a452 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 11:00:35 +0200 Subject: [PATCH 13/72] attachment links --- .../modules/attachment_link/parse_attachment_links.py | 2 +- MarkdownToConfluence/utils/image_parser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py index 5c8a334..11c3e3a 100644 --- a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py +++ b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py @@ -15,8 +15,8 @@ def convert_all_md_attachment_links_to_confluence_attachment_links(filename): def convert_md_attachment_links_to_confluence_attachment_links(line: str, md_path: str): links = re.findall(r'(!\[(?P<alt>[^\]]*)\]\((?P<filename>.*?)(?=\"|\))(\"(?P<title>.*)\")?\))', line) new_line = line - print(links) for link in links: + print(link) if(link != None and not (link[2].strip().endswith('.png') or link[2].strip().endswith('.jpg'))): path = get_abs_path_from_relative(link[2], md_path) name = link[4] if link[4] != '' else basename(link[2]) diff --git a/MarkdownToConfluence/utils/image_parser.py b/MarkdownToConfluence/utils/image_parser.py index 81fc8f7..15105f9 100644 --- a/MarkdownToConfluence/utils/image_parser.py +++ b/MarkdownToConfluence/utils/image_parser.py @@ -24,7 +24,7 @@ def convert_md_img_to_confluence_img(md_image_link: str, md_path: str): width, height = image.size name = img['title'] if img["title"] != None else basename(img['filename']) globals.attachments.append((name, path)) - return(md_image_link.replace(img.string, f'<ac:image ac:original-height="{str(height)}" ac:original-width="{str(width)}" ac:width="100%"><ri:attachment ri:filename="{name}"/></ac:image>\n')) + return(md_image_link.replace(img.string, f'<ac:image ac:original-height="{str(height)}" ac:original-width="{str(width)}" ac:width="{str(width)}"><ri:attachment ri:filename="{name}"/></ac:image>\n')) else: return None From a06e7fd07d52677038daec4bfcfda04d7b897a94 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 11:07:31 +0200 Subject: [PATCH 14/72] attachment links --- .../modules/attachment_link/parse_attachment_links.py | 3 +-- MarkdownToConfluence/modules/mermaid/mermaid_parser.py | 4 ++-- documentation/page 3/index.md | 4 ---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py index 11c3e3a..9fbb791 100644 --- a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py +++ b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py @@ -16,8 +16,7 @@ def convert_md_attachment_links_to_confluence_attachment_links(line: str, md_pat links = re.findall(r'(!\[(?P<alt>[^\]]*)\]\((?P<filename>.*?)(?=\"|\))(\"(?P<title>.*)\")?\))', line) new_line = line for link in links: - print(link) - if(link != None and not (link[2].strip().endswith('.png') or link[2].strip().endswith('.jpg'))): + if(not (link[2].strip().endswith('.png') or link[2].strip().endswith('.jpg'))): path = get_abs_path_from_relative(link[2], md_path) name = link[4] if link[4] != '' else basename(link[2]) MarkdownToConfluence.globals.attachments.append((name, path)) diff --git a/MarkdownToConfluence/modules/mermaid/mermaid_parser.py b/MarkdownToConfluence/modules/mermaid/mermaid_parser.py index 1df0114..11d420a 100644 --- a/MarkdownToConfluence/modules/mermaid/mermaid_parser.py +++ b/MarkdownToConfluence/modules/mermaid/mermaid_parser.py @@ -3,7 +3,7 @@ import requests import base64 -def parse_mermaid_macro(filename): +def parse_mermaid_macros(filename): if(os.path.isdir(filename)): filename += "/index_final.md" mermaid_diagram_num = 0 @@ -37,7 +37,7 @@ def parse_mermaid_macro(filename): file.write(line) def run(filename): - return parse_mermaid_macro(filename) + parse_mermaid_macros(filename) #parse_mermaid_macro('./documentation/page 3/index.md') \ No newline at end of file diff --git a/documentation/page 3/index.md b/documentation/page 3/index.md index 21930ef..ed4d8bb 100644 --- a/documentation/page 3/index.md +++ b/documentation/page 3/index.md @@ -1,7 +1,3 @@ # this is page 3 -```mermaid - graph - A[start] --> B[end] -``` ![test]("./zip_test.zip") \ No newline at end of file From 41077f562d9bba2fed237717694bf97a862e006b Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 11:11:22 +0200 Subject: [PATCH 15/72] attachment links --- .../modules/attachment_link/parse_attachment_links.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py index 9fbb791..c4a36d9 100644 --- a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py +++ b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py @@ -16,10 +16,12 @@ def convert_md_attachment_links_to_confluence_attachment_links(line: str, md_pat links = re.findall(r'(!\[(?P<alt>[^\]]*)\]\((?P<filename>.*?)(?=\"|\))(\"(?P<title>.*)\")?\))', line) new_line = line for link in links: + print(link) if(not (link[2].strip().endswith('.png') or link[2].strip().endswith('.jpg'))): path = get_abs_path_from_relative(link[2], md_path) name = link[4] if link[4] != '' else basename(link[2]) MarkdownToConfluence.globals.attachments.append((name, path)) + print(name, path) new_line = new_line.replace(link[0], f'<p class=\"media-group\"><ac:structured-macro ac:name=\"view-file\" ac:schema-version=\"1\" ac:macro-id=\"ce17b5c6-cfe6-4a77-92aa-7b810863f634\"><ac:parameter ac:name=\"name\"><ri:attachment ri:filename="{name}" ri:version-at-save=\"2\" /></ac:parameter></ac:structured-macro></p><p />') return new_line From 12ce5162294db775ed273d0c201edbf2dbfd76d7 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 11:16:23 +0200 Subject: [PATCH 16/72] attachment links --- documentation/page 3/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/page 3/index.md b/documentation/page 3/index.md index ed4d8bb..b0908d4 100644 --- a/documentation/page 3/index.md +++ b/documentation/page 3/index.md @@ -1,3 +1,3 @@ # this is page 3 -![test]("./zip_test.zip") \ No newline at end of file +![test](./zip_test.zip) \ No newline at end of file From 698704699de1b9701c6ceef6b18f9f87ce6d4f40 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 11:22:46 +0200 Subject: [PATCH 17/72] attachment links --- MarkdownToConfluence/utils/paths.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MarkdownToConfluence/utils/paths.py b/MarkdownToConfluence/utils/paths.py index a9cc0db..34c7055 100644 --- a/MarkdownToConfluence/utils/paths.py +++ b/MarkdownToConfluence/utils/paths.py @@ -8,13 +8,13 @@ def get_abs_path_from_relative(relative_path: str, source_path: str, root=os.env relative_path = relative_path.strip() source_path = source_path.strip() abs_path = "" - if(os.path.isabs(relative_path)): + if(os.path.exists(str(os.path.realpath((os.path.join(_root, source_path, relative_path))).strip()))): + abs_path = (os.path.join(_root, source_path, relative_path)).strip() + elif(os.path.isabs(relative_path)): if(os.fspath(relative_path).startswith(os.getcwd())): abs_path = relative_path else: abs_path = os.path.join(_root, relative_path) - elif(os.path.exists(str(os.path.realpath((os.path.join(_root, source_path, relative_path))).strip()))): - abs_path = (os.path.join(_root, source_path, relative_path)).strip() else: abs_path = os.path.abspath(relative_path) #print(source_path, '\n', relative_path, '\n', os.path.realpath(abs_path), '\n') @@ -26,4 +26,6 @@ def get_abs_path_from_relative(relative_path: str, source_path: str, root=os.env # abs_path = os.path.realpath(os.path.join(dirname(source_path), relative_path)) # else: # abs_path = os.path.abspath(relative_path) - return os.path.realpath(abs_path) \ No newline at end of file + return os.path.realpath(abs_path) + +#print(get_abs_path_from_relative('./zip_test.zip', os.path.abspath('./documentation/page 3/index.md'), './documentation')) \ No newline at end of file From e535b3cfaf7d0ace21b0f646dffc41acc139b1a7 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 11:27:02 +0200 Subject: [PATCH 18/72] attachment links --- MarkdownToConfluence/utils/paths.py | 1 + 1 file changed, 1 insertion(+) diff --git a/MarkdownToConfluence/utils/paths.py b/MarkdownToConfluence/utils/paths.py index 34c7055..1b75f88 100644 --- a/MarkdownToConfluence/utils/paths.py +++ b/MarkdownToConfluence/utils/paths.py @@ -3,6 +3,7 @@ def get_abs_path_from_relative(relative_path: str, source_path: str, root=os.environ.get('INPUT_FILESLOCATION')): _root = os.path.abspath(root) + print(relative_path, source_path, _root) if(os.path.isfile(source_path)): source_path = dirname(source_path) relative_path = relative_path.strip() From 0d8acb22c89f17000a521ccebf32750a8bd3cf32 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 11:31:10 +0200 Subject: [PATCH 19/72] attachment links --- MarkdownToConfluence/utils/paths.py | 1 + 1 file changed, 1 insertion(+) diff --git a/MarkdownToConfluence/utils/paths.py b/MarkdownToConfluence/utils/paths.py index 1b75f88..e094a72 100644 --- a/MarkdownToConfluence/utils/paths.py +++ b/MarkdownToConfluence/utils/paths.py @@ -9,6 +9,7 @@ def get_abs_path_from_relative(relative_path: str, source_path: str, root=os.env relative_path = relative_path.strip() source_path = source_path.strip() abs_path = "" + print(str(os.path.realpath((os.path.join(_root, source_path, relative_path))).strip())) if(os.path.exists(str(os.path.realpath((os.path.join(_root, source_path, relative_path))).strip()))): abs_path = (os.path.join(_root, source_path, relative_path)).strip() elif(os.path.isabs(relative_path)): From 8480fe89745bdba77286c182e53be70ed044821f Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 11:36:02 +0200 Subject: [PATCH 20/72] attachment links --- MarkdownToConfluence/utils/paths.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MarkdownToConfluence/utils/paths.py b/MarkdownToConfluence/utils/paths.py index e094a72..41acfe5 100644 --- a/MarkdownToConfluence/utils/paths.py +++ b/MarkdownToConfluence/utils/paths.py @@ -9,9 +9,9 @@ def get_abs_path_from_relative(relative_path: str, source_path: str, root=os.env relative_path = relative_path.strip() source_path = source_path.strip() abs_path = "" - print(str(os.path.realpath((os.path.join(_root, source_path, relative_path))).strip())) - if(os.path.exists(str(os.path.realpath((os.path.join(_root, source_path, relative_path))).strip()))): - abs_path = (os.path.join(_root, source_path, relative_path)).strip() + print(str(os.path.realpath((os.path.join(source_path, relative_path))).strip())) + if(os.path.exists(str(os.path.realpath((os.path.join(source_path, relative_path))).strip()))): + abs_path = (os.path.join(source_path, relative_path)).strip() elif(os.path.isabs(relative_path)): if(os.fspath(relative_path).startswith(os.getcwd())): abs_path = relative_path From 83af3d99ca86c5fe2e8f768d6cc6729628a65131 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Mon, 2 May 2022 12:17:00 +0200 Subject: [PATCH 21/72] split auth token into username and api token --- .github/workflows/main.yaml | 4 ++- .../confluence/check_if_page_exists.py | 12 +++---- .../confluence/create_content.py | 11 +++--- .../confluence/delete_content.py | 20 +++++------ .../confluence/update_content.py | 13 +++---- .../confluence/upload_attachments.py | 36 +++++-------------- .../attachment_link/parse_attachment_links.py | 2 -- MarkdownToConfluence/utils/paths.py | 2 -- 8 files changed, 39 insertions(+), 61 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index aad4581..e30c466 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,6 +6,7 @@ on: - main + jobs: hello_world_job: runs-on: ubuntu-latest @@ -17,7 +18,8 @@ jobs: env: CONFLUENCE_URL: 'https://at-bachelor.atlassian.net' CONFLUENCE_SPACE_KEY: '~955037829' - AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} + AUTH_USERNAME: ${{ secrets.AUTH_USERNAME }} + AUTH_API_TOKEN: ${{ secrets.AUTH_API_TOKEN }} uses: ./ # Uses an action in the root directory id: Convert with: diff --git a/MarkdownToConfluence/confluence/check_if_page_exists.py b/MarkdownToConfluence/confluence/check_if_page_exists.py index 6aee26e..faa086c 100644 --- a/MarkdownToConfluence/confluence/check_if_page_exists.py +++ b/MarkdownToConfluence/confluence/check_if_page_exists.py @@ -1,19 +1,20 @@ from urllib.parse import quote import requests, json import os +from requests.auth import HTTPBasicAuth -AUTH_TOKEN = os.environ.get("AUTH_TOKEN") BASE_URL = os.environ.get("CONFLUENCE_URL") +AUTH_USERNAME = os.environ.get("AUTH_USERNAME") +AUTH_API_TOKEN = os.environ.get("AUTH_API_TOKEN") -authorization_string = f"Basic {AUTH_TOKEN}" +auth = HTTPBasicAuth(AUTH_USERNAME, AUTH_API_TOKEN) def page_exists_in_space(title: str, spaceKey: str) -> bool: url = f"{BASE_URL}/wiki/rest/api/content?spaceKey={spaceKey}&title={quote(title)}" headers = { - 'Authorization': authorization_string, 'User-Agent': 'python' } - response = requests.request('GET', url, headers=headers) + response = requests.request('GET', url, headers=headers, auth=auth) if(response.status_code == 200): results = json.loads(response.text)['results'] if(len(results) > 0): @@ -26,10 +27,9 @@ def page_exists_in_space(title: str, spaceKey: str) -> bool: def get_page_id(title: str, spaceKey: str) -> str: url = f"{BASE_URL}/wiki/rest/api/content?spaceKey={spaceKey}&title={quote(title)}" headers = { - 'Authorization': authorization_string, 'User-Agent': 'python' } - response = requests.request('GET', url, headers=headers) + response = requests.request('GET', url, headers=headers, auth=auth) if(response.status_code == 200): results = json.loads(response.text)['results'] if(len(results) > 0): diff --git a/MarkdownToConfluence/confluence/create_content.py b/MarkdownToConfluence/confluence/create_content.py index 8274cf3..24152bb 100644 --- a/MarkdownToConfluence/confluence/create_content.py +++ b/MarkdownToConfluence/confluence/create_content.py @@ -1,12 +1,14 @@ import json import codecs import requests -import sys, os +import sys, os, base64 +from requests.auth import HTTPBasicAuth -AUTH_TOKEN = os.environ.get("AUTH_TOKEN") BASE_URL = os.environ.get("CONFLUENCE_URL") +AUTH_USERNAME = os.environ.get("AUTH_USERNAME") +AUTH_API_TOKEN = os.environ.get("AUTH_API_TOKEN") -authorization_string = f"Basic {AUTH_TOKEN}" +auth = HTTPBasicAuth(AUTH_USERNAME, AUTH_API_TOKEN) def create_page(filename: str, title: str, space_obj, parent_id="none"): filename = filename.replace(".md", ".html") @@ -48,13 +50,12 @@ def create_page(filename: str, title: str, space_obj, parent_id="none"): url = f'{BASE_URL}/wiki/rest/api/content' headers = { - 'Authorization': authorization_string, 'Content-Type': 'application/json; charset=utf-8', 'User-Agent': 'python' } # Upload html to confluence - response = requests.request("POST", url, headers=headers, data=json.dumps(template)) + response = requests.request("POST", url, headers=headers, data=json.dumps(template), auth=auth) return response diff --git a/MarkdownToConfluence/confluence/delete_content.py b/MarkdownToConfluence/confluence/delete_content.py index cac5ebf..224ecda 100644 --- a/MarkdownToConfluence/confluence/delete_content.py +++ b/MarkdownToConfluence/confluence/delete_content.py @@ -1,26 +1,25 @@ import requests, json from MarkdownToConfluence.utils import get_all_page_names_in_filesystem -import sys, os +import sys, os, base64 +from requests.auth import HTTPBasicAuth -#BASE_URL = os.environ.get("CONFLUENCE_URL") -BASE_URL = 'https://at-bachelor.atlassian.net/wiki' +BASE_URL = os.environ.get("CONFLUENCE_URL") FILES_PATH = os.environ.get("INPUT_FILESLOCATION") -#AUTH_TOKEN = os.environ.get("AUTH_TOKEN") -AUTH_TOKEN = "bGFyc2UxOUBzdHVkZW50LnNkdS5kazp6RzFrQk1ick9PUEtZblNSSFA0bTQxNUI=" SPACE_KEY = os.environ.get("CONFLUENCE_SPACE_KEY") +AUTH_USERNAME = os.environ.get("AUTH_USERNAME") +AUTH_API_TOKEN = os.environ.get("AUTH_API_TOKEN") -authorization_string = f"Basic {AUTH_TOKEN}" +auth = HTTPBasicAuth(AUTH_USERNAME, AUTH_API_TOKEN) def delete_page(page_id: str, page_name=""): url = f"{BASE_URL}/wiki/rest/api/content/{page_id}" headers = { - 'Authorization': authorization_string, 'User-Agent': 'python' } - response = requests.request('DELETE', url, headers=headers) + response = requests.request('DELETE', url, headers=headers, auth=auth) if(response.status_code == 204): print(f"Deleted {page_id} {page_name}") @@ -36,18 +35,17 @@ def delete_non_existing_pages(space_key: str, root: str, exclude=['Overview']): url = f"{BASE_URL}/wiki/rest/api/content?spaceKey={space_key}" headers = { - 'Authorization': authorization_string, 'User-Agent': 'python' } results = [] - response = requests.request("GET", url, headers=headers) + response = requests.request("GET", url, headers=headers, auth=auth) response_json = json.loads(response.text) if(response.status_code == 200): results.extend(response_json['results']) while("next" in response_json['_links']): url = BASE_URL + response_json["_links"]["next"] - response = requests.request("GET", url, headers=headers) + response = requests.request("GET", url, headers=headers, auth=auth) response_json = json.loads(response.text) results.extend(response_json['results']) diff --git a/MarkdownToConfluence/confluence/update_content.py b/MarkdownToConfluence/confluence/update_content.py index 5920212..41a4879 100644 --- a/MarkdownToConfluence/confluence/update_content.py +++ b/MarkdownToConfluence/confluence/update_content.py @@ -1,12 +1,14 @@ import json import codecs import requests -import os +import os, base64 +from requests.auth import HTTPBasicAuth -AUTH_TOKEN = os.environ.get("AUTH_TOKEN") BASE_URL = os.environ.get("CONFLUENCE_URL") +AUTH_USERNAME = os.environ.get("AUTH_USERNAME") +AUTH_API_TOKEN = os.environ.get("AUTH_API_TOKEN") -authorization_string = f"Basic {AUTH_TOKEN}" +auth = HTTPBasicAuth(AUTH_USERNAME, AUTH_API_TOKEN) def update_page_content(filename: str, title: str, page_id: str, space_obj,): filename = filename.replace(".md", ".html") @@ -40,18 +42,17 @@ def update_page_content(filename: str, title: str, page_id: str, space_obj,): url = f"{BASE_URL}/wiki/rest/api/content/{page_id}" headers = { - 'Authorization': authorization_string, 'Content-Type': 'application/json; charset=utf-8', 'User-Agent': 'python' } # Get current version - get_response = requests.request("GET", f"{url}?expand=version", headers=headers) + get_response = requests.request("GET", f"{url}?expand=version", headers=headers, auth=auth) version_number = int(json.loads(get_response.text)['version']['number']) template['version']['number'] = version_number + 1 # Upload html to confluence - put_response = requests.request("PUT", url, headers=headers, data=json.dumps(template)) + put_response = requests.request("PUT", url, headers=headers, data=json.dumps(template), auth=auth) if(put_response.status_code != 200): print(template['body']) diff --git a/MarkdownToConfluence/confluence/upload_attachments.py b/MarkdownToConfluence/confluence/upload_attachments.py index c2f6624..2a79d11 100644 --- a/MarkdownToConfluence/confluence/upload_attachments.py +++ b/MarkdownToConfluence/confluence/upload_attachments.py @@ -1,15 +1,16 @@ -import requests, json, os +import requests, json, os, base64 from .check_if_page_exists import page_exists_in_space, get_page_id from .PageNotFoundError import PageNotFoundError +from requests.auth import HTTPBasicAuth BASE_URL = os.environ.get("CONFLUENCE_URL") -AUTH_TOKEN = os.environ.get("AUTH_TOKEN") SPACEKEY = os.environ.get("CONFLUENCE_SPACE_KEY") +AUTH_USERNAME = os.environ.get("AUTH_USERNAME") +AUTH_API_TOKEN = os.environ.get("AUTH_API_TOKEN") -authorization_string = f"Basic {AUTH_TOKEN}" +auth = HTTPBasicAuth(AUTH_USERNAME, AUTH_API_TOKEN) headers = { -'Authorization': authorization_string, 'User-Agent': 'python', 'X-Atlassian-Token': 'no-check' } @@ -20,18 +21,18 @@ def upload_attachment(page_title, attactchment_name, filepath): # Get attachment id id = "" - attachments = requests.get(url, headers=headers) + attachments = requests.get(url, headers=headers, auth=auth) for result in json.loads(attachments.text)['results']: if(result['title'] == attactchment_name): id = result['id'] if(id == ""): # Attachment doesnt exist, create it # Create attachment file = {'file': (attactchment_name, open(filepath, 'rb'))} - response = requests.post(url, headers=headers, files=file) + response = requests.post(url, headers=headers, files=file, auth=auth) else: # Attachment exists, update it # Update attachment files = {'file': (attactchment_name, open(os.path.abspath(filepath), 'rb'))} - response = requests.post(f'{url}/{id}/data', headers=headers, files=files) + response = requests.post(f'{url}/{id}/data', headers=headers, files=files, auth=auth) if(response.status_code == 200): print(f"Uploaded {attactchment_name} as attachment on page {page_title}") @@ -40,24 +41,3 @@ def upload_attachment(page_title, attactchment_name, filepath): return response else: raise PageNotFoundError(page_title, SPACEKEY) - -""" -def update_attachment_data(page_title, attactchment_name, filepath): - if(page_exists_in_space(page_title, SPACEKEY)): - url = f"{BASE_URL}/wiki/rest/api/content/{get_page_id(page_title, SPACEKEY)}/child/attachment" - - # Get attachment id - id = "" - attachments = requests.get(url, headers=headers) - for result in json.loads(attachments.text)['results']: - if(result['title'] == attactchment_name): - id = result['id'] - - # Update attachment - files = {'file': (f'{attactchment_name}', open(f'./{filepath}', 'rb'))} - response = requests.post(url + f'/{id}/data', headers=headers, files=files) - - return response - else: - raise PageNotFoundError(page_title, SPACEKEY) -""" \ No newline at end of file diff --git a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py index c4a36d9..9fbb791 100644 --- a/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py +++ b/MarkdownToConfluence/modules/attachment_link/parse_attachment_links.py @@ -16,12 +16,10 @@ def convert_md_attachment_links_to_confluence_attachment_links(line: str, md_pat links = re.findall(r'(!\[(?P<alt>[^\]]*)\]\((?P<filename>.*?)(?=\"|\))(\"(?P<title>.*)\")?\))', line) new_line = line for link in links: - print(link) if(not (link[2].strip().endswith('.png') or link[2].strip().endswith('.jpg'))): path = get_abs_path_from_relative(link[2], md_path) name = link[4] if link[4] != '' else basename(link[2]) MarkdownToConfluence.globals.attachments.append((name, path)) - print(name, path) new_line = new_line.replace(link[0], f'<p class=\"media-group\"><ac:structured-macro ac:name=\"view-file\" ac:schema-version=\"1\" ac:macro-id=\"ce17b5c6-cfe6-4a77-92aa-7b810863f634\"><ac:parameter ac:name=\"name\"><ri:attachment ri:filename="{name}" ri:version-at-save=\"2\" /></ac:parameter></ac:structured-macro></p><p />') return new_line diff --git a/MarkdownToConfluence/utils/paths.py b/MarkdownToConfluence/utils/paths.py index 41acfe5..05829ae 100644 --- a/MarkdownToConfluence/utils/paths.py +++ b/MarkdownToConfluence/utils/paths.py @@ -3,13 +3,11 @@ def get_abs_path_from_relative(relative_path: str, source_path: str, root=os.environ.get('INPUT_FILESLOCATION')): _root = os.path.abspath(root) - print(relative_path, source_path, _root) if(os.path.isfile(source_path)): source_path = dirname(source_path) relative_path = relative_path.strip() source_path = source_path.strip() abs_path = "" - print(str(os.path.realpath((os.path.join(source_path, relative_path))).strip())) if(os.path.exists(str(os.path.realpath((os.path.join(source_path, relative_path))).strip()))): abs_path = (os.path.join(source_path, relative_path)).strip() elif(os.path.isabs(relative_path)): From 436fd979473d7f9d885ce4a596b7ce0628b5d3b7 Mon Sep 17 00:00:00 2001 From: larse19 <55133668+larse19@users.noreply.github.com> Date: Mon, 2 May 2022 12:59:28 +0200 Subject: [PATCH 22/72] Update README.md --- README.md | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 2b55926..23d4c5e 100644 --- a/README.md +++ b/README.md @@ -3,26 +3,27 @@ Bachelor 2022 - Anders Larsen & Theis Tengs This action converts your markdown files into the specified Atlassian Confluence space. +# Setup +## API User Token +First you need to create an API token for the user, you want to use for the action. We recommend that you create a new user, that is only used for this action, in order to get the full benefits from the action. See (here)[https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/] for how to set up your API token. + ## Environment Variables The necessary environment variables are as follows: `CONFLUENCE_URL` -The URL for the, Atlassian network +The base URL for the Atlassian network. Follows the form: 'https://<your-network-name>.atlassian.net' `CONFLUENCE_SPACE_KEY` -The key of the space that is being uploaded to. - -`AUTH_TOKEN` - -This is a base64 encoded string consisting of your Atlassian username (email) together with an API token from Atlassian aswell. - -An example could be: +The key of the space that is being uploaded to. Can be found in the URL for your space. More info (here)[https://confluence.atlassian.com/doc/space-keys-829076188.html] -your@email.com:api_token +`AUTH_USERNAME` +The email used for the user connected to the API token. We recommend setting this as a GitHub secret. + +`AUTH_API_TOKEN` +The API token generated for the user. We recommend setting this as a GitHub secret. -This then needs to be base64 encoded and added as a github secret with the name of `AUTH_TOKEN`. ## Inputs ### `fileslocation` @@ -32,16 +33,31 @@ This then needs to be base64 encoded and added as a github secret with the name ## Outputs ### Ikke lige nogle indtil nu + ## Example usage +Without github secrets: +```yaml +- name: Conversion step + env: + CONFLUENCE_URL: 'https://network.atlassian.net/wiki' + CONFLUENCE_SPACE_KEY: 'spaceKey' + AUTH_USERNAME: 'your@email.com' + AUTH_API_TOKEN: 'PeRsOnalApItOKen' + uses: TTengs/MarkdownToConfluence@latest + with: + fileslocation: './documentation' +``` + +With GitHub actions ```yaml - name: Conversion step env: CONFLUENCE_URL: 'https://network.atlassian.net/wiki' CONFLUENCE_SPACE_KEY: 'spaceKey' - AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} - uses: TTengs/MarkdownToConfluence@v1.1 - id: Convert + AUTH_USERNAME: ${{ secrets.AUTH_USERNAME }} + AUTH_API_TOKEN: ${{ secrets.AUTH_API_TOKEN }} + uses: TTengs/MarkdownToConfluence@latest with: fileslocation: './documentation' ``` From b143dbb9a762b86fac8ccde8971ffe9826339ec6 Mon Sep 17 00:00:00 2001 From: larse19 <55133668+larse19@users.noreply.github.com> Date: Mon, 2 May 2022 13:00:17 +0200 Subject: [PATCH 23/72] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23d4c5e..b4c3412 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This action converts your markdown files into the specified Atlassian Confluence # Setup ## API User Token -First you need to create an API token for the user, you want to use for the action. We recommend that you create a new user, that is only used for this action, in order to get the full benefits from the action. See (here)[https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/] for how to set up your API token. +First you need to create an API token for the user, you want to use for the action. We recommend that you create a new user, that is only used for this action, in order to get the full benefits from the action. See [here](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) for how to set up your API token. ## Environment Variables The necessary environment variables are as follows: @@ -16,7 +16,7 @@ The base URL for the Atlassian network. Follows the form: 'https://<your-network `CONFLUENCE_SPACE_KEY` -The key of the space that is being uploaded to. Can be found in the URL for your space. More info (here)[https://confluence.atlassian.com/doc/space-keys-829076188.html] +The key of the space that is being uploaded to. Can be found in the URL for your space. More info [here](https://confluence.atlassian.com/doc/space-keys-829076188.html) `AUTH_USERNAME` The email used for the user connected to the API token. We recommend setting this as a GitHub secret. @@ -49,7 +49,7 @@ Without github secrets: fileslocation: './documentation' ``` -With GitHub actions +With GitHub secrets ```yaml - name: Conversion step env: From a8761c3befaffb097c5486504e30db65e6854bc7 Mon Sep 17 00:00:00 2001 From: larse19 <55133668+larse19@users.noreply.github.com> Date: Mon, 2 May 2022 13:00:41 +0200 Subject: [PATCH 24/72] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b4c3412..47ac3ef 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,11 @@ The base URL for the Atlassian network. Follows the form: 'https://<your-network The key of the space that is being uploaded to. Can be found in the URL for your space. More info [here](https://confluence.atlassian.com/doc/space-keys-829076188.html) `AUTH_USERNAME` + The email used for the user connected to the API token. We recommend setting this as a GitHub secret. `AUTH_API_TOKEN` + The API token generated for the user. We recommend setting this as a GitHub secret. ## Inputs From 5ceb3797656b2a152a3817a9a76ab331dd1eef83 Mon Sep 17 00:00:00 2001 From: larse19 <55133668+larse19@users.noreply.github.com> Date: Mon, 2 May 2022 13:01:11 +0200 Subject: [PATCH 25/72] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47ac3ef..299a3da 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The API token generated for the user. We recommend setting this as a GitHub secr ### `fileslocation` -**Required** The path to the folder containing the markdown documentation. Default `.\`. +**Required** The path from the root of your repository, to the folder containing the markdown documentation. Default `.\`. ## Outputs From 3ff04b209f98f3db88384ad3ebebeeb94aae75d6 Mon Sep 17 00:00:00 2001 From: larse19 <55133668+larse19@users.noreply.github.com> Date: Mon, 2 May 2022 13:01:51 +0200 Subject: [PATCH 26/72] Update README.md --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 299a3da..6632c28 100644 --- a/README.md +++ b/README.md @@ -41,25 +41,25 @@ The API token generated for the user. We recommend setting this as a GitHub secr Without github secrets: ```yaml - name: Conversion step - env: - CONFLUENCE_URL: 'https://network.atlassian.net/wiki' - CONFLUENCE_SPACE_KEY: 'spaceKey' - AUTH_USERNAME: 'your@email.com' - AUTH_API_TOKEN: 'PeRsOnalApItOKen' - uses: TTengs/MarkdownToConfluence@latest - with: - fileslocation: './documentation' + env: + CONFLUENCE_URL: 'https://network.atlassian.net/wiki' + CONFLUENCE_SPACE_KEY: 'spaceKey' + AUTH_USERNAME: 'your@email.com' + AUTH_API_TOKEN: 'PeRsOnalApItOKen' + uses: TTengs/MarkdownToConfluence@latest + with: + fileslocation: './documentation' ``` With GitHub secrets ```yaml - name: Conversion step - env: - CONFLUENCE_URL: 'https://network.atlassian.net/wiki' - CONFLUENCE_SPACE_KEY: 'spaceKey' - AUTH_USERNAME: ${{ secrets.AUTH_USERNAME }} - AUTH_API_TOKEN: ${{ secrets.AUTH_API_TOKEN }} - uses: TTengs/MarkdownToConfluence@latest - with: - fileslocation: './documentation' + env: + CONFLUENCE_URL: 'https://network.atlassian.net/wiki' + CONFLUENCE_SPACE_KEY: 'spaceKey' + AUTH_USERNAME: ${{ secrets.AUTH_USERNAME }} + AUTH_API_TOKEN: ${{ secrets.AUTH_API_TOKEN }} + uses: TTengs/MarkdownToConfluence@latest + with: + fileslocation: './documentation' ``` From 44a5ae617c58681f18267dae346e1d651b67fa0c Mon Sep 17 00:00:00 2001 From: larse19 <55133668+larse19@users.noreply.github.com> Date: Tue, 3 May 2022 08:33:22 +0200 Subject: [PATCH 27/72] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6632c28..bd7b670 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The necessary environment variables are as follows: `CONFLUENCE_URL` -The base URL for the Atlassian network. Follows the form: 'https://<your-network-name>.atlassian.net' +The base URL for the Atlassian network. Follows the form: 'https://[your-network-name].atlassian.net' `CONFLUENCE_SPACE_KEY` From 67e2dd7727f85ea2179c44dc6af14366064eeeec Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Tue, 3 May 2022 11:41:28 +0200 Subject: [PATCH 28/72] table of contents --- .github/workflows/main.yaml | 10 ++++--- .github/workflows/test.yaml | 2 +- .../modules/table_of_contents/__init__.py | 1 + .../table_of_contents_parser.py | 30 +++++++++++++++++++ documentation/DAM Center 5/index.md | 5 ++++ documentation/settings.json | 3 +- testfile.md | 0 7 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 MarkdownToConfluence/modules/table_of_contents/__init__.py create mode 100644 MarkdownToConfluence/modules/table_of_contents/table_of_contents_parser.py delete mode 100644 testfile.md diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index aad4581..27b5acd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,9 +1,11 @@ name: Upload Documentation -on: - pull_request: - branches: - - main +# on: +# pull_request: +# branches: +# - main + +on: [push] jobs: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2aa2784..36dbc70 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,6 @@ name: Run PyTest -on: [push] +# on: [push] jobs: build: diff --git a/MarkdownToConfluence/modules/table_of_contents/__init__.py b/MarkdownToConfluence/modules/table_of_contents/__init__.py new file mode 100644 index 0000000..3afe1c6 --- /dev/null +++ b/MarkdownToConfluence/modules/table_of_contents/__init__.py @@ -0,0 +1 @@ +from .table_of_contents_parser import run \ No newline at end of file diff --git a/MarkdownToConfluence/modules/table_of_contents/table_of_contents_parser.py b/MarkdownToConfluence/modules/table_of_contents/table_of_contents_parser.py new file mode 100644 index 0000000..7494fe8 --- /dev/null +++ b/MarkdownToConfluence/modules/table_of_contents/table_of_contents_parser.py @@ -0,0 +1,30 @@ +import os + +def parse_table_of_contents_macros(filename): + if(os.path.isdir(filename)): + filename += "/index_final.md" + reading_toc = False + root = '@self' + search_depth = 1 + with open(f"{filename}", "r") as file: + lines = file.readlines() + with open(f"{filename}", "w") as file: + for line in lines: + if line.strip("\n") == "```table-of-contents" or line.strip("\n") == "```TOC": + reading_toc = True + if reading_toc: + if(line.strip("\n") != "```mermaid" and line.strip("\n") != "```"): + if(line.find('root') != -1): + root = line.split('=')[-1].strip() + if(line.find('search-depth') != -1): + depth = line.split('=')[-1].strip() + if(depth.isnumeric()): + search_depth = int(depth) + if line.strip("\n") == "```": + file.write(f'<p><ac:structured-macro ac:name=\"pagetree\" ac:schema-version=\"1\" ac:macro-id=\"cace95ee428b28ba686848696668d8ca\"><ac:parameter ac:name=\"root\"><ac:link><ri:page ri:content-title="{root}" /></ac:link></ac:parameter><ac:parameter ac:name=\"startDepth\">{search_depth}</ac:parameter></ac:structured-macro></p><p />') + reading_toc = False + else: + file.write(line) + +def run(filename): + parse_table_of_contents_macros(filename) diff --git a/documentation/DAM Center 5/index.md b/documentation/DAM Center 5/index.md index e69de29..77e684b 100644 --- a/documentation/DAM Center 5/index.md +++ b/documentation/DAM Center 5/index.md @@ -0,0 +1,5 @@ +# DAM Center 5 + +```TOC +search-depth=3 +``` \ No newline at end of file diff --git a/documentation/settings.json b/documentation/settings.json index 7d1fdeb..5e1f7df 100644 --- a/documentation/settings.json +++ b/documentation/settings.json @@ -3,6 +3,7 @@ "modules": { "mermaid": true, "jira-tickets": true, - "attachment_link": true + "attachment_link": true, + "table_of_contents": true } } \ No newline at end of file diff --git a/testfile.md b/testfile.md deleted file mode 100644 index e69de29..0000000 From 1be7a9b8283b2e205eba57fd6cfc6573e8efabc1 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Tue, 3 May 2022 13:30:01 +0200 Subject: [PATCH 29/72] docs --- .github/workflows/main.yaml | 3 +- Documentation2/page 1/index.md | 5 ++ Documentation2/page 1/page 1.1.md | 0 Documentation2/page 1/page 1.2/index.md | 1 + Documentation2/page 1/page 1.2/page 1.2.1.md | 0 Documentation2/page 2/index.md | 4 ++ Documentation2/page 3/image.png | Bin 0 -> 3092 bytes Documentation2/page 3/index.md | 3 ++ Documentation2/page 3/zip file.zip | Bin 0 -> 504 bytes Documentation2/settings.json | 9 ++++ .../table_of_contents_parser.py | 8 +-- README.md | 37 ++++++++++++++ doc/images/attachment.PNG | Bin 0 -> 2298 bytes doc/images/filestructure.PNG | Bin 0 -> 5463 bytes doc/images/jira ticket.PNG | Bin 0 -> 4244 bytes doc/images/pagestructure.PNG | Bin 0 -> 3296 bytes doc/images/prefix example.PNG | Bin 0 -> 12303 bytes doc/images/prefix result.PNG | Bin 0 -> 11570 bytes doc/modules/attachments.md | 34 +++++++++++++ doc/modules/jira-tickets.md | 16 ++++++ doc/modules/mermaid.md | 16 ++++++ doc/modules/table-of-contents.md | 47 ++++++++++++++++++ doc/prefix.md | 11 ++++ doc/settings.md | 24 +++++++++ documentation/DAM Center 5/index.md | 2 +- 25 files changed, 214 insertions(+), 6 deletions(-) create mode 100644 Documentation2/page 1/index.md create mode 100644 Documentation2/page 1/page 1.1.md create mode 100644 Documentation2/page 1/page 1.2/index.md create mode 100644 Documentation2/page 1/page 1.2/page 1.2.1.md create mode 100644 Documentation2/page 2/index.md create mode 100644 Documentation2/page 3/image.png create mode 100644 Documentation2/page 3/index.md create mode 100644 Documentation2/page 3/zip file.zip create mode 100644 Documentation2/settings.json create mode 100644 doc/images/attachment.PNG create mode 100644 doc/images/filestructure.PNG create mode 100644 doc/images/jira ticket.PNG create mode 100644 doc/images/pagestructure.PNG create mode 100644 doc/images/prefix example.PNG create mode 100644 doc/images/prefix result.PNG create mode 100644 doc/modules/attachments.md create mode 100644 doc/modules/jira-tickets.md create mode 100644 doc/modules/mermaid.md create mode 100644 doc/modules/table-of-contents.md create mode 100644 doc/prefix.md create mode 100644 doc/settings.md diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 27b5acd..6e8ac30 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -19,7 +19,8 @@ jobs: env: CONFLUENCE_URL: 'https://at-bachelor.atlassian.net' CONFLUENCE_SPACE_KEY: '~955037829' - AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} + #AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} + AUTH_TOKEN: 'bGFyc2UxOUBzdHVkZW50LnNkdS5kazpoYVpaSEM5MTFZc0ZUb2pXODV3WTk3Nzg=' uses: ./ # Uses an action in the root directory id: Convert with: diff --git a/Documentation2/page 1/index.md b/Documentation2/page 1/index.md new file mode 100644 index 0000000..1cbe080 --- /dev/null +++ b/Documentation2/page 1/index.md @@ -0,0 +1,5 @@ +# this is a page 1 + +bare lige en hurtig test for at se om en page bliver bredere når man skriver en meget lang tekst, og om det så også går ud over størrelsen på et billede på siden + +![graph](documentation/attachments/index-1.png) \ No newline at end of file diff --git a/Documentation2/page 1/page 1.1.md b/Documentation2/page 1/page 1.1.md new file mode 100644 index 0000000..e69de29 diff --git a/Documentation2/page 1/page 1.2/index.md b/Documentation2/page 1/page 1.2/index.md new file mode 100644 index 0000000..d540935 --- /dev/null +++ b/Documentation2/page 1/page 1.2/index.md @@ -0,0 +1 @@ +# this is page 1.2 \ No newline at end of file diff --git a/Documentation2/page 1/page 1.2/page 1.2.1.md b/Documentation2/page 1/page 1.2/page 1.2.1.md new file mode 100644 index 0000000..e69de29 diff --git a/Documentation2/page 2/index.md b/Documentation2/page 2/index.md new file mode 100644 index 0000000..7bf8512 --- /dev/null +++ b/Documentation2/page 2/index.md @@ -0,0 +1,4 @@ +# this is a page 2 +This change is only thing i push +BAC-74 +this ticket, BAC-77, is within a line \ No newline at end of file diff --git a/Documentation2/page 3/image.png b/Documentation2/page 3/image.png new file mode 100644 index 0000000000000000000000000000000000000000..57d95e38ad1e395f9774341d450ce5bd7684cb3c GIT binary patch literal 3092 zcmb_a3pA8l8{RW!+)c!|gpQeTLWnd7Ihb*oT!*1)4uy<lh;dCQ6=mGzQgK{H$S86d z*Fs51LPfb1j`$OalhDoo%{j;FoVCus{`If*zx&(Ye%|+a-gm!yf8WN7jR_!1G`BJb zFc<(ZXn>6=_)aS`v%~fzJ98^*!tVrJ8bF5F4S=72FoR@as&J5UNP!#MG<VOSfKB`l zD^&O65Vtx2Pu2f{|8F6Iqh3Ltkmx-$gBj4~P_suNEaCkJ4(DQzKX4)!Gn`0fkfs2_ zJH7vcJ^q5jf&+pfO&3@18NlG;F$f#_(L=a<agE!tu$MpC5n2yIQw{_H60iWK5dOc~ z_xn7-0zhvC0G`zEF^?+%)W-rKJ@P%KSOCD5^8nQK1-LWZe{Ti>z2P((0L!HSh)@6! z?*~ATy4mRW-0$DwKb%zo%8`T4c>)^VfDXKX0<Z%9z!PXdNE_@1S^&2(3d{fx9L{|p zLqHFbABjXDkb-=Cy!^s~!oos=LP8>_t)e0*F_e&ysHCWvxC9!F7TzKyEh!<rRRS%+ zEdt|#au7%XBvL>^L`X#9f3}S_AjS_;fjJKh3*cff9x>R)edqu%0Ox^m|Ljde@*?>7 zc?94Pix&kj9;k7sQ3T)bJRIr+AbG{M@=0R&#kI&81KKzTr{Iw4ClYAv4jo-R6Zg1F z9L1`dS|w96l1EG$RAn1f9ol2FK6iz|p?lzkI5jZ<ha5fxoM)4VT(PYf2ZXqU7AdXJ zB(UnP_8#|`fsGL$3>ATk@rVIq@QFoJXQrw0vuNz{bgYyA3MFES&j<C%BSq5xTiog` zj#>NV&}ZQhLj-ypzUmN}oGi$05`TYlM8}<k3OaGQTdjKij<Z`s%!pY_&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zh?di~b@6g2u5C%cBhlpKr36-j?#1V7F)i(%7D^SIWHr-=1?u!gSt`mA8JXnc>}i9z zeZ$Uuq1oXbx@D`>A<f#Bg&Q<B)l+Z`&#Pzg-Z94nKR8(?ICGn<R#r6MCqlSzerm7Z z(;o!itmW#jx=b`tl=+fx^v!f#cs=)~uQbWI?~?yx;+OjK?H9-T5@nkTI5;zU;w_y3 zH%Y>M`T-J_T~HF~5JYfdAMu#!sZ`Gi4=;L-{Mw9u>qf=BU$UqW`W&jZYXewsfXej# z6^-CxwbX;ojrVn>>%Nv)Qb?4<*kdWhZh<_;d8do^y%@ZJ>pjt^_oIfekGV>*zzlv+ zy!&b~y}x`L$^U@z4ZB9`mj-r+Oc!9UY<{g>xu(%Czv4Si)pTr|zdLR-SiNG1dL%!{ zx$iKrrWT9dlziCCalZ4X<k@D9EjBr&?H;paX(Zx_)G^ejuHneIVqWEtY}gF*U4%`w zDSAC_A6m7usm`r5X82rFjr-jsf8VPK^4EL4%gq$d=&v(~#Wt+mvIc@-x0Qy)9Tnp2 IxsBm}1CHRoFaQ7m literal 0 HcmV?d00001 diff --git a/Documentation2/page 3/index.md b/Documentation2/page 3/index.md new file mode 100644 index 0000000..19de9cf --- /dev/null +++ b/Documentation2/page 3/index.md @@ -0,0 +1,3 @@ +# this is page 3 + +![test](./zip file.zip) \ No newline at end of file diff --git a/Documentation2/page 3/zip file.zip b/Documentation2/page 3/zip file.zip new file mode 100644 index 0000000000000000000000000000000000000000..a01abc1416a5ab70baf8bbb738539123c0bc7f5e GIT binary patch literal 504 zcmWIWW@Zs#00BY!IU!&Ml;8x?Rhb3xC8@<F`T;;?Twn=wWlG4({3=TnN>a0nOH%T) zOLJ56N)$AVH1$d<N)Y<_(X5ffs~@75k;$F`mm^icu3}&ifYNX$b1^7@g%}wm7@qgM z-F77E1|y8FTl0Axh#%k$G8&i1U`B(?Q3qnU(Kx+{&rX=#$aZ1|2C|*$c<lrQ4YGaV dt)W{$enO`Myjj_R1~D)Lp*<r5!(tGJ0RSh*a}59h literal 0 HcmV?d00001 diff --git a/Documentation2/settings.json b/Documentation2/settings.json new file mode 100644 index 0000000..e09bac3 --- /dev/null +++ b/Documentation2/settings.json @@ -0,0 +1,9 @@ +{ + "parent_page": "Overview", + "modules": { + "mermaid": true, + "jira-tickets": true, + "attachment_link": true, + "table_of_contents": true + } +} \ No newline at end of file diff --git a/MarkdownToConfluence/modules/table_of_contents/table_of_contents_parser.py b/MarkdownToConfluence/modules/table_of_contents/table_of_contents_parser.py index 7494fe8..fac0506 100644 --- a/MarkdownToConfluence/modules/table_of_contents/table_of_contents_parser.py +++ b/MarkdownToConfluence/modules/table_of_contents/table_of_contents_parser.py @@ -5,7 +5,7 @@ def parse_table_of_contents_macros(filename): filename += "/index_final.md" reading_toc = False root = '@self' - search_depth = 1 + start_depth = 1 with open(f"{filename}", "r") as file: lines = file.readlines() with open(f"{filename}", "w") as file: @@ -16,12 +16,12 @@ def parse_table_of_contents_macros(filename): if(line.strip("\n") != "```mermaid" and line.strip("\n") != "```"): if(line.find('root') != -1): root = line.split('=')[-1].strip() - if(line.find('search-depth') != -1): + if(line.find('start-depth') != -1): depth = line.split('=')[-1].strip() if(depth.isnumeric()): - search_depth = int(depth) + start_depth = int(depth) if line.strip("\n") == "```": - file.write(f'<p><ac:structured-macro ac:name=\"pagetree\" ac:schema-version=\"1\" ac:macro-id=\"cace95ee428b28ba686848696668d8ca\"><ac:parameter ac:name=\"root\"><ac:link><ri:page ri:content-title="{root}" /></ac:link></ac:parameter><ac:parameter ac:name=\"startDepth\">{search_depth}</ac:parameter></ac:structured-macro></p><p />') + file.write(f'<p><ac:structured-macro ac:name=\"pagetree\" ac:schema-version=\"1\" ac:macro-id=\"cace95ee428b28ba686848696668d8ca\"><ac:parameter ac:name=\"root\"><ac:link><ri:page ri:content-title="{root}" /></ac:link></ac:parameter><ac:parameter ac:name=\"startDepth\">{start_depth}</ac:parameter></ac:structured-macro></p><p />') reading_toc = False else: file.write(line) diff --git a/README.md b/README.md index bd7b670..64bdce3 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,40 @@ With GitHub secrets with: fileslocation: './documentation' ``` + +--- + +# Writing Documentation + +## Page structure +The structure of the markdown files in the filesystem, dictates the structure of the pages on confluence. + +All files should be located in a single folder, which is the one specified in [fileslocation](#fileslocation). This folder will not contain any markdown files (if so, they won't be recognized as pages), but only folders, a [prefix](./doc/prefix.md)- and [settings-file](./doc/settings.md). Every subfolder under this folder, will be considered a page, these are referenced later as a "folderpage". + +A folderpage can contain other folderpages, as well as markdown files. The file containing the content of the folderpage, __MUST__ be named "index.md". Any other markdown files inside the folderpage, will be considered as a child page. + +A child page can also be defined by another folderpage inside a folderpage. This is only recommended, if you need child pages for that folderpage as well. Otherwise, we recommend simply using multiple markdown files. + +### Page naming +The name of a folderpage dicates the name of the page in confluence. + +Folderpages with multiple markdown files, will contain child pages named after the name of the markdown file. + +Any folderpage can contain a [prefix.txt](./doc/prefix.md) file, dictating the prefix for all it's child pages. + +### Example +The following filestructure: + +![filesystem](./doc/images/filestructure.PNG) + +Will look like this, once uploaded to Confluence: + +![pagestructure](./doc/images/pagestructure.PNG) + +## Modules +This tools comes with a number of modules, which add extra markdown syntax, specialized for Confluence and other tools. + +- [Jira Tickets](./doc/modules/jira-tickets.md) +- [Attachments](./doc/modules/attachments.md) +- [Mermaid.js](./doc/modules/mermaid.md) +- [Table of Contents](./doc/modules/table-of-contents.md) \ No newline at end of file diff --git a/doc/images/attachment.PNG b/doc/images/attachment.PNG new file mode 100644 index 0000000000000000000000000000000000000000..d041eff3aac0983ece5f684251401a9098f41a25 GIT binary patch literal 2298 zcmcImX;2eb5{}$~5oAyzpmHaONJKd{Tmqs2A%KG15Jr$7Dr&+tLb%ic6a;~Qfn-oL z90G}43UZ4A2{9Z&<Qfi1NVp4-BM@Q2?vLH7-J1Qg`=eji_ulJ%Usu2C?qnwi_<l)6 zNdN$_-`2+ZvOpIJBuPR{uqMoJ%Lvpy%w@P0fXp~DBLE^O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DXj(V-fpHlrJGgeLRNBs?L zg1lhk*=V-x$C6;*j&Cr62kDgP*YSH83b`G}SSb`AWL<Z?j|05Ag~}ZB02s9n=^hvi zYY?R`NLK22W(626JG4&zp{3i^uF^3n5B}U`=3W`%DNh@>8YV}r4%@U>k_g|%+9=Ph z3fQZwGB#R)s1hFr@xCbVq<eEkUF~i}_(Q@>$kAbg?I$C>;PBT=K6Kq-SZj!|pc`go zV5WN2Yh(elzxm90FxcWJLbn+{HL82qpTmFk_ok~%*|oN7-nCUy8nm>G^?Ns{7oJL7 z&D7>hPlL<L$h~X4{Fy3fbCKiO-E4C_Pb_ZOuW0aOc*;LKP?Jx*8&RrWzjHLMsrAYA qt7u7D@`Gw75Uqyan+k%|wm|G7^Um9rU*-h!3c&WfgEiU8FX2zF_*=OE literal 0 HcmV?d00001 diff --git a/doc/images/filestructure.PNG b/doc/images/filestructure.PNG new file mode 100644 index 0000000000000000000000000000000000000000..bdd4132f13d1feb018296c9b13db39a7e55e40d2 GIT binary patch literal 5463 zcmb`Ldpwi<|HmifOd=B5q>~&LDl~1#At{Q&B2yZ7Im{vF3prJiOme!Ny1OeC<`hE= z6`OHW(FmD48{J0OFxO`Kt@_^g<9qu39>3Ecdt7^8hh5j_bG<&#*XzBsQ;v3W(%YmV z5Qv=pF>7bxmJWf4=tyo9ep9mH76~^ZVa|3|5JI2EAHqV+&+?=t1X7bJvvxsTSW5*T zLx({i@~^&qM98=&mmm=3S$k{CGf`f1#UG=8J-o>RCt~t3KylQvgv-pu+j`pbhD$=T zQoIkyN{aX@Pn#FvR8!(%Vdk}2i>R*xE`6x&>$(iYBpHA>dhVw4C+CNz$?!T^NbU)? zfVaBF<8yJA=_hb)ND>l-BE`41e!xDPYs=)a^NAP?w3MAs9(r+wH7C%bPA@)M>6xUD zkGE+ipxTh}tr=h8{d<aW`$~z}ug!uBrCY<^lEUM&ngkEFhZnC5D!_x%*%!@OLsf^? zTNJ)Ly5}VI)@pqcHJ+EyyF^y)z>8vKUtac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FYe}R~?6Xb7@!KhGFjXB+GDVSDm-q2RF?GO-{=~ zY}|im#XGC0_hj_?WbtV(ueaGTvj1cO9@z1wtQP;lI(R7Mc=%nIKYcHSuZq!m*8Ts` zYHZ67QZ--H=6%X-w;-L})N_cJN!%LRn!!)&XWU_Nj>9mb{qltRLRMIGYl44P`*|2f zoie0IGpcqqXC@yKb|5jGeFF`O1&Ixh!<*vg`0)oD7^8^FvAgiNk3T)sLM(^IdC4)1 zZ}!x?ZWxvhQY$ipO@<&uTO`Ml9^Lc^6{k^`N8ZsoNAJF<>Mu_MZY`1g<7S9kJdKnd zMvQoU<eoreQv5QQpOuF=yq0a0GD$VdjcHRJRMpYnKAd@{xmGeX{oVrELA$!I4$&xo zDHmZ(S8Ngfl(5Z=O}>B&-X86=tOst0?aJOMrxs#%U6b(bn5dbl%0R85seBGpvZ5Y> zLXh733~n7_AV$BIkP>!KB1Oy^8M=tx;J5(%{02!vU?WnfJrS{?L!MCezZUf0wQT?F e+n%djR)T$gA*aSNvQPMDD8$~z(VAf8o%A1+v$8w@ literal 0 HcmV?d00001 diff --git a/doc/images/jira ticket.PNG b/doc/images/jira ticket.PNG new file mode 100644 index 0000000000000000000000000000000000000000..57dbf3def854a5fb6c800f9e1ed93d1c7d3d0a4f GIT binary patch literal 4244 zcmbVQX*|^3+n-?)S+Zwm?3s`eQjEPj%aGjGZ1JP)jmZ{+EaOjPY9wPPm8{8@{f>;m zNcQYI*=r{I;6L~C`g!v_FV6D)oO8W6*LAMz`#mS|j`?5g7lbZ=Kp=MG+lF^RATWVG zH)3X@_ZdoAO7sDYzWbLxsN$Q*8XZ6$=ppq$psG|>+Wm8M%<|~AJsJe!==isRy8?;< z5Qy`#v7z4Iq0U=5lS!goeAr#ir(w*?Toee4zH5Z?qN}7!286ZuHJZ<m*xouIaR1Tc z<=Y&i@~(PjX1xEo6JstVXeh}bmQs03-}O;Ub_epUjcB7!xx<K4ZTLP}tnaKNb;RlY zNNq@EfbH&Ht~*nV1apihw*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pu-mydGQzIRyi>{~LDk2K?cv`5 zEj6j+3&7y3q|;<sr|BhFjx0|RlZ`%aZ#(8v1Sjr=yN!K3IaE;Cv~+c0dD27kV~<#D za)SP&(9l_!f2`5_$p@Oi(b3xnaF4kwtZ--d{g3^s;#2RRXn}jtVdjH@X}R_3bagLZ zZQv<ATX*|uGTVQK5rm1@l0oU06cs9ZJEMhbQ&=jky79t8N*!<15$;Z6Rm_SS4*Iz{ zoNB$wEM!lw3e>q^dqD{{#BhRB0ZFkkv-0W&=d;naHT4m?n9TUm<o=+kP{3r{i>>bD z)`YrZ^_jV?B<+Y+@>YDT%P5cBq+X$1mHA>(MoHhZGtB_|@<cb#y?bb;dUfa+%?5`) z7{B4=y!NdsT)Y2#7~P2zcbpv|a6vnRNMSP43d*xiQVDgg#9tt6OO|0Iw(x8CCp!y} zTORJ-%HA^p5e6PX)6$dZZt3p2PdgPUYP+VpT?=BdY?%14#qE33C<xLaA$#wICP;t! zTcF3eJ3zlbGjnqu1)V+<3w!m#`dcA_lk|AE{kS7+E{x4y7hAvO{tWl?imh2$HqorU zx8}xDQPjKvt6<~#Qv8G4aoyR;+lFyk9qaLEnzL=-3^%24=M5L!=1RzT>&_<?UL=;S zdu)TaRndgJ0Z70y=YB6Q2mszWd*BW$j9rujo_ks{k<Gyg3^y8oyZ>D-UV?>SA8Esc z6~@>_uIDY7LDBoPz+6V%QYl@}!lhaKmy1Aq>4Npy8xLOb>6-`PaOHXsA+g<s7&qT( zw$FA7U+JYkS6K?P;t(kVpTx2AH-@ws|7oWEpT&f%AT{dwtAzS}belB&Cjn$^WNuiY H?;7)8)x#*2 literal 0 HcmV?d00001 diff --git a/doc/images/pagestructure.PNG b/doc/images/pagestructure.PNG new file mode 100644 index 0000000000000000000000000000000000000000..d14e694411ce88d2fa774c4b21b5372e0a41f875 GIT binary patch literal 3296 zcmb`KdsI@{9>-C8%#8U;i!#l!w5OV5ie_TIN++<X%<_dMnvRfUnjQzyvJ9-u%F+t8 z>EWZ7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I>0&EFv7uJJf7U&&`YQaQ3JueyF`+;Kcu$PF+hc^OfB~OVPyPn>| zsTwK;V_k#je>>BL;V)%zdcXV^036m1Iu}2ocVEeHhDndsE2DZ`!Tr+nA~xJ-(x^Ex zWFJWC&%)N{7tk}Ti#_1u$Snp15QL`%X6xZDk~pG1A0BMFTo7$FOJQ^D-B}9AyZU~Z sulWf9usY+_<_@6$r~M1aN}ZV>B&d0NCegiH`&R-A@C)><@{Y>>7vc+bDF6Tf literal 0 HcmV?d00001 diff --git a/doc/images/prefix example.PNG b/doc/images/prefix example.PNG new file mode 100644 index 0000000000000000000000000000000000000000..5899fed9aad5178429bbf353ab9409a038f57b8e GIT binary patch literal 12303 zcmcI~XIN9)x-L}&l&YYMs(`38u~8BTU;#vkfYKo<B2|jC&=SA`2ogml)PN!&AcS56 zK@6aPL~7_INDVDOC?Vy>wf8>ftabLe_s6~WN1i#x%$)O?V~#Q2?|t9zi@RlJc$n`G zJ~lSC!^TEeE!f!DrCGm@g9lh=1|G_<u@3D17KR3FCEb#XtPYo}zNtPNTN#3%c8{CY z=k+zR^=D%f`1<?D-tP110UMjzN8_vdx1mlenZ<<V?&Mc%nW+GO*ExoyK-`t`#Fi7U zKOwPf@~cy?G;hnj*6g=EIB4*pUG~fLEoI3Kg*)#umq&&vuLJV6$LX=InSBLoH&*hM z#=nnZ_xrLKTZh@siQqWdzUl+n&Po2IF&sNzBLl+1>En|T%*?s%ce8POP2RRB2ng=A z@phNIX>Aqcv)4>8eaED1?zj73>-N~DLXY75_ZexNdo`1=a3<{?Pq0WkdMyhyc$Z1u zOl~X@?pQne^3)C2ReUeVFp<sIG>vGBQ0Sp;j}mqsjkt_8QRQd+5KxQ#x~%|afD>Eo zsR&|f@KJp+C#ut`2pEI21e6bD1$+-g9AdvKiM7{NjJwG`E`s2t$$9C{43m$WdVzjH zo{9!(7r<kArY;R(XF?*O%G3)IYK|4KPmNA?#!Ml>X3zDvc&KvNgHuSW`iOB*rZ`)P zaeIxO@kOe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o_apFbwpIN9%kY*Md6AU-|Zx~sHz*^eFSj=6-I!){B-B)L))=i zMde|yw=a-WSftT4oJHh9&P@O)57i$wd~m-PLr8y?)u9YHC49$l%By2ld2R4shihO_ zz=_{X-@ly8`GLp=H`57kPR0SLwC5NzI_nAl8%LRCEk4?hMC&)AJ<+&->ntvp*!vr< zhRzo?0fP3uZevX0##!h7=`G%wTuk4fB4lkoT-^;*_w{3;{78kK_Nzxt$NH&au!@}0 z#dMmvZUKxAH%1GyY{lud*5<%}N?y_%6#4t#ByV!WcG2_yS~~VyyiUJ@O2&EheKo_~ ze;^Ae$~16$!Ls`P=^U~qe5A4K-{z-TX5=SXNN-Exb?zXOQw2AZp3p)Lj61PPfaY1R zp~SN8MN;-$e&Up0Btwaw5n4wRM+4A@3*cg3@?c@hEbhsQPi!n=`0vYi|6`l|y>XYZ dMQ5_#dJoM}N|QOlD&l7|zGil{#Ncl9{{j+7p2q+H literal 0 HcmV?d00001 diff --git a/doc/images/prefix result.PNG b/doc/images/prefix result.PNG new file mode 100644 index 0000000000000000000000000000000000000000..f215b5d9a3c92f88894629ddac030256a716d962 GIT binary patch literal 11570 zcmdU#XH-*d+V8Pr13`)?MX6GSphBoBA{~?{MGzE16R8pDL9rlR5|Ivy2q+~2QUW9q zkw7RxX#oO6T0%`|AwUSc!RMJ-^PV%$Iq%H*FzbBC+Syq<ce0cFD*xaAioR}caP-j0 zLmV6&M~w`xT5@pg65`<4eUx)Q`;|kO!w1-hT@XuyD;%YG;c52CUbo9;mpM4f5)W_Q z+s8gX=xb;T;o#tE+<EM3_9+B&a40kzUA=rW$YDMU<vpiSUP!AbF|ZlXYS_E~qBI21 zAej&!ovB{K?JEpaHh<{9XMRE_vP`&LVlJHHP7>dTPfj;1>*_YUXAkSlxg;qF$o3H| zL-%ayMr_eBdpIuf8Sdw}av8vJ>=10%<Lj@Ea6F3ybDZXr+{5wiv=9g9J{-rTvpbip zU&m>YSSp)q9yQRD4q0gS+dYG7`oa;S5kMC2xyF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 zEmelXmJKb`g;es%uq`{{EpHH4BB(Cuk%%)x7vb!USRNq!oDOk_s!<}-$VVNsJ5%D+ zZH6sovQ~8GQ^e<WJPfV4>cp=DqCZ?x(;2Xql%RBMS3S3beDdc3R^@ij(+8Js*33aP zbvhX5+a?~NEk=soIneHpEKIVeD<A6o9Ko@tZd#hgaHmZHE{<=;DxbUeO9`D)O<Hw1 zS&e*CwT4phKxa~n%>__ukFw+IN86S|4X=r=dEY~f^4a8Cr|!(sX^o2T1bWZT4VTM! z9Q8-Ych?SuCp8UGFFU{mRZBdab1G`)Q-@qB11)ynpCNEQi?w-(>ZbB|g^N!>L#3v? z=05{I1S#PPXN{)hXQ>@X@iZ;0oo8-J_sctsRrrxB>v;P$K}<IsCY!x+uvo02`HvC0 zfI`p^lGA@tA<BX6eAWKl`8p|5Amq7tNaNtwViiQ4%%^-zR(FyqyZ}5Hdgk3ymMPMk zGHv22;j^~H9tLZDzY^)lA%RrZWH)0OJkPsY@5%B0o@TibQ@%2PFkhTGsJ`D#5taL3 zwGf+?4HgB5!t3A=)xZcJa%Rug$dT&6jcEjwv*p6W<rn8V^^NwM--R8qIPB~F>ImPf yBYU5K-#!MP=KS9Ve*bNv@=u5BE^P&_ZTtDG!pN3TS@xVWhmpSd)zT|>BmWCg?G1_m literal 0 HcmV?d00001 diff --git a/doc/modules/attachments.md b/doc/modules/attachments.md new file mode 100644 index 0000000..f8b4bec --- /dev/null +++ b/doc/modules/attachments.md @@ -0,0 +1,34 @@ +# Attachments and Assets +It is possible to reference a multitude of different types of assets and attachments. + +## File location +The assets and attachments you wish to upload, can be stored anywhere inside of the documentation root folder. When referencing them, you simply specify either the relative path of the markdown file you wish the asset to be linked to, or the absoulute path from the root of the documentation folder (here you have to start the path with the name of the root folder). + +### Examples +With the given filestructure: + +![filestructure](../images/filestructure.PNG) + +If you want to incoorporate image.png into "page 3", you simple use the path `./image.png` + +But if you want to reference that same image from "page 1", you would write: `documentation/page 3/image.png`, given that "documentation" is the name of the root folder. + +You can therefore also create a dedicated attachment folder anywhere in the filesystem, and reference that when you need to attach a file or an image. + +## Images +You can insert an image by referencing it using regular markdown syntax: + +`![alt](filepath "optional title")` + +Only images of types .png and .jpg are supported. + +## Other attachments +If you want to attach a different filetype, it is also done with regular markdown syntax: + +`[alt](filepath "optional title")` + + | Note the missing "!" + +These attachments will then be uploaded to the page, and a reference link will be inserted into the page: + +![attachment](../images/attachment.PNG) \ No newline at end of file diff --git a/doc/modules/jira-tickets.md b/doc/modules/jira-tickets.md new file mode 100644 index 0000000..1aabc27 --- /dev/null +++ b/doc/modules/jira-tickets.md @@ -0,0 +1,16 @@ +# Jira Tickets +Jira tickets can be referenced and rendered by simply writing the unique key for the ticket/issue. + +The status of the issue wil automatically be updated, when it changes on Jira + +## Example +Markdown: + +```markdown +BAC-74 +this ticket, BAC-77, is within a line +``` + +This will be rendered like this: + +![jira-ticket](../images/jira%20ticket.PNG) \ No newline at end of file diff --git a/doc/modules/mermaid.md b/doc/modules/mermaid.md new file mode 100644 index 0000000..07311f6 --- /dev/null +++ b/doc/modules/mermaid.md @@ -0,0 +1,16 @@ +# Mermaid.js +Mermaid lets you create diagrams and visualizations using text and code. + +It is a Javascript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically. + +These diagrams will be rendered and uploaded to confluence as a PNG, and displayed on the page at the location of the macro. + +You can read more about how to write mermaid diagrams [here](https://mermaid-js.github.io/mermaid/#/) + +## Syntax +``` + ```mermaid + graph + ``` +``` + diff --git a/doc/modules/table-of-contents.md b/doc/modules/table-of-contents.md new file mode 100644 index 0000000..a5ec1fd --- /dev/null +++ b/doc/modules/table-of-contents.md @@ -0,0 +1,47 @@ +# Table of Contents +You can display a table of contents, showing a page tree of your confluence documentation. + +## Syntax +```markdown + ```TOC + [options] + ``` +``` +or +```markdown + ```table-of-contents + [options] + ``` +``` + +## Options +You can specify options for the page tree between the code blocks for the macro. + +`[option]=[value]` + +All options are optional, and can be left out. + +### `root` +This option specifies the root of the page tree. The root can either be the name of a page under the page containing the tree, or you can use '@self' or '@home' to reference the page containing the tree, or the home page, respectivly. + +Default = @self + +### `start-depth` +Any positive number representing the level to which child pages are shown when the page tree is first displayed. + +Default = 1 + +## Examples +```markdown + ```TOC + root=@home + start-depth=3 + ``` +``` + +You can also create a tree with no specified options like so: + +```markdown + ```TOC + ``` +``` \ No newline at end of file diff --git a/doc/prefix.md b/doc/prefix.md new file mode 100644 index 0000000..e589f94 --- /dev/null +++ b/doc/prefix.md @@ -0,0 +1,11 @@ +# Prefix file +Any folder or folderpage can contain a prefix.txt file. This can specify a prefix for the name of all it's child pages. The file must only contain __ONE__ line, which is the prefix for the pages. + +## Example +The following filestrcture, where prefix.txt contains the line: `DC5.0.0 ` + +![prefix example](./images/prefix%20example.PNG) + +Will result in the following pages: + +![prefix results](./images/prefix%20result.PNG) \ No newline at end of file diff --git a/doc/settings.md b/doc/settings.md new file mode 100644 index 0000000..713b6dd --- /dev/null +++ b/doc/settings.md @@ -0,0 +1,24 @@ +# Space settings +The root folder for your documentation can contain a settings.json file. This file can specify settings for how your documentation should be parsed and uploaded to confluence. + +--- +## Settings + +### `parent_page` +The name of the parent page for all of your documentation. This defaults to 'Overview', which is the standard root page for confluence spaces. + +Type: String +Required: No + +--- +### `modules` +This is a list of all the modules you want to be used in your system. Only modules listed here, will be used. If this option is not specified, all modules will be used. + +Available modules: + - mermaid + - jira-tickets + - attachment_link + - table_of_contents + +Type: List of Strings +Required: No \ No newline at end of file diff --git a/documentation/DAM Center 5/index.md b/documentation/DAM Center 5/index.md index 77e684b..f645d9a 100644 --- a/documentation/DAM Center 5/index.md +++ b/documentation/DAM Center 5/index.md @@ -1,5 +1,5 @@ # DAM Center 5 ```TOC -search-depth=3 +start-depth=3 ``` \ No newline at end of file From 3a7078651fc65c562a0bd297aebfcbf14d6fc768 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Tue, 3 May 2022 13:38:14 +0200 Subject: [PATCH 30/72] docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64bdce3..a27dc1e 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Will look like this, once uploaded to Confluence: ![pagestructure](./doc/images/pagestructure.PNG) ## Modules -This tools comes with a number of modules, which add extra markdown syntax, specialized for Confluence and other tools. +This tool comes with a number of modules, which add extra markdown syntax, specialized for Confluence and other tools. - [Jira Tickets](./doc/modules/jira-tickets.md) - [Attachments](./doc/modules/attachments.md) From 14970b546b983716749a859b085217bb22b0a716 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Tue, 3 May 2022 13:41:32 +0200 Subject: [PATCH 31/72] cleaning --- .github/workflows/main.yaml | 13 +++++-------- .github/workflows/test.yaml | 2 +- Documentation2/page 1/index.md | 5 ----- Documentation2/page 1/page 1.1.md | 0 Documentation2/page 1/page 1.2/index.md | 1 - Documentation2/page 1/page 1.2/page 1.2.1.md | 0 Documentation2/page 2/index.md | 4 ---- Documentation2/page 3/image.png | Bin 3092 -> 0 bytes Documentation2/page 3/index.md | 3 --- Documentation2/page 3/zip file.zip | Bin 504 -> 0 bytes Documentation2/settings.json | 9 --------- 11 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 Documentation2/page 1/index.md delete mode 100644 Documentation2/page 1/page 1.1.md delete mode 100644 Documentation2/page 1/page 1.2/index.md delete mode 100644 Documentation2/page 1/page 1.2/page 1.2.1.md delete mode 100644 Documentation2/page 2/index.md delete mode 100644 Documentation2/page 3/image.png delete mode 100644 Documentation2/page 3/index.md delete mode 100644 Documentation2/page 3/zip file.zip delete mode 100644 Documentation2/settings.json diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6e8ac30..aad4581 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,11 +1,9 @@ name: Upload Documentation -# on: -# pull_request: -# branches: -# - main - -on: [push] +on: + pull_request: + branches: + - main jobs: @@ -19,8 +17,7 @@ jobs: env: CONFLUENCE_URL: 'https://at-bachelor.atlassian.net' CONFLUENCE_SPACE_KEY: '~955037829' - #AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} - AUTH_TOKEN: 'bGFyc2UxOUBzdHVkZW50LnNkdS5kazpoYVpaSEM5MTFZc0ZUb2pXODV3WTk3Nzg=' + AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} uses: ./ # Uses an action in the root directory id: Convert with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 36dbc70..2aa2784 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,6 @@ name: Run PyTest -# on: [push] +on: [push] jobs: build: diff --git a/Documentation2/page 1/index.md b/Documentation2/page 1/index.md deleted file mode 100644 index 1cbe080..0000000 --- a/Documentation2/page 1/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# this is a page 1 - -bare lige en hurtig test for at se om en page bliver bredere når man skriver en meget lang tekst, og om det så også går ud over størrelsen på et billede på siden - -![graph](documentation/attachments/index-1.png) \ No newline at end of file diff --git a/Documentation2/page 1/page 1.1.md b/Documentation2/page 1/page 1.1.md deleted file mode 100644 index e69de29..0000000 diff --git a/Documentation2/page 1/page 1.2/index.md b/Documentation2/page 1/page 1.2/index.md deleted file mode 100644 index d540935..0000000 --- a/Documentation2/page 1/page 1.2/index.md +++ /dev/null @@ -1 +0,0 @@ -# this is page 1.2 \ No newline at end of file diff --git a/Documentation2/page 1/page 1.2/page 1.2.1.md b/Documentation2/page 1/page 1.2/page 1.2.1.md deleted file mode 100644 index e69de29..0000000 diff --git a/Documentation2/page 2/index.md b/Documentation2/page 2/index.md deleted file mode 100644 index 7bf8512..0000000 --- a/Documentation2/page 2/index.md +++ /dev/null @@ -1,4 +0,0 @@ -# this is a page 2 -This change is only thing i push -BAC-74 -this ticket, BAC-77, is within a line \ No newline at end of file diff --git a/Documentation2/page 3/image.png b/Documentation2/page 3/image.png deleted file mode 100644 index 57d95e38ad1e395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nKR8(?ICGn<R#r6MCqlSzerm7Z z(;o!itmW#jx=b`tl=+fx^v!f#cs=)~uQbWI?~?yx;+OjK?H9-T5@nkTI5;zU;w_y3 zH%Y>M`T-J_T~HF~5JYfdAMu#!sZ`Gi4=;L-{Mw9u>qf=BU$UqW`W&jZYXewsfXej# z6^-CxwbX;ojrVn>>%Nv)Qb?4<*kdWhZh<_;d8do^y%@ZJ>pjt^_oIfekGV>*zzlv+ zy!&b~y}x`L$^U@z4ZB9`mj-r+Oc!9UY<{g>xu(%Czv4Si)pTr|zdLR-SiNG1dL%!{ zx$iKrrWT9dlziCCalZ4X<k@D9EjBr&?H;paX(Zx_)G^ejuHneIVqWEtY}gF*U4%`w zDSAC_A6m7usm`r5X82rFjr-jsf8VPK^4EL4%gq$d=&v(~#Wt+mvIc@-x0Qy)9Tnp2 IxsBm}1CHRoFaQ7m diff --git a/Documentation2/page 3/index.md b/Documentation2/page 3/index.md deleted file mode 100644 index 19de9cf..0000000 --- a/Documentation2/page 3/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# this is page 3 - -![test](./zip file.zip) \ No newline at end of file diff --git a/Documentation2/page 3/zip file.zip b/Documentation2/page 3/zip file.zip deleted file mode 100644 index a01abc1416a5ab70baf8bbb738539123c0bc7f5e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 504 zcmWIWW@Zs#00BY!IU!&Ml;8x?Rhb3xC8@<F`T;;?Twn=wWlG4({3=TnN>a0nOH%T) zOLJ56N)$AVH1$d<N)Y<_(X5ffs~@75k;$F`mm^icu3}&ifYNX$b1^7@g%}wm7@qgM z-F77E1|y8FTl0Axh#%k$G8&i1U`B(?Q3qnU(Kx+{&rX=#$aZ1|2C|*$c<lrQ4YGaV dt)W{$enO`Myjj_R1~D)Lp*<r5!(tGJ0RSh*a}59h diff --git a/Documentation2/settings.json b/Documentation2/settings.json deleted file mode 100644 index e09bac3..0000000 --- a/Documentation2/settings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "parent_page": "Overview", - "modules": { - "mermaid": true, - "jira-tickets": true, - "attachment_link": true, - "table_of_contents": true - } -} \ No newline at end of file From ef5ba4cead77429ddf1a5ea84a90fef212d3e8f6 Mon Sep 17 00:00:00 2001 From: larse19 <55133668+larse19@users.noreply.github.com> Date: Tue, 3 May 2022 14:29:06 +0200 Subject: [PATCH 32/72] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a27dc1e..591904d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The API token generated for the user. We recommend setting this as a GitHub secr ### `fileslocation` -**Required** The path from the root of your repository, to the folder containing the markdown documentation. Default `.\`. +**Required** The path from the root of your repository, to the folder containing the markdown documentation. Default `./`. ## Outputs @@ -99,4 +99,4 @@ This tool comes with a number of modules, which add extra markdown syntax, speci - [Jira Tickets](./doc/modules/jira-tickets.md) - [Attachments](./doc/modules/attachments.md) - [Mermaid.js](./doc/modules/mermaid.md) -- [Table of Contents](./doc/modules/table-of-contents.md) \ No newline at end of file +- [Table of Contents](./doc/modules/table-of-contents.md) From d545c107814149a92bb799fd6593b73b69f7a9ed Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Tue, 3 May 2022 15:03:11 +0200 Subject: [PATCH 33/72] mmb fix module loader --- MarkdownToConfluence/module_loader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MarkdownToConfluence/module_loader.py b/MarkdownToConfluence/module_loader.py index d1788f7..a607497 100644 --- a/MarkdownToConfluence/module_loader.py +++ b/MarkdownToConfluence/module_loader.py @@ -1,5 +1,6 @@ import os, json from posixpath import basename +import pathlib def run_module(module_name: str, filename=None): name = "modules." + module_name @@ -11,7 +12,7 @@ def run_module(module_name: str, filename=None): def get_modules(settings_file=None): modules = [] - modules_location = './MarkdownToConfluence/modules' + modules_location = str(pathlib.Path(__file__).parent.resolve()) + '/modules' for filename in os.listdir(modules_location): f = os.path.join(modules_location, filename) # checking if it is a file From 6875fb59f5ca5927c0b89d82e9c40e20563ac703 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Tue, 3 May 2022 16:10:36 +0200 Subject: [PATCH 34/72] ting --- .github/workflows/test.yaml | 3 +- .../confluence/check_if_page_exists.py | 7 ++-- MarkdownToConfluence/main.py | 34 ++++++++++++------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2aa2784..4e1848d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,7 +22,8 @@ jobs: env: CONFLUENCE_URL: 'https://at-bachelor.atlassian.net/wiki' CONFLUENCE_SPACE_KEY: '~955037829' - AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} + AUTH_USERNAME: ${{ secrets.AUTH_USERNAME }} + AUTH_API_TOKEN: ${{ secrets.AUTH_API_TOKEN }} INPUT_FILESLOCATION: './documentation' run: | . venv/bin/activate diff --git a/MarkdownToConfluence/confluence/check_if_page_exists.py b/MarkdownToConfluence/confluence/check_if_page_exists.py index faa086c..c35d992 100644 --- a/MarkdownToConfluence/confluence/check_if_page_exists.py +++ b/MarkdownToConfluence/confluence/check_if_page_exists.py @@ -1,7 +1,9 @@ from urllib.parse import quote import requests, json import os -from requests.auth import HTTPBasicAuth +from requests.auth import HTTPBasicAuth + +from MarkdownToConfluence.confluence.PageNotFoundError import PageNotFoundError BASE_URL = os.environ.get("CONFLUENCE_URL") AUTH_USERNAME = os.environ.get("AUTH_USERNAME") @@ -23,6 +25,7 @@ def page_exists_in_space(title: str, spaceKey: str) -> bool: return False else: print(response.text) + return False def get_page_id(title: str, spaceKey: str) -> str: url = f"{BASE_URL}/wiki/rest/api/content?spaceKey={spaceKey}&title={quote(title)}" @@ -35,6 +38,6 @@ def get_page_id(title: str, spaceKey: str) -> str: if(len(results) > 0): return results[0]['id'] else: - return 'Page does not exist' + raise PageNotFoundError else: print(response.text) \ No newline at end of file diff --git a/MarkdownToConfluence/main.py b/MarkdownToConfluence/main.py index 679f900..da848af 100644 --- a/MarkdownToConfluence/main.py +++ b/MarkdownToConfluence/main.py @@ -1,5 +1,6 @@ from importlib.resources import path from posixpath import dirname, basename +from MarkdownToConfluence.confluence.PageNotFoundError import PageNotFoundError from confluence import page_exists_in_space, get_page_id from confluence import create_page from confluence import update_page_content @@ -63,22 +64,28 @@ def upload_documentation(path_name:str, root:str): #print(f"Uploading {page_name} with {parent_name} as parent") #If the page already exists, just update it - if(page_exists_in_space(page_name, space_obj["key"])): - page_id = get_page_id(page_name, space_obj['key']) - response = update_page_content(path_name, page_name, page_id, space_obj) - if(response.status_code == 200): - print(f"Updated {page_name} with {parent_name} as parent") + if(page_exists_in_space(page_name, SPACE_KEY)): + try: + page_id = get_page_id(page_name, SPACE_KEY) + response = update_page_content(path_name, page_name, page_id, space_obj) + if(response.status_code == 200): + print(f"Updated {page_name} with {parent_name} as parent") + except PageNotFoundError: + print(PageNotFoundError(page_name, SPACE_KEY)) #Else, create the page else: if(parent_name != "none"): #Create page as a child page, if there is a parent - if(not page_exists_in_space(parent_name, space_obj['key'])): #If the parent page doesn't exists, create it - print(f"uploading parent: {parent_name}") - if(file_name != "index"): - subprocess.call(["bash", "/MarkdownToConfluence/convert.sh", f"{dirname(path_name)}/index.md"]) - else: - subprocess.call(["bash", "/MarkdownToConfluence/convert.sh", f"{dirname(dirname(path_name))}/index.md"]) - parent_id = get_page_id(parent_name, space_obj['key']) - response = create_page(path_name, page_name, space_obj, parent_id) + try: + if(not page_exists_in_space(parent_name, SPACE_KEY)): #If the parent page doesn't exists, create it + print(f"uploading parent: {parent_name}") + if(file_name != "index"): + subprocess.call(["bash", "/MarkdownToConfluence/convert.sh", f"{dirname(path_name)}/index.md"]) + else: + subprocess.call(["bash", "/MarkdownToConfluence/convert.sh", f"{dirname(dirname(path_name))}/index.md"]) + parent_id = get_page_id(parent_name, SPACE_KEY) + response = create_page(path_name, page_name, space_obj, parent_id) + except PageNotFoundError: + print(PageNotFoundError(page_name, SPACE_KEY)) else: response = create_page(path_name, page_name, space_obj) #Create page as top page if(response.status_code == 200): @@ -90,6 +97,7 @@ def upload_documentation(path_name:str, root:str): else: print(f"Error uploading {page_name}. Status code {response.status_code}") print(response.text) + sys.exit(1) return response if __name__ == "__main__": From 345064785319c7a71b441eb1bfdfb0863c95b166 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Tue, 3 May 2022 16:15:48 +0200 Subject: [PATCH 35/72] ting --- MarkdownToConfluence/confluence/check_if_page_exists.py | 5 +++-- MarkdownToConfluence/main.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/MarkdownToConfluence/confluence/check_if_page_exists.py b/MarkdownToConfluence/confluence/check_if_page_exists.py index c35d992..2421367 100644 --- a/MarkdownToConfluence/confluence/check_if_page_exists.py +++ b/MarkdownToConfluence/confluence/check_if_page_exists.py @@ -38,6 +38,7 @@ def get_page_id(title: str, spaceKey: str) -> str: if(len(results) > 0): return results[0]['id'] else: - raise PageNotFoundError + raise PageNotFoundError(title, spaceKey) else: - print(response.text) \ No newline at end of file + print(response.text) + raise PageNotFoundError(title, spaceKey) \ No newline at end of file diff --git a/MarkdownToConfluence/main.py b/MarkdownToConfluence/main.py index da848af..094e5f8 100644 --- a/MarkdownToConfluence/main.py +++ b/MarkdownToConfluence/main.py @@ -70,8 +70,8 @@ def upload_documentation(path_name:str, root:str): response = update_page_content(path_name, page_name, page_id, space_obj) if(response.status_code == 200): print(f"Updated {page_name} with {parent_name} as parent") - except PageNotFoundError: - print(PageNotFoundError(page_name, SPACE_KEY)) + except PageNotFoundError as e: + print(e) #Else, create the page else: if(parent_name != "none"): #Create page as a child page, if there is a parent @@ -84,8 +84,8 @@ def upload_documentation(path_name:str, root:str): subprocess.call(["bash", "/MarkdownToConfluence/convert.sh", f"{dirname(dirname(path_name))}/index.md"]) parent_id = get_page_id(parent_name, SPACE_KEY) response = create_page(path_name, page_name, space_obj, parent_id) - except PageNotFoundError: - print(PageNotFoundError(page_name, SPACE_KEY)) + except PageNotFoundError as e: + print(e) else: response = create_page(path_name, page_name, space_obj) #Create page as top page if(response.status_code == 200): From 5e91bae31e7644cb47e1e05f367cb58fb7aa1528 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Tue, 3 May 2022 16:23:19 +0200 Subject: [PATCH 36/72] ting --- MarkdownToConfluence/main.py | 2 +- MarkdownToConfluence/utils/page_file_info.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MarkdownToConfluence/main.py b/MarkdownToConfluence/main.py index 094e5f8..eccc725 100644 --- a/MarkdownToConfluence/main.py +++ b/MarkdownToConfluence/main.py @@ -74,7 +74,7 @@ def upload_documentation(path_name:str, root:str): print(e) #Else, create the page else: - if(parent_name != "none"): #Create page as a child page, if there is a parent + if(parent_name != ""): #Create page as a child page, if there is a parent try: if(not page_exists_in_space(parent_name, SPACE_KEY)): #If the parent page doesn't exists, create it print(f"uploading parent: {parent_name}") diff --git a/MarkdownToConfluence/utils/page_file_info.py b/MarkdownToConfluence/utils/page_file_info.py index eff3215..f7786dd 100644 --- a/MarkdownToConfluence/utils/page_file_info.py +++ b/MarkdownToConfluence/utils/page_file_info.py @@ -42,7 +42,7 @@ def get_page_name_from_path(path: str, root: str): # Returns the page name of the parent of the file in path. Returns default value if no parent exists i system # Returns "" if path == root -def get_parent_name_from_path(path: str, root: str, default="Overview"): +def get_parent_name_from_path(path: str, root: str, default=""): if(path == root): return "" if("settings.json" in os.listdir(root)): From 2864fb542c7c51d1cdaa001ff45bba4166758310 Mon Sep 17 00:00:00 2001 From: larse19 <55133668+larse19@users.noreply.github.com> Date: Tue, 3 May 2022 16:53:55 +0200 Subject: [PATCH 37/72] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 591904d..77bfcf8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This action converts your markdown files into the specified Atlassian Confluence # Setup ## API User Token -First you need to create an API token for the user, you want to use for the action. We recommend that you create a new user, that is only used for this action, in order to get the full benefits from the action. See [here](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) for how to set up your API token. +First you need to create an API token for the user, you want to use for the action. We recommend that you create a new user, that is only used for this action, in order to get the full benefits from the action. This user should also have full permission to make changes on the space. See [here](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) for how to set up your API token. ## Environment Variables The necessary environment variables are as follows: From 78f7fe34b9f7636496685314788de676b59f1905 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Tue, 3 May 2022 17:46:48 +0200 Subject: [PATCH 38/72] trello boards --- .github/workflows/main.yaml | 1 - .../jira_tickets/jira_tickets_parser.py | 2 +- .../modules/trello_boards/__init__.py | 1 + .../trello_boards/trello_boards_parser.py | 22 +++++++++++++++++++ README.md | 1 + doc/modules/trello-boards.md | 2 ++ documentation/page 2/index.md | 5 ++++- 7 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 MarkdownToConfluence/modules/trello_boards/__init__.py create mode 100644 MarkdownToConfluence/modules/trello_boards/trello_boards_parser.py create mode 100644 doc/modules/trello-boards.md diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e30c466..0346ed3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,7 +6,6 @@ on: - main - jobs: hello_world_job: runs-on: ubuntu-latest diff --git a/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py b/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py index 51f48d3..9a16db6 100644 --- a/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py +++ b/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py @@ -14,7 +14,7 @@ def parse_ticket(line: str) -> str: tickets = re.findall(r'\d+-[A-Z]+(?!-?[a-zA-Z]{1,10})', line[::-1]) #official atlassian regex magic new_line = line for ticket in tickets: - if(check_if_ticket_exists): # TODO: Raise warning in pipeline + if(check_if_ticket_exists(ticket)): # TODO: Raise warning in pipeline ticket = ticket[::-1] ticket_tag = f"<ac:structured-macro ac:name='jira'><ac:parameter ac:name='columns'>key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name='key'>{ticket}</ac:parameter> </ac:structured-macro>" new_line = new_line.replace(ticket, ticket_tag) diff --git a/MarkdownToConfluence/modules/trello_boards/__init__.py b/MarkdownToConfluence/modules/trello_boards/__init__.py new file mode 100644 index 0000000..0075ddd --- /dev/null +++ b/MarkdownToConfluence/modules/trello_boards/__init__.py @@ -0,0 +1 @@ +from .trello_boards_parser import run \ No newline at end of file diff --git a/MarkdownToConfluence/modules/trello_boards/trello_boards_parser.py b/MarkdownToConfluence/modules/trello_boards/trello_boards_parser.py new file mode 100644 index 0000000..9add52a --- /dev/null +++ b/MarkdownToConfluence/modules/trello_boards/trello_boards_parser.py @@ -0,0 +1,22 @@ +import re, requests + +def parse_boards(filename: str): + with open(filename, 'r') as f: + lines = f.readlines() + with open(filename, 'w') as f: + for line in lines: + res = parse_board(line) + new_line = res if res.endswith('\n') else res + '\n' + f.write(new_line) + +def parse_board(line: str) -> str: + boards = re.findall(r'((https://)(trello.com/b/)[a-zA-Z\d]+([/][\w-]+)*)', line) #official atlassian regex magic + new_line = line + for board in boards: + board_url = board[0] + board_tag = f'<ac:structured-macro ac:name=\"trello-board\" ac:schema-version=\"1\" data-layout=\"default\" ac:macro-id=\"39a55cc39b49f1a520d43a1c87bf1f07\"><ac:parameter ac:name=\"url\">{board_url}</ac:parameter><ac:parameter ac:name=\"height\">760px</ac:parameter></ac:structured-macro>' + new_line = new_line.replace(board_url, board_tag) + return new_line + +def run(filename): + parse_boards(filename) \ No newline at end of file diff --git a/README.md b/README.md index 77bfcf8..d67591e 100644 --- a/README.md +++ b/README.md @@ -100,3 +100,4 @@ This tool comes with a number of modules, which add extra markdown syntax, speci - [Attachments](./doc/modules/attachments.md) - [Mermaid.js](./doc/modules/mermaid.md) - [Table of Contents](./doc/modules/table-of-contents.md) +- [Trello Boards](./doc/modules/trello-boards.md) diff --git a/doc/modules/trello-boards.md b/doc/modules/trello-boards.md new file mode 100644 index 0000000..286cb18 --- /dev/null +++ b/doc/modules/trello-boards.md @@ -0,0 +1,2 @@ +# Trello Boards +You can display a trello board on your page, by simply pasting the URL for the board, anywhere in the markdown file. The Trello board will then be rendered directly into your page. \ No newline at end of file diff --git a/documentation/page 2/index.md b/documentation/page 2/index.md index 7bf8512..f057f27 100644 --- a/documentation/page 2/index.md +++ b/documentation/page 2/index.md @@ -1,4 +1,7 @@ # this is a page 2 This change is only thing i push BAC-74 -this ticket, BAC-77, is within a line \ No newline at end of file +this ticket, BAC-77, is within a line + +Trello board: +https://trello.com/b/199TqwVE/project-guide \ No newline at end of file From 59b96913d954aea2eb47d249b08a9f9dbf8e89d2 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 11:29:22 +0200 Subject: [PATCH 39/72] fixed jira tickets --- .../modules/jira_tickets/jira_tickets_parser.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py b/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py index 9a16db6..3086a64 100644 --- a/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py +++ b/MarkdownToConfluence/modules/jira_tickets/jira_tickets_parser.py @@ -1,5 +1,6 @@ import re import requests, json, os +from requests.auth import HTTPBasicAuth def parse_tickets(filename: str): with open(filename, 'r') as f: @@ -23,10 +24,11 @@ def parse_ticket(line: str) -> str: def check_if_ticket_exists(ticket: str): base_url = os.environ.get('CONFLUENCE_URL') url = f'{base_url}/rest/api/3/issue/{ticket}' - auth = os.environ.get('AUTH_TOKEN') # TODO: change using username and token with; from requests.auth import HTTPBasicAuth + username = os.environ.get('AUTH_USERNAME') + token = os.environ.get('AUTH_API_TOKEN') + auth = HTTPBasicAuth(username, token) headers = { - 'Authorization': auth, 'Content-Type': 'application/json; charset=utf-8', 'User-Agent': 'python' } @@ -35,6 +37,7 @@ def check_if_ticket_exists(ticket: str): "GET", url, headers=headers, + auth=auth ) return response.status_code == 200 From 05c5c5c4078cb5f4e80447023d8bb83448c83f2e Mon Sep 17 00:00:00 2001 From: TTengs <theistengs@gmail.com> Date: Wed, 4 May 2022 11:50:34 +0200 Subject: [PATCH 40/72] abe --- documentation/page 1/page 1.1/abe.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/page 1/page 1.1/abe.md b/documentation/page 1/page 1.1/abe.md index 1c48499..70b073c 100644 --- a/documentation/page 1/page 1.1/abe.md +++ b/documentation/page 1/page 1.1/abe.md @@ -1,3 +1,4 @@ # page abe -VIRKER DET HER!? \ No newline at end of file +VIRKER DET HER!? +abemand \ No newline at end of file From 8adf68a6ee7c38b1cbdf3f5893b26a4c28e8482c Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 11:51:54 +0200 Subject: [PATCH 41/72] fixed jira tickets --- documentation/page 1/page 1.1/abe.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/page 1/page 1.1/abe.md b/documentation/page 1/page 1.1/abe.md index 1c48499..55ef28c 100644 --- a/documentation/page 1/page 1.1/abe.md +++ b/documentation/page 1/page 1.1/abe.md @@ -1,3 +1,4 @@ # page abe -VIRKER DET HER!? \ No newline at end of file +VIRKER DET HER!? +dasdasdk \ No newline at end of file From 5d1393cb669748ff3f18c4cfa2588e4473ee6445 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 11:52:09 +0200 Subject: [PATCH 42/72] fixed jira tickets --- documentation/page 1/page 1.1/abe.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/documentation/page 1/page 1.1/abe.md b/documentation/page 1/page 1.1/abe.md index 55ef28c..1c48499 100644 --- a/documentation/page 1/page 1.1/abe.md +++ b/documentation/page 1/page 1.1/abe.md @@ -1,4 +1,3 @@ # page abe -VIRKER DET HER!? -dasdasdk \ No newline at end of file +VIRKER DET HER!? \ No newline at end of file From 59a56a4299c27f721868a5cbba36719086108cf9 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:23:04 +0200 Subject: [PATCH 43/72] fdf --- documentation/page 1/page 1.1/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/page 1/page 1.1/index.md b/documentation/page 1/page 1.1/index.md index 9843dd4..4aaa599 100644 --- a/documentation/page 1/page 1.1/index.md +++ b/documentation/page 1/page 1.1/index.md @@ -1 +1,2 @@ -# page 1.1 \ No newline at end of file +# page 1.1 +dqwdqwd \ No newline at end of file From f604b718c802c10496c329dc720763283c9759f2 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:32:15 +0200 Subject: [PATCH 44/72] ref test --- .github/workflows/main.yaml | 2 ++ Dockerfile | 30 +++++++++++++++--------------- MarkdownToConfluence/entrypoint.sh | 2 +- action.yaml | 3 +++ 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0346ed3..851687b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -23,3 +23,5 @@ jobs: id: Convert with: fileslocation: './documentation' + target-branch: ${{ github.base_ref }} + diff --git a/Dockerfile b/Dockerfile index d088cd7..9ce2407 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,26 @@ FROM ubuntu:latest -RUN apt-get update && apt-get install -y software-properties-common gcc && \ - add-apt-repository -y ppa:deadsnakes/ppa +# RUN apt-get update && apt-get install -y software-properties-common gcc && \ +# add-apt-repository -y ppa:deadsnakes/ppa -RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv +# RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv -RUN apt-get install -y pandoc +# RUN apt-get install -y pandoc #ffmpeg libsm6 libxext6 -RUN python3 -m venv venv -RUN chmod +x /venv/* -RUN . /venv/bin/activate +# RUN python3 -m venv venv +# RUN chmod +x /venv/* +# RUN . /venv/bin/activate -COPY setup.py /setup.py -COPY requirements.txt requirements.txt -RUN pip install -r requirements.txt +# COPY setup.py /setup.py +# COPY requirements.txt requirements.txt +# RUN pip install -r requirements.txt COPY ./MarkdownToConfluence /MarkdownToConfluence -RUN pip install -e . +# RUN pip install -e . -RUN chmod +x /MarkdownToConfluence/convert_all.sh -RUN chmod +x /MarkdownToConfluence/convert.sh -#RUN chmod +x /MarkdownToConfluence/entrypoint.sh +# RUN chmod +x /MarkdownToConfluence/convert_all.sh +# RUN chmod +x /MarkdownToConfluence/convert.sh +RUN chmod +x /MarkdownToConfluence/entrypoint.sh -ENTRYPOINT [ "sh", "/MarkdownToConfluence/convert_all.sh" ] \ No newline at end of file +ENTRYPOINT [ "bash", "/MarkdownToConfluence/entrypoint.sh" ] \ No newline at end of file diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 55fc5f5..c3572dd 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -1,2 +1,2 @@ #!/bin/bash -ls \ No newline at end of file +echo ${INPUT_TARGET-BRANCH} \ No newline at end of file diff --git a/action.yaml b/action.yaml index 32f14c6..8eb48f9 100644 --- a/action.yaml +++ b/action.yaml @@ -5,6 +5,9 @@ inputs: description: 'location of documentation' required: false default: './' + target-branch: + required: false + default: 'peter' outputs: status: description: 'Status of the converter' From 5be13b7bca608e82e1fa6d21444b42a1d83a2876 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:36:19 +0200 Subject: [PATCH 45/72] ref test --- .github/workflows/main.yaml | 2 ++ MarkdownToConfluence/entrypoint.sh | 3 ++- action.yaml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 851687b..a29fceb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -24,4 +24,6 @@ jobs: with: fileslocation: './documentation' target-branch: ${{ github.base_ref }} + source-branch: ${{ github.head_ref }} + diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index c3572dd..9057364 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -1,2 +1,3 @@ #!/bin/bash -echo ${INPUT_TARGET-BRANCH} \ No newline at end of file +echo ${INPUT_TARGET-BRANCH} +echo ${INPUT_SOURCE-BRANCH} \ No newline at end of file diff --git a/action.yaml b/action.yaml index 8eb48f9..eab3dd9 100644 --- a/action.yaml +++ b/action.yaml @@ -8,6 +8,9 @@ inputs: target-branch: required: false default: 'peter' + source-branch: + required: false + default: 'peter' outputs: status: description: 'Status of the converter' From 1c13be078bde10fe750dd7d72e5c84fc8cf8ccae Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:38:04 +0200 Subject: [PATCH 46/72] ref test --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a29fceb..eead301 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -23,7 +23,7 @@ jobs: id: Convert with: fileslocation: './documentation' - target-branch: ${{ github.base_ref }} - source-branch: ${{ github.head_ref }} + target-branch: $GITHUB_BASE_REF + source-branch: $GITHUB_HEAD_REF From e6fd4e00683842b28485b3a82422bf851d8e4ea4 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:39:10 +0200 Subject: [PATCH 47/72] ref test --- MarkdownToConfluence/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 9057364..5de1e8d 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -1,3 +1,4 @@ #!/bin/bash echo ${INPUT_TARGET-BRANCH} -echo ${INPUT_SOURCE-BRANCH} \ No newline at end of file +echo ${INPUT_SOURCE-BRANCH} +echo $(printenv) \ No newline at end of file From b75ef28d1492c486829d2b42df3ec38da53e602c Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:43:36 +0200 Subject: [PATCH 48/72] ref test --- MarkdownToConfluence/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 5de1e8d..8a1aa6e 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -1,4 +1,4 @@ #!/bin/bash -echo ${INPUT_TARGET-BRANCH} -echo ${INPUT_SOURCE-BRANCH} -echo $(printenv) \ No newline at end of file +echo ${GITHUB_BASE_REF} +echo ${GITHUB_HEAD_REF} +#echo $(printenv) \ No newline at end of file From 9d36637e5b1ce2aca60647200eabf5093223b100 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:45:45 +0200 Subject: [PATCH 49/72] ref test --- MarkdownToConfluence/entrypoint.sh | 3 +-- documentation/page 1/index.md | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 8a1aa6e..5b41984 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -1,4 +1,3 @@ #!/bin/bash -echo ${GITHUB_BASE_REF} -echo ${GITHUB_HEAD_REF} +echo "$(git diff --name-only origin/${GITHUB_BASE_REF} './documentation')" #echo $(printenv) \ No newline at end of file diff --git a/documentation/page 1/index.md b/documentation/page 1/index.md index 1cbe080..9fbc342 100644 --- a/documentation/page 1/index.md +++ b/documentation/page 1/index.md @@ -2,4 +2,6 @@ bare lige en hurtig test for at se om en page bliver bredere når man skriver en meget lang tekst, og om det så også går ud over størrelsen på et billede på siden -![graph](documentation/attachments/index-1.png) \ No newline at end of file +![graph](documentation/attachments/index-1.png) + +dqwdwqd \ No newline at end of file From ae7f5cd54e3a1f301953336deb13e22ff42e4b42 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:47:34 +0200 Subject: [PATCH 50/72] ref test --- MarkdownToConfluence/entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 5b41984..6f2234e 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -1,3 +1,7 @@ #!/bin/bash +git init +git config --global --add safe.directory /github/workspace +git config --global core.pager "less -FRSX" +git fetch echo "$(git diff --name-only origin/${GITHUB_BASE_REF} './documentation')" #echo $(printenv) \ No newline at end of file From deff0c64a0abcd3c000c6a5512695938e87eb04d Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:49:43 +0200 Subject: [PATCH 51/72] ref test --- MarkdownToConfluence/entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 6f2234e..4c7c341 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash -git init -git config --global --add safe.directory /github/workspace -git config --global core.pager "less -FRSX" -git fetch -echo "$(git diff --name-only origin/${GITHUB_BASE_REF} './documentation')" +/usr/bin/git init +/usr/bin/git config --global --add safe.directory /github/workspace +/usr/bin/git config --global core.pager "less -FRSX" +/usr/bin/git fetch +/usr/bin/git diff --name-only origin/${GITHUB_BASE_REF} './documentation' #echo $(printenv) \ No newline at end of file From 8c09f6f8f0edbb7b9db6eceb2c1f7508ef334b6b Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:50:40 +0200 Subject: [PATCH 52/72] ref test --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9ce2407..d4ad5d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ FROM ubuntu:latest # RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv +RUN apt-get update && apt-get install -y git + # RUN apt-get install -y pandoc #ffmpeg libsm6 libxext6 From 33ab64250ec98d013e8700316ceb20fcaf91691f Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:51:02 +0200 Subject: [PATCH 53/72] ref test --- MarkdownToConfluence/entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 4c7c341..ca19f13 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/bash -/usr/bin/git init -/usr/bin/git config --global --add safe.directory /github/workspace -/usr/bin/git config --global core.pager "less -FRSX" -/usr/bin/git fetch -/usr/bin/git diff --name-only origin/${GITHUB_BASE_REF} './documentation' +git init +git config --global --add safe.directory /github/workspace +git config --global core.pager "less -FRSX" +git fetch +git diff --name-only origin/${GITHUB_BASE_REF} './documentation' #echo $(printenv) \ No newline at end of file From de3d1219b6dacad3ca330225767ac44b0ef0b796 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:55:51 +0200 Subject: [PATCH 54/72] ref test --- MarkdownToConfluence/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index ca19f13..e9e81f9 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -2,6 +2,6 @@ git init git config --global --add safe.directory /github/workspace git config --global core.pager "less -FRSX" -git fetch +git fetch -q git diff --name-only origin/${GITHUB_BASE_REF} './documentation' #echo $(printenv) \ No newline at end of file From f6975bde0dcbad7656b4a50d504165f493a279e6 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 12:58:44 +0200 Subject: [PATCH 55/72] ref test --- .github/workflows/main.yaml | 2 -- action.yaml | 6 ------ 2 files changed, 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index eead301..888f2f4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -23,7 +23,5 @@ jobs: id: Convert with: fileslocation: './documentation' - target-branch: $GITHUB_BASE_REF - source-branch: $GITHUB_HEAD_REF diff --git a/action.yaml b/action.yaml index eab3dd9..32f14c6 100644 --- a/action.yaml +++ b/action.yaml @@ -5,12 +5,6 @@ inputs: description: 'location of documentation' required: false default: './' - target-branch: - required: false - default: 'peter' - source-branch: - required: false - default: 'peter' outputs: status: description: 'Status of the converter' From e9ecbaeb518b9e4c3b52175cc27984d58905e729 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 13:00:38 +0200 Subject: [PATCH 56/72] ref test --- .github/workflows/main.yaml | 9 +++++---- MarkdownToConfluence/entrypoint.sh | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 888f2f4..5f0cf04 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,10 +1,11 @@ name: Upload Documentation -on: - pull_request: - branches: - - main +# on: +# pull_request: +# branches: +# - main +on: [pull_request] jobs: hello_world_job: diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index e9e81f9..72bd9ed 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -4,4 +4,3 @@ git config --global --add safe.directory /github/workspace git config --global core.pager "less -FRSX" git fetch -q git diff --name-only origin/${GITHUB_BASE_REF} './documentation' -#echo $(printenv) \ No newline at end of file From e651e6d1144c798c22328166d6bbd79d2a354ab3 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 13:36:18 +0200 Subject: [PATCH 57/72] push test --- .github/workflows/main.yaml | 2 +- MarkdownToConfluence/entrypoint.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5f0cf04..46883b0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -5,7 +5,7 @@ name: Upload Documentation # branches: # - main -on: [pull_request] +on: [push] jobs: hello_world_job: diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 72bd9ed..36e767d 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -3,4 +3,5 @@ git init git config --global --add safe.directory /github/workspace git config --global core.pager "less -FRSX" git fetch -q -git diff --name-only origin/${GITHUB_BASE_REF} './documentation' +#git diff --name-status origin/${GITHUB_BASE_REF} './documentation' +printenv \ No newline at end of file From f68b0640bdbb7c528ae14b4b7dbd1131bc8f6ee5 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 13:54:12 +0200 Subject: [PATCH 58/72] event test --- MarkdownToConfluence/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 36e767d..3c348db 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -4,4 +4,5 @@ git config --global --add safe.directory /github/workspace git config --global core.pager "less -FRSX" git fetch -q #git diff --name-status origin/${GITHUB_BASE_REF} './documentation' -printenv \ No newline at end of file +printenv +cat ${GITHUB_EVENT_PATH} \ No newline at end of file From b3b4a7fd030d0ef4196734241e92907152e49cc3 Mon Sep 17 00:00:00 2001 From: Anders Larsen <larse19@student.sdu.dk> Date: Wed, 4 May 2022 13:58:26 +0200 Subject: [PATCH 59/72] event test --- MarkdownToConfluence/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 3c348db..b5d75bb 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -5,4 +5,5 @@ git config --global core.pager "less -FRSX" git fetch -q #git diff --name-status origin/${GITHUB_BASE_REF} './documentation' printenv -cat ${GITHUB_EVENT_PATH} \ No newline at end of file +${GITHUB_EVENT_PATH} | jq -r '.before' +${GITHUB_EVENT_PATH} | jq -r '.after' \ No newline at end of file From 2e7079911fc074af16fa21f89b4298ce4427c196 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 13:59:39 +0200 Subject: [PATCH 60/72] event test --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d4ad5d6..4ded211 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM ubuntu:latest # RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv -RUN apt-get update && apt-get install -y git +RUN apt-get update && apt-get install -y git jq # RUN apt-get install -y pandoc #ffmpeg libsm6 libxext6 From 3e600bd76339314b8de4b2001ea2100fbc780d72 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:01:29 +0200 Subject: [PATCH 61/72] event test --- MarkdownToConfluence/entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index b5d75bb..081bb36 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -5,5 +5,6 @@ git config --global core.pager "less -FRSX" git fetch -q #git diff --name-status origin/${GITHUB_BASE_REF} './documentation' printenv +chmod -x ${GITHUB_EVENT_PATH} ${GITHUB_EVENT_PATH} | jq -r '.before' ${GITHUB_EVENT_PATH} | jq -r '.after' \ No newline at end of file From 6530b5029ec631961d60b1979b024e0d73263712 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:03:58 +0200 Subject: [PATCH 62/72] event test --- Dockerfile | 4 ++-- MarkdownToConfluence/entrypoint.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4ded211..a2ac1e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ FROM ubuntu:latest # RUN apt-get update && apt-get install -y software-properties-common gcc && \ # add-apt-repository -y ppa:deadsnakes/ppa -# RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv +RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv -RUN apt-get update && apt-get install -y git jq +RUN apt-get update && apt-get install -y git # RUN apt-get install -y pandoc #ffmpeg libsm6 libxext6 diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 081bb36..dc5746c 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -6,5 +6,5 @@ git fetch -q #git diff --name-status origin/${GITHUB_BASE_REF} './documentation' printenv chmod -x ${GITHUB_EVENT_PATH} -${GITHUB_EVENT_PATH} | jq -r '.before' -${GITHUB_EVENT_PATH} | jq -r '.after' \ No newline at end of file +echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['before'])" +echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['after'])" \ No newline at end of file From 8a1fdb6db06a84b9e3eb6a14c51ddd8ee41baf2c Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:05:25 +0200 Subject: [PATCH 63/72] event test --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a2ac1e9..1181d93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,10 @@ FROM ubuntu:latest # RUN apt-get update && apt-get install -y software-properties-common gcc && \ # add-apt-repository -y ppa:deadsnakes/ppa -RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv RUN apt-get update && apt-get install -y git +RUN apt-get install -y python3.6 +#python3-distutils python3-pip python3-apt python3-venv # RUN apt-get install -y pandoc #ffmpeg libsm6 libxext6 From f035c3aa8ae34009dfc06dba8faf4c506ef69e2d Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:07:34 +0200 Subject: [PATCH 64/72] event test --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1181d93..fa3e646 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ FROM ubuntu:latest -# RUN apt-get update && apt-get install -y software-properties-common gcc && \ -# add-apt-repository -y ppa:deadsnakes/ppa + RUN apt-get update && apt-get install -y software-properties-common gcc && \ + add-apt-repository -y ppa:deadsnakes/ppa +RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv -RUN apt-get update && apt-get install -y git -RUN apt-get install -y python3.6 -#python3-distutils python3-pip python3-apt python3-venv +RUN apt-get install -y git # RUN apt-get install -y pandoc #ffmpeg libsm6 libxext6 From dbe805ad78fcdebbe36728e8cc01464056eab0f3 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:11:26 +0200 Subject: [PATCH 65/72] event test --- Dockerfile | 9 +++++---- MarkdownToConfluence/entrypoint.sh | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index fa3e646..72c4795 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ FROM ubuntu:latest - RUN apt-get update && apt-get install -y software-properties-common gcc && \ - add-apt-repository -y ppa:deadsnakes/ppa +RUN apt-get update + #&& apt-get install -y software-properties-common gcc && \ + # add-apt-repository -y ppa:deadsnakes/ppa -RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv +#RUN apt-get install -y python3.6 python3-distutils python3-pip python3-apt python3-venv -RUN apt-get install -y git +RUN apt-get install -y git jq # RUN apt-get install -y pandoc #ffmpeg libsm6 libxext6 diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index dc5746c..2c92957 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -6,5 +6,7 @@ git fetch -q #git diff --name-status origin/${GITHUB_BASE_REF} './documentation' printenv chmod -x ${GITHUB_EVENT_PATH} -echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['before'])" -echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['after'])" \ No newline at end of file +jq .before ${GITHUB_EVENT_PATH} +jq .after ${GITHUB_EVENT_PATH} +#echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['before'])" +#cat ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['after'])" \ No newline at end of file From 901d8e6086623b531569190c1a30631787c6fa46 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:14:23 +0200 Subject: [PATCH 66/72] event test --- MarkdownToConfluence/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 2c92957..84e35a2 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -3,10 +3,10 @@ git init git config --global --add safe.directory /github/workspace git config --global core.pager "less -FRSX" git fetch -q -#git diff --name-status origin/${GITHUB_BASE_REF} './documentation' printenv chmod -x ${GITHUB_EVENT_PATH} -jq .before ${GITHUB_EVENT_PATH} -jq .after ${GITHUB_EVENT_PATH} +before=$(jq .before ${GITHUB_EVENT_PATH}) +after=$(jq .after ${GITHUB_EVENT_PATH}) +git diff --name-status ${before}..${after} './documentation' #echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['before'])" #cat ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['after'])" \ No newline at end of file From 2e527fe997dec0ca6cea58ab4f20b4985d1ca675 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:16:04 +0200 Subject: [PATCH 67/72] event test --- MarkdownToConfluence/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 84e35a2..00a7008 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -7,6 +7,6 @@ printenv chmod -x ${GITHUB_EVENT_PATH} before=$(jq .before ${GITHUB_EVENT_PATH}) after=$(jq .after ${GITHUB_EVENT_PATH}) -git diff --name-status ${before}..${after} './documentation' +git diff --name-status ${before}..${after} -- './documentation' #echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['before'])" #cat ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['after'])" \ No newline at end of file From 7a69036bf8f387218ae6ceced238ebf51c4182f2 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:17:59 +0200 Subject: [PATCH 68/72] event test --- MarkdownToConfluence/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 00a7008..1ffe0f2 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -5,8 +5,8 @@ git config --global core.pager "less -FRSX" git fetch -q printenv chmod -x ${GITHUB_EVENT_PATH} -before=$(jq .before ${GITHUB_EVENT_PATH}) -after=$(jq .after ${GITHUB_EVENT_PATH}) +before=$(jq .before ${GITHUB_EVENT_PATH} | sed "s/^/'/;s/$/'/") +after=$(jq .after ${GITHUB_EVENT_PATH} | sed "s/^/'/;s/$/'/") git diff --name-status ${before}..${after} -- './documentation' #echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['before'])" #cat ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['after'])" \ No newline at end of file From 4ddd71f63676e295e0084be94655be98f9dbc5b4 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:19:37 +0200 Subject: [PATCH 69/72] event test --- MarkdownToConfluence/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 1ffe0f2..2315e9e 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -5,8 +5,8 @@ git config --global core.pager "less -FRSX" git fetch -q printenv chmod -x ${GITHUB_EVENT_PATH} -before=$(jq .before ${GITHUB_EVENT_PATH} | sed "s/^/'/;s/$/'/") -after=$(jq .after ${GITHUB_EVENT_PATH} | sed "s/^/'/;s/$/'/") +before=$(jq .before ${GITHUB_EVENT_PATH} | tr -d '"') +after=$(jq .after ${GITHUB_EVENT_PATH} | tr -d '"') git diff --name-status ${before}..${after} -- './documentation' #echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['before'])" #cat ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['after'])" \ No newline at end of file From ffb77c3925af06fc2243ca7f02275a0e07c062b5 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:22:46 +0200 Subject: [PATCH 70/72] event test --- MarkdownToConfluence/entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 2315e9e..15854aa 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -3,6 +3,7 @@ git init git config --global --add safe.directory /github/workspace git config --global core.pager "less -FRSX" git fetch -q +git pull printenv chmod -x ${GITHUB_EVENT_PATH} before=$(jq .before ${GITHUB_EVENT_PATH} | tr -d '"') From b222a5be948c571edab968e4bc924b9dcdf8fd88 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:25:41 +0200 Subject: [PATCH 71/72] event test --- MarkdownToConfluence/entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MarkdownToConfluence/entrypoint.sh b/MarkdownToConfluence/entrypoint.sh index 15854aa..e255cab 100644 --- a/MarkdownToConfluence/entrypoint.sh +++ b/MarkdownToConfluence/entrypoint.sh @@ -3,11 +3,12 @@ git init git config --global --add safe.directory /github/workspace git config --global core.pager "less -FRSX" git fetch -q -git pull printenv chmod -x ${GITHUB_EVENT_PATH} before=$(jq .before ${GITHUB_EVENT_PATH} | tr -d '"') -after=$(jq .after ${GITHUB_EVENT_PATH} | tr -d '"') +after=${GITHUB_SHA} | tr -d '"' +git fetch origin ${before} --depth=1 +#git pull git diff --name-status ${before}..${after} -- './documentation' #echo ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['before'])" #cat ${GITHUB_EVENT_PATH} | python3 -c "import sys, json; print(json.load(sys.stdin)['after'])" \ No newline at end of file From 3dce8ddfd30cc09d0024855012870c03c4aa60f6 Mon Sep 17 00:00:00 2001 From: Anders Larsen <anders.l.h.larsen@live.dk> Date: Wed, 4 May 2022 14:26:49 +0200 Subject: [PATCH 72/72] event test --- documentation/page 1/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/documentation/page 1/index.md b/documentation/page 1/index.md index 9fbc342..75a70a6 100644 --- a/documentation/page 1/index.md +++ b/documentation/page 1/index.md @@ -4,4 +4,3 @@ bare lige en hurtig test for at se om en page bliver bredere når man skriver en ![graph](documentation/attachments/index-1.png) -dqwdwqd \ No newline at end of file