Wiki made with Yad possible?

121 views
Skip to first unread message

dave

unread,
Mar 6, 2020, 12:30:24 PM3/6/20
to yad-common
I think I've read somewhere that you can use markdown with the Yad.

I was wondering if it's technically possible to get the Yad to render a word surrounded by double square brackets as a link which you could program to look for another text file by that name

Thanks
- Dave

dave

unread,
Aug 28, 2020, 12:43:53 AM8/28/20
to yad-common
I'm trying to  make this myself, but I'm having a problem getting a file with pango markup to display

I'm converting [[links like this]] in a text file sent to this script to a pango format in another file like this:


FILE="$@"
f="$(basename -- $FILE)"
export KEY=$RANDOM

cat $FILE | sed 's/\[\[/<span foreground="blue" size="100">/g' | sed 's/\]\]/<\/span>/' > /tmp/newfile

yad --plug=$KEY --tabnum=1 --text-info --show-uri --back="#456787" --fore=white --always-print-result --center --wrap --name="NewNote" --window-icon="text-editor" --title="$f" --button="gtk-save:0" --button="gtk-open:2" --button="gtk-close:1" --editable --filename=$FILE > /tmp/testnotes.txt &> res1 &
yad --plug=$KEY --tabnum=2 --text-info --formatted --wrap --filename=/tmp/newfile &> res2 &
yad --paned --orient=hor --key=$KEY --tab="Tab 1" --tab="Tab 2" --width=1200 --height=500 --splitter=600 --center

The above displays the original file accurately, but nothing displays in the second pane.  If I delete the word "--formatted" in the second tab the filecontent displays as plain text without the formatting.

What am I doing wrong?


Thanks,
- Dave
Message has been deleted

dave

unread,
Aug 29, 2020, 11:19:40 PM8/29/20
to yad-common
Figured it out - this worked:

FILE="$@"
[ -z "$FILE" ] && FILE="/home/david/SyncthingFolders/BibleWiki/data/PersonalStuff.txt"
f="$(basename -- $FILE)"
export KEY=$RANDOM

newfile=$(cat $FILE | sed 's/\[\[/<span foreground=\\\"blue\\\" size=\\\"large\\\">/g' | sed 's/\]\]/<\/span>/g')
echo "$newfile"
yad --plug=$KEY --tabnum=1 --text-info --show-uri --back="#456787" --fore=white --always-print-result --center --wrap --name="NewNote" --window-icon="text-editor" --title="$f" --button="gtk-save:0" --button="gtk-open:2" --button="gtk-close:1" --editable --filename=$FILE > /tmp/testnotes.txt &> res1 &
yad --plug=$KEY --tabnum=2 --text="$newfile" --formatted --back="#A9A9A9" --wrap &> res2 &
yad --paned --orient=hor --key=$KEY --tab="Tab 1" --tab="Tab 2" --width=1200 --height=500 --splitter=600 --center


there was a problem with my sed, and I guess you can't do pango in a text-info dialog

Ananas

unread,
Aug 30, 2020, 12:29:16 PM8/30/20
to yad-c...@googlegroups.com


вс, 30 авг. 2020 г. в 06:18, dave <cedard...@gmail.com>:

there was a problem with my sed, and I guess you can't to pango in a text-info dialog


no, you are wrong. you can pango in text-info dialog with recent yad and --formatted option
--
wbr,

Victor "Ananas" Ananjevsky

dave

unread,
Sep 1, 2020, 2:29:25 PM9/1/20
to yad-common
What version is required?  I'm pretty sure this install is up to date as of the last 2 months (see screenshot)

the new Google Groups doesn't seem to have an ability to attach files :(
so this should work:




Ananas

unread,
Sep 4, 2020, 10:00:30 AM9/4/20
to yad-c...@googlegroups.com
--formatted option was added in yad 1.0

вт, 1 сент. 2020 г. в 21:29, dave <cedard...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "yad-common" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/yad-common/5188b965-f814-4e95-89d9-81e2174d1c78n%40googlegroups.com.

dave

unread,
Sep 5, 2020, 3:26:16 PM9/5/20
to yad-common
Wow, I can't believe I have such a wide difference in versions.  I have version 6 on my home computer and .4 on my work computer - yikes!

Anyway, thanks for your patience. (yes, it works on my up-to-date computer)
Reply all
Reply to author
Forward
0 new messages