#!/bin/sh

# [Gedit Tool]
# Name=Logtalk: generate (X)HTML documentation
# Comment=Generate (X)HTML 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
lgt2html
xdg-open index.html
