Skip to content

Commit

Permalink
Implemented feature request #156 External content assistant (updated and
Browse files Browse the repository at this point in the history
regenerated built-in help)
  • Loading branch information
jploski committed Jul 29, 2023
1 parent 462ea22 commit 9178931
Show file tree
Hide file tree
Showing 63 changed files with 1,042 additions and 1,757 deletions.
2 changes: 1 addition & 1 deletion org.epic.doc/guide/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# When specifying multiple paths, use your platform-specific path separator.
#
xmlcatalog.path = /usr/share/xml/docbook/schema/dtd/4.2/catalog.xml:/usr/local/docbook-xsl-ns-1.73.0/catalog.xml:/home/jpl/git/epic-ide/org.epic.doc/guide/xhtml-catalog.xml
xmlcatalog.path = /usr/share/xml/docbook/schema/dtd/4.2/catalog.xml:/data/mnt/data/usr/local/docbook-xsl-ns-1.73.0/catalog.xml:/home/jpl/git/epic-ide/org.epic.doc/guide/xhtml-catalog.xml:/usr/share/xml/docbook/schema/dtd/catalog.xml

# You can also use an empty xmlcatalog.path if you have no DocBook installation
# on your machine... This is *very* slow, though, and sometimes even not reliable
Expand Down
4 changes: 3 additions & 1 deletion org.epic.doc/guide/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ See build.properties for more information.
description="All output formats"/>

<target name="build-pdf" depends="check-env" description="Single PDF file">
<exec executable="dblatex">
<exec executable="/usr/bin/python2.7">
<arg value="/usr/bin/dblatex" />
<arg value="-b" />
<arg value="pdftex" />
<arg value="--texstyle=guide.sty" />
Expand Down Expand Up @@ -144,6 +145,7 @@ See build.properties for more information.
<srcfile/>
<fileset dir="temp" includes="*.html"/>
</apply>
<echo>Note: exit code 1 from tidy invocations above indicates warnings and can be ignored. Exit code 2 indicates errors.</echo>
<mkdir dir="../html/guide"/>
<copy todir="../html/guide">
<fileset dir="temp" includes="**"/>
Expand Down
2 changes: 1 addition & 1 deletion org.epic.doc/guide/eclipse.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:d="http://docbook.org/ns/docbook"
version="1.0">

<xsl:import href="http://docbook.sourceforge.net/release/xsl/1.73.0/html/chunk.xsl"/>
<xsl:import href="/data/mnt/data/usr/local/docbook-xsl-ns-1.73.0/html/chunk.xsl"/>

<!-- ********************************************************************
$Id$
Expand Down
46 changes: 42 additions & 4 deletions org.epic.doc/guide/guide.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,18 @@
when the characters <userinput>$ @ %</userinput> are typed. To switch
this feature off, deselect the <guilabel>Inspect Variables</guilabel>
check box.</para>

<para>The <guilabel>External content assistant</guilabel> field allows
advanced users to specify a custom Perl script to be used to generate
autocompletion suggestions, for example to integrate project-specific
suggestions or AI language models
(see <xref linkend="external-content-assistant" />)).</para>

<screenshot>
<mediaobject>
<imageobject>
<imagedata align="center" fileref="images/preferences_5.gif"
format="GIF" />
<imagedata align="center" fileref="images/preferences_5.png"
format="PNG" />
</imageobject>

<textobject>
Expand Down Expand Up @@ -1261,8 +1267,10 @@
editing.</para>

<note>
<para>The features currently implemented in EPIC may not be fully
functional but will be improved in the future.</para>
<para>The features currently implemented in EPIC are rudimentary.
An option to utilize a user-defined script for code assist suggestions
is provided to allow integration of more powerful, external code
generation tools.</para>
</note>

<section>
Expand Down Expand Up @@ -1321,6 +1329,36 @@ $smtp-&gt;[no content assist]</programlisting>
$smtp-&gt;[content assist]</programlisting>
</note>
</section>

<section id="external-content-assistant">
<title>External Content Assistant</title>

<para>If specified on the <guilabel>Code Assist</guilabel> preferences page,
a user-defined Perl script can compute autocompletion suggestions instead of
or in addition to EPIC's built-in ones. It is called by EPIC with the following
arguments:
<itemizedlist>
<listitem>documentPath = workspace-relative path of the edited source file (if available),</listitem>
<listitem>documentOffset = selection start offset in the document/file (or caret position if there is no selection),</listitem>
<listitem>selectionLength = length of selection (0 if there is no selection),</listitem>
</itemizedlist>
and the entire source document is passed in as standard input.</para>

<para>Based on the provided information the script is supposed to generate
on standard output a list of autocomplete suggestions or &quot;proposals&quot; which,
if not empty, take precedence over EPIC's built-in generation. Each suggestion
contains instructions to insert/replace a contiguous piece of text at a given
position in the source document and move the caret to a new position. A suggestion
is formatted as a comma-separated list of &quot;replacementOffset,replacementLength,newCursorPosition,replacementString&quot;:
<itemizedlist>
<listitem>replacementOffset = where to insert the proposal in the file (typically = documentOffset),</listitem>
<listitem>replacementLength = how many characters to remove at this offset (typically 0, i.e. just insert),</listitem>
<listitem>newCursorPosition = where to place caret after the insertion, relative to replacementOffset (typically = replacementString.length()),</listitem>
<listitem>replacementString = what to insert at replacementOffset</listitem>
</itemizedlist></para>
<para>Suggestions are separated from each other by the special <userinput>&lt;|proposal|&gt;</userinput> token.</para>
<para>Refer to the source code of org.epic.perleditor.editors.util.ExternalAutoComplete for further implementation details.</para>
</section>
</section>

<section id="todo-markers">
Expand Down
Binary file removed org.epic.doc/guide/images/preferences_5.gif
Binary file not shown.
Binary file added org.epic.doc/guide/images/preferences_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion org.epic.doc/guide/xhtml-multi.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:import href="http://docbook.sourceforge.net/release/xsl/1.73.0/xhtml/chunk.xsl"/>
<xsl:import href="/data/mnt/data/usr/local/docbook-xsl-ns-1.73.0/html/chunk.xsl"/>

<xsl:template match="/">
<!-- Call original code from the imported stylesheet -->
Expand Down
12 changes: 11 additions & 1 deletion org.epic.doc/guide/xhtml-web-post.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
version="1.0">
-

<xsl:template match='*|@*' priority="1">
<xsl:copy>
<xsl:apply-templates select='node()|@*'/>
</xsl:copy>
</xsl:template>

<xsl:template match="xhtml:html" priority="100">
<xsl:text disable-output-escaping="yes">&lt;?php header('Content-Type: text/html; charset=UTF-8'); ?&gt;</xsl:text>
<xsl:copy><xsl:apply-templates select='node()|@*'/></xsl:copy>
</xsl:template>

<xsl:template match="xhtml:head" priority="100">
<xsl:text disable-output-escaping="yes">&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;</xsl:text>
<xsl:copy><xsl:apply-templates select='node()|@*'/></xsl:copy>
</xsl:template>

<xsl:template match="xhtml:base" priority="100">
<xsl:text disable-output-escaping="yes">
&lt;?php
Expand Down
2 changes: 1 addition & 1 deletion org.epic.doc/guide/xhtml-web.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<xsl:apply-imports/>
</xsl:template>

<xsl:param name="html.base">http://www.epic-ide.org/guide/</xsl:param>
<xsl:param name="html.base">https://www.epic-ide.org/guide/</xsl:param>
<xsl:param name="html.ext">.php</xsl:param>
<xsl:param name="html.stylesheet">../css/style.css</xsl:param>
<xsl:param name="chunk.quietly" select="1"/>
Expand Down
37 changes: 13 additions & 24 deletions org.epic.doc/html/guide/ch01.html
Original file line number Diff line number Diff line change
@@ -1,49 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />

<meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.6.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Plug-in Installation</title>
<link href="book.css" rel="stylesheet" type="text/css" />
<meta content="DocBook XSL-NS Stylesheets V1.73.0" name="generator" />
<link rel="start" href="index.html" title="EPIC - User's Guide" />
<link rel="up" href="index.html" title="EPIC - User's Guide" />
<link rel="prev" href="index.html" title="EPIC - User's Guide" />
<link rel="next" href="ch01s01.html" title="Prerequisites" />
<link href="book.css" rel="stylesheet" type="text/css">
<meta content="DocBook XSL-NS Stylesheets V1.73.0" name="generator">
<link rel="start" href="index.html" title="EPIC - User's Guide">
<link rel="up" href="index.html" title="EPIC - User's Guide">
<link rel="prev" href="index.html" title="EPIC - User's Guide">
<link rel="next" href="ch01s01.html" title="Prerequisites">
</head>

<body>
<div class="chapter" lang="en" xml:lang="en">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="chapter" lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title"><a id="installation" name="installation"></a>Plug-in Installation</h2>
<h2 class="title"><a name="installation" id="installation"></a>Plug-in Installation</h2>
</div>
</div>
</div>

<div class="toc">
<p><b>Table of Contents</b></p>

<dl>
<dt><span class="section"><a href="ch01s01.html">Prerequisites</a></span></dt>

<dd>
<dl>
<dt><span class="section"><a href="ch01s01.html#N1000F">Eclipse</a></span></dt>

<dt><span class="section"><a href="ch01s01.html#N10025">Perl</a></span></dt>

<dt><span class="section"><a href="ch01s01.html#N10034">Considerations when using
Cygwin</a></span></dt>
</dl>
</dd>

<dt><span class="section"><a href="ch01s02.html">Installing EPIC</a></span></dt>

<dt><span class="section"><a href="ch01s03.html">Uninstalling EPIC</a></span></dt>
</dl>
</div>
Expand Down
53 changes: 19 additions & 34 deletions org.epic.doc/html/guide/ch01s01.html
Original file line number Diff line number Diff line change
@@ -1,89 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />

<meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.6.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Prerequisites</title>
<link href="book.css" rel="stylesheet" type="text/css" />
<meta content="DocBook XSL-NS Stylesheets V1.73.0" name="generator" />
<link rel="start" href="index.html" title="EPIC - User's Guide" />
<link rel="up" href="ch01.html" title="Plug-in Installation" />
<link rel="prev" href="ch01.html" title="Plug-in Installation" />
<link rel="next" href="ch01s02.html" title="Installing EPIC" />
<link href="book.css" rel="stylesheet" type="text/css">
<meta content="DocBook XSL-NS Stylesheets V1.73.0" name="generator">
<link rel="start" href="index.html" title="EPIC - User's Guide">
<link rel="up" href="ch01.html" title="Plug-in Installation">
<link rel="prev" href="ch01.html" title="Plug-in Installation">
<link rel="next" href="ch01s02.html" title="Installing EPIC">
</head>

<body>
<div class="section" lang="en" xml:lang="en">
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="prerequisites" name=
<h2 class="title" style="clear: both"><a name="prerequisites" id=
"prerequisites"></a>Prerequisites</h2>
</div>
</div>
</div>

<div class="section" lang="en" xml:lang="en">
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="N1000F" name="N1000F"></a>Eclipse</h3>
<h3 class="title"><a name="N1000F" id="N1000F"></a>Eclipse</h3>
</div>
</div>
</div>

<p>Before installing the EPIC plug-in, a recent version of Eclipse has to be installed. The
minimum requirement is version 3.1 of Eclipse for EPIC 'stable' and version 3.2 of Eclipse
for EPIC 'testing'.</p>

<p>Eclipse comes in two flavors. The <span class="emphasis"><em>SDK</em></span> version
contains Java IDE components and is much larger than the <span class=
"emphasis"><em>Platform</em></span> version. If you only want to use Eclipse as a Perl IDE,
the Platform version is sufficient. If you are in for Perl and Java coding, use the SDK
version.</p>

<p><span class="emphasis"><em>Eclipse does not include a Java Runtime Environment (JRE). You
will need a 1.4.1 level or higher Java Runtime or Java Development Kit (JDK) installed on
your machine in order to run Eclipse.</em></span></p>

<p>Eclipse can be downloaded from <a class="ulink" href="http://www.eclipse.org" target=
"_top">www.eclipse.org</a>.</p>
</div>

<div class="section" lang="en" xml:lang="en">
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="N10025" name="N10025"></a>Perl</h3>
<h3 class="title"><a name="N10025" id="N10025"></a>Perl</h3>
</div>
</div>
</div>

<p>In order to have all EPIC features like Syntax Checking, Source Formatting etc., a Perl
interpreter is needed. In principle any Perl interpreter can be used. To use debugging within
Eclipse, Perl version 5.8.x or 5.6.x is required. For further requirements concerning the
debugger, see <a class="xref" href="ch02s09.html" title="Setting Up the Debugger">the section
called “Setting Up the Debugger”</a>.</p>

<p>Most *nix/Linux installations will provide Perl interpreters out of the box.</p>

<p>Perl for Windows can be downloaded from <a class="ulink" href="http://www.activestate.com"
target="_top">www.activestate.com</a></p>
</div>

<div class="section" lang="en" xml:lang="en">
<div class="section" lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="N10034" name="N10034"></a>Considerations when using
<h3 class="title"><a name="N10034" id="N10034"></a>Considerations when using
Cygwin</h3>
</div>
</div>
</div>

<p>Make sure that the mount command is available and that it is in your system path. As mount
is a standard component of Cygwin, you usually just have to add the cygwin\bin directory to
your system path.</p>
Expand Down
Loading

0 comments on commit 9178931

Please sign in to comment.