#!/bin/sh

# [Gedit Tool]
# Name=Logtalk: generate PDF documentation
# Comment=Generate PDF documentation for the current Logtalk source file
# Shortcut=
# Input=nothing
# Output=output-panel
# Applicability=titled
# Save-files=nothing
# Languages=Logtalk

cd "$GEDIT_CURRENT_DOCUMENT_DIR"
FILE=`basename "$GEDIT_CURRENT_DOCUMENT_NAME" .lgt`
yaplgt -g "logtalk_compile($FILE), halt."
cd xml_docs
lgt2pdf
xdg-open *.pdf
