Benjamin-Loison / xournalpp

Xournal++ is a handwriting notetaking software with PDF annotation support. Written in C++ with GTK3, supporting Linux (e.g. Ubuntu, Debian, Arch, SUSE), macOS and Windows 10. Supports pen input from devices such as Wacom Tablets.
https://xournalpp.github.io
GNU General Public License v2.0
0 stars 0 forks source link

Smooth git support #25

Open Benjamin-Loison opened 9 months ago

Benjamin-Loison commented 9 months ago

Is Your Feature Request Related to a Problem?

No response

Feature Description

Testing with Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones.

Now the question is: is it easy to have a working .xopp from these pieces of information, especially the generation of LaTeX images from their formulas, as I already tested the other aspects (PDF retrievability and general annotations). It does not seem that $\LaTeX$ images are regenerated from formulas, but the formulas are not removed, so it is a temporary not destroying acceptable situation.

Should solve #2.

Related to xournalpp/issues/3412.

New .xopp should not have a linear complexity in the PDF. Currently it is the case by mentioning each empty page.

Related to Benjamin_Loison/git/issues/17.

Alternative Solutions

No response

Additional Context

No response

Benjamin-Loison commented 9 months ago
xmlxopp() {
    CONTENT=`gunzip -c "$1"`
    ABSOLUTE_FILE_PATH=`echo $CONTENT | xmlstarlet select -t --value-of '/xournal/page/background/@filename'`
    RELATIVE_FILE_PATH=`basename "$ABSOLUTE_FILE_PATH"`
    echo $CONTENT | xmlstarlet format | xmlstarlet edit --delete '/xournal/preview' | xmlstarlet edit --update '//teximage' --value '' | xmlstarlet edit --update '/xournal/page/background/@filename' --value "$RELATIVE_FILE_PATH" > "$1.xml"
}

works for v1.2.3 but not APT v1.1.3.

Benjamin-Loison commented 9 months ago
find -name '*.xopp.xml' -exec sh -c 'echo "{}" | sed "s/\.xml$//g" | xargs -I % sh -c "gzip -c \"%.xml\" > \"%\" "' \;
Benjamin-Loison commented 9 months ago

Until this issue is treated and especially the restoration from git aspect is treated, I cannot much work easily from another computer. This quite blocks VirtualBox virtual machine test of recent version, as described in #16.

Benjamin-Loison commented 8 months ago
find -name '[!.]*.xopp' -exec sh -c 'echo "{}" | sed "s/\.xopp$//g" | xargs -I % sh -c "if [ ! -f \"%_annotated.pdf\" ] || [ \"%.xopp\" -nt \"%_annotated.pdf\" ]; then xournalpp \"%.xopp\" --create-pdf=\"%_annotated.pdf\"; fi"' \;
Benjamin-Loison commented 8 months ago
export -f xmlxopp && find -name '[!.]*.xopp' -exec bash -c 'xmlxopp "{}"' \;
Benjamin-Loison commented 2 months ago

Could just save and load annotation history since first annotation despite restarts.