diff --git a/clean.sh b/clean.sh index a80ea4e..78b4a14 100644 --- a/clean.sh +++ b/clean.sh @@ -1,2 +1,2 @@ rm -r www/js -# +rm main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..ad3914c --- /dev/null +++ b/main.py @@ -0,0 +1,25 @@ +''' +update automatically to a the change log for every build +''' + +P="www/js/components/tabs/changeLog.js" +with open(P,'r',encoding='utf-8') as fhand: + content = fhand.read() + +version = input("Enter version name:") +line = [] +print("What's new: ") +while True: + info=input() + if not info: + break + line.append('\u2705'+info) +INFO = '' +for l in line: + INFO += l+"\n" +MSG = f",{{version:'{version}',info: `{INFO}`}}" +pos = content.find("}\n]")+1 +newUpdate = content[:(pos)] + MSG + content[(pos):] + +with open(P,'w',encoding='utf-8') as fl: + fl.write(newUpdate) diff --git a/routines.sh b/routines.sh index 82999b4..023cee2 100644 --- a/routines.sh +++ b/routines.sh @@ -1,3 +1,4 @@ +python main.py git add . git commit -m " Added file path to recently opened files incase both of the file have the same names. diff --git a/sample.txt b/sample.txt new file mode 100644 index 0000000..94d49c8 --- /dev/null +++ b/sample.txt @@ -0,0 +1,37 @@ +,{version:'v5.0.1 (lts)',info: 'just trying to do some clean up +'}let log = [{ + version: 'v5.0.0 (latest)', + info: `Added tab for recently edited files + implemented saving of setting + ` +}, { + version: 'v 4.0.7', + info: `Added new paste in textarea, + support for new language, + Added about section` +} + ] + +export default function changeLogTab(_par) { + let parentElm = document.querySelector(_par); + let listGroup = makeElm('div') + insertAttr(['class=container'], listGroup) + let listElm = makeElm('ul') + insertAttr(['class=list-group'], listElm) + parentElm.appendChild(listElm) + let version, listItem,title,inform; + for (let i = 0; i < log.length; i++) + { + version = makeElm('li'); + title = makeElm('h2') + version.appendChild(title) + title.innerText = log[i].version + inform = makeElm('p') + inform.innerText=log[i].info + insertAttr(['class=list-group-item'],version) + version.appendChild(inform) + listElm.appendChild(version) + parentElm.appendChild(version); + } + +} \ No newline at end of file diff --git a/www/js/components/tabs/changeLog.js b/www/js/components/tabs/changeLog.js index ca54a49..7480931 100644 --- a/www/js/components/tabs/changeLog.js +++ b/www/js/components/tabs/changeLog.js @@ -1,15 +1,17 @@ let log = [{ - version: 'v5.0.0 (latest)', - info: `Added tab for recently edited files - implemented saving of setting - ` -}, { version: 'v 4.0.7', info: `Added new paste in textarea, support for new language, Added about section` -} - ] +}, { + version: 'v5.0.0', + info: `Added tab for recently edited files + implemented saving of setting + ` +},{version:'v5.0.1',info: `✅UI cleanUp +✅Added Comments +`} +] export default function changeLogTab(_par) { let parentElm = document.querySelector(_par); @@ -18,19 +20,19 @@ export default function changeLogTab(_par) { let listElm = makeElm('ul') insertAttr(['class=list-group'], listElm) parentElm.appendChild(listElm) - let version, listItem,title,inform; - for (let i = 0; i < log.length; i++) + let version, listItem, title, inform; + for (let i = log.length - 1; i >= 0; i--) { version = makeElm('li'); title = makeElm('h2') version.appendChild(title) title.innerText = log[i].version inform = makeElm('p') - inform.innerText=log[i].info - insertAttr(['class=list-group-item'],version) + inform.innerText = log[i].info + insertAttr(['class=list-group-item'], version) version.appendChild(inform) listElm.appendChild(version) parentElm.appendChild(version); } - + } \ No newline at end of file