I have an idea about knowledge base applications.
Now, I have script kbase.sh, and I have many knowledge information/examples about os (working with files, folders, os administration, etc) in text files named like this,
java.kb
kbase.sh
letsencrypt.kb
lvm.kb
and so on.
In the file, the first line is commented (used as keywords), after this is an example of commands, ended with a blank line and then start next comment (next kbase information). Example of kbase (bash.kb) file here,
## bash, folders, gzip multiple folders to multiple files
for dir in *; do base=$(basename "$dir"); tar zcvf "${base}.tar.gz" "$dir"; done
## bash, files, rename multiple files
for f in *.jpg; do mv "$f" "$(echo "$f" | sed s/IMG/VACATION/)"; done
## bash, if, check if folder is mounted
if mount | grep /home/hosek/test > /dev/null; then
echo "yay"
else
echo "nay"
fi
and so on.
Now it is working with combination of autocomplete and bash commands, for example if I wanna know how to rename multiple files, just do this in terminal.
kba<TAB> <TAB><TAB> (cat all *.kb files and grep all commented lines)
kbase.sh bash<TAB><TAB> (cat all *.kb files and grep all commented lines with '## bash,')
kbase.sh bash fil<TAB><TAB> (cat all *.kb files and grep all commented lines with '## bash, file,' or '## bash, files,')
kbase.sh bash files ren<TAB><TAB> (cat all *.kb files and grep all commented lines with '## bash, files,' && 'ren')
kbase.sh bash files ren<ENTER> (cat all *.kb files and grep all commented lines with '## bash, files,' && 'ren', and write all lines started '##' until '##')
It shows me all lines from first comment '## bash, files, rename ...' to next found comment/line with '##'.
For example, this command
kbase.sh bash files ren<ENTER>
shows me all matches (grep, from ## to ##), so it display this
## bash, files, rename multiple files
for f in *.jpg; do mv "$f" "$(echo "$f" | sed s/IMG/VACATION/)"; done
So this is quite nice for fast searching. But it is not very practical, when I am in terminal and I have to go to another terminal, and do kbase.sh blablabla etc.
Could be very nice if exist some similar application, but for X (especially XFCE), where could I search and edit very similar way, for example window with search input and whisperer (for example same mechanism with cat and grep), and then show me results (in same way as kbase.sh script).
Is there any very simple application like this? Or is there a better way to work with knowledge base (chronic googling is not very practical)?
If not, I wanna make an application for this. Where can I start? C++?
Or best solution is do this as webpage in php and ajax?
Thank you very much for your time and ideas.