add concat script

This commit is contained in:
Tykayn 2022-12-17 10:53:35 +01:00 committed by tykayn
parent 6162a6ef5d
commit 4167d28530
3 changed files with 36 additions and 7 deletions

6
.gitignore vendored
View File

@ -134,3 +134,9 @@ output/*
source/*.json source/*.json
sources/* sources/*
/scripts/all_tasks.org /scripts/all_tasks.org
/scripts/all.pdf
/scripts/all.tex
/scripts/all_tasks.json
/scripts/stats.org
all_tasks.org
stats.org

View File

@ -3,8 +3,12 @@ touch all_tasks.org
echo "" > all_tasks.org echo "" > all_tasks.org
cat /home/tykayn/Nextcloud/textes/orgmode/tasks.org >> all_tasks.org cat /home/tykayn/Nextcloud/textes/orgmode/tasks.org >> all_tasks.org
cat /home/tykayn/Nextcloud/textes/orgmode/tasks.org_archive >> all_tasks.org cat /home/tykayn/Nextcloud/textes/orgmode/tasks.org_archive >> all_tasks.org
cp all_tasks.org /home/tykayn/Nextcloud/textes/orgmode/stats
echo " décomptes: "
touch stats.org
date >> stats.org
echo " décomptes: " >> stats.org
todos=`grep -o '* TODO' all_tasks.org | wc -l` todos=`grep -o '* TODO' all_tasks.org | wc -l`
echo " TODO : $todos" echo " TODO : $todos"
@ -14,7 +18,7 @@ someday=$counter
counter=`grep -o '* WAITING' all_tasks.org | wc -l` counter=`grep -o '* WAITING' all_tasks.org | wc -l`
echo " WAITING : $counter" echo " WAITING : $counter"
echo " "
counter=`grep -o '* CANCELLED' all_tasks.org | wc -l` counter=`grep -o '* CANCELLED' all_tasks.org | wc -l`
cancelled_tasks=$counter cancelled_tasks=$counter
echo " CANCELLED : $counter" echo " CANCELLED : $counter"
@ -23,17 +27,17 @@ counter=`grep -o '* DONE' all_tasks.org | wc -l`
done=$counter done=$counter
echo " DONE : $counter" echo " DONE : $counter"
counter=`grep -o '* CREATED' all_tasks.org | wc -l`
echo " CREATED : $counter"
prevus=$((todos + someday)) prevus=$((todos + someday))
finis=$((cancelled_tasks + done)) finis=$((cancelled_tasks + done))
tout=$((prevus + finis)) tout=$((prevus + finis))
echo " "
echo " prévus : $prevus" echo " prévus : $prevus"
echo " finis : $finis" echo " finis : $finis"
counter=`grep -o '* CREATED' all_tasks.org | wc -l`
echo " CREATED : $counter"
echo " en tout : $tout" echo " en tout : $tout"
counter=`ls -l /home/tykayn/Nextcloud/textes/orgmode/org-roam/*.org | wc -l` counter=`ls -l /home/tykayn/Nextcloud/textes/orgmode/org-roam/*.org | wc -l`
echo " Roam files : $counter" echo " Roam files : $counter"
emacsclient -e '(progn (switch-to-buffer "all_tasks.org") (org-beamer-export-to-pdf))' #pandoc -i all_tasks.org -o all_tasks.json

19
scripts/converter.js Normal file
View File

@ -0,0 +1,19 @@
/**
* convert org file to json
* @type {string}
*/
var Org = require("org");
var orgCode = "* some org notation text";
var orgParser = new Org.Parser();
var orgDocument = orgParser.parse(orgCode);
var orgHTMLDocument = orgDocument.convert(Org.ConverterHTML, {
headerOffset: 1,
exportFromLineNumber: false,
suppressSubScriptHandling: false,
suppressAutoLink: false
});
console.dir(orgHTMLDocument); // => { title, contentHTML, tocHTML, toc }
console.log(orgHTMLDocument.toString()) // => Rendered HTML