Skip to content
Permalink
Browse files

Ensure no node documentation URL is generated when the prefix is empty

  • Loading branch information...
pmoura committed Apr 15, 2019
1 parent 069575f commit 23ea328707260a319dbb5852b7cb3c70f9d7d249
@@ -9,8 +9,8 @@
Predicates for generating graph files in the DOT language (version 2.36.0 or later).

| **Author:** Paulo Moura
| **Version:** 2.16
| **Date:** 2019/4/12
| **Version:** 2.17
| **Date:** 2019/4/15

| **Compilation flags:**
| ``static, context_switching_calls``
@@ -9,8 +9,8 @@
Predicates for generating entity diagrams in the specified format with both inheritance and cross-referencing relation edges.

| **Author:** Paulo Moura
| **Version:** 2.23
| **Date:** 2019/4/14
| **Version:** 2.24
| **Date:** 2019/4/15

| **Compilation flags:**
| ``static, context_switching_calls``
@@ -17,4 +17,4 @@ Indices and tables
* :ref:`genindex`
* :ref:`search`

Generated on Sun Apr 14 22:31:00 WEST 2019
Generated on Mon Apr 15 10:22:35 WEST 2019
@@ -9,8 +9,8 @@
Common predicates for generating library diagrams.

| **Author:** Paulo Moura
| **Version:** 2.6
| **Date:** 2019/4/14
| **Version:** 2.7
| **Date:** 2019/4/15

| **Compilation flags:**
| ``static``
@@ -9,8 +9,8 @@
Predicates for generating entity diagrams with only uses and use_module relation edges.

| **Author:** Paulo Moura
| **Version:** 2.9
| **Date:** 2019/4/14
| **Version:** 2.11
| **Date:** 2019/4/15

| **Compilation flags:**
| ``static, context_switching_calls``
@@ -9,8 +9,8 @@
Predicates for generating predicate call cross-referencing diagrams.

| **Author:** Paulo Moura
| **Version:** 2.33
| **Date:** 2019/4/14
| **Version:** 2.34
| **Date:** 2019/4/15

| **Compilation flags:**
| ``static, context_switching_calls``
@@ -243,8 +243,8 @@ <h1><code class="docutils literal notranslate"><span class="pre">dot_graph_langu
<p>Predicates for generating graph files in the DOT language (version 2.36.0 or later).</p>
<div class="line-block">
<div class="line"><strong>Author:</strong> Paulo Moura</div>
<div class="line"><strong>Version:</strong> 2.16</div>
<div class="line"><strong>Date:</strong> 2019/4/12</div>
<div class="line"><strong>Version:</strong> 2.17</div>
<div class="line"><strong>Date:</strong> 2019/4/15</div>
</div>
<div class="line-block">
<div class="line"><strong>Compilation flags:</strong></div>
@@ -243,8 +243,8 @@ <h1><code class="docutils literal notranslate"><span class="pre">entity_diagram(
<p>Predicates for generating entity diagrams in the specified format with both inheritance and cross-referencing relation edges.</p>
<div class="line-block">
<div class="line"><strong>Author:</strong> Paulo Moura</div>
<div class="line"><strong>Version:</strong> 2.23</div>
<div class="line"><strong>Date:</strong> 2019/4/14</div>
<div class="line"><strong>Version:</strong> 2.24</div>
<div class="line"><strong>Date:</strong> 2019/4/15</div>
</div>
<div class="line-block">
<div class="line"><strong>Compilation flags:</strong></div>
@@ -2893,7 +2893,7 @@ <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Pe
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
</ul>
<p>Generated on Sun Apr 14 22:31:00 WEST 2019</p>
<p>Generated on Mon Apr 15 10:22:35 WEST 2019</p>
</div>


@@ -243,8 +243,8 @@ <h1><code class="docutils literal notranslate"><span class="pre">library_diagram
<p>Common predicates for generating library diagrams.</p>
<div class="line-block">
<div class="line"><strong>Author:</strong> Paulo Moura</div>
<div class="line"><strong>Version:</strong> 2.6</div>
<div class="line"><strong>Date:</strong> 2019/4/14</div>
<div class="line"><strong>Version:</strong> 2.7</div>
<div class="line"><strong>Date:</strong> 2019/4/15</div>
</div>
<div class="line-block">
<div class="line"><strong>Compilation flags:</strong></div>

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -243,8 +243,8 @@ <h1><code class="docutils literal notranslate"><span class="pre">uses_diagram(Fo
<p>Predicates for generating entity diagrams with only uses and use_module relation edges.</p>
<div class="line-block">
<div class="line"><strong>Author:</strong> Paulo Moura</div>
<div class="line"><strong>Version:</strong> 2.9</div>
<div class="line"><strong>Date:</strong> 2019/4/14</div>
<div class="line"><strong>Version:</strong> 2.11</div>
<div class="line"><strong>Date:</strong> 2019/4/15</div>
</div>
<div class="line-block">
<div class="line"><strong>Compilation flags:</strong></div>
@@ -243,8 +243,8 @@ <h1><code class="docutils literal notranslate"><span class="pre">xref_diagram(Fo
<p>Predicates for generating predicate call cross-referencing diagrams.</p>
<div class="line-block">
<div class="line"><strong>Author:</strong> Paulo Moura</div>
<div class="line"><strong>Version:</strong> 2.33</div>
<div class="line"><strong>Date:</strong> 2019/4/14</div>
<div class="line"><strong>Version:</strong> 2.34</div>
<div class="line"><strong>Date:</strong> 2019/4/15</div>
</div>
<div class="line-block">
<div class="line"><strong>Compilation flags:</strong></div>
@@ -22,9 +22,9 @@
implements(graph_language_protocol)).

:- info([
version is 2.16,
version is 2.17,
author is 'Paulo Moura',
date is 2019/04/12,
date is 2019/04/15,
comment is 'Predicates for generating graph files in the DOT language (version 2.36.0 or later).'
]).

@@ -149,7 +149,7 @@
write(Stream, Identifier),
write(Stream, '" ['),
write_key_value_comma(Stream, shape, Shape),
( member(url(URL), Options),
( memberchk(url(URL), Options),
URL \== '' ->
write_key_value_comma(Stream, 'URL', URL),
write_key_value_comma(Stream, tooltip, URL)
@@ -169,7 +169,7 @@
write(Stream, '<TR><TD> </TD><TD><FONT POINT-SIZE="11">'),
write_escaped_term(Stream, Label),
write(Stream, '</FONT></TD><TD> </TD></TR>'),
( member(node_type_captions(true), Options),
( memberchk(node_type_captions(true), Options),
Caption \== '' ->
write(Stream, '<TR><TD> </TD><TD><FONT POINT-SIZE="7">'),
write_escaped_term(Stream, Caption),
@@ -224,7 +224,7 @@
write(Stream, End),
write(Stream, '" ['),
write_key_value_comma(Stream, arrowhead, ArrowHead),
( member(url(URL), Options),
( memberchk(url(URL), Options),
URL \== '' ->
write_key_value_comma(Stream, 'URL', URL),
write_key_value_comma(Stream, labeltooltip, URL)
@@ -22,9 +22,9 @@
imports(diagram(Format))).

:- info([
version is 2.23,
version is 2.24,
author is 'Paulo Moura',
date is 2019/04/14,
date is 2019/04/15,
comment is 'Predicates for generating entity diagrams in the specified format with both inheritance and cross-referencing relation edges.',
parnames is ['Format'],
see_also is [inheritance_diagram(_), uses_diagram(_), xref_diagram(_)]
@@ -195,27 +195,27 @@
process(_, _, _).

add_entity_documentation_url(Kind, Entity, Options, EntityOptions) :-
( member(urls(_, DocPrefix), Options),
DocPrefix \== '' ->
memberchk(urls(_, DocPrefix), Options),
( DocPrefix \== '' ->
entity_to_html_name(Kind, Entity, Name),
atom_concat(DocPrefix, Name, DocURL0),
memberchk(entity_url_suffix_target(Suffix, _), Options),
atom_concat(DocURL0, Suffix, DocURL),
EntityOptions = [url(DocURL)| Options]
; EntityOptions = Options
; EntityOptions = [url('')| Options]
).

add_external_entity_documentation_url(module, Entity, Options, EntityOptions) :-
( modules_diagram_support::module_property(Entity, file(Path)),
member(path_url_prefixes(Prefix, _, DocPrefix), Options),
modules_diagram_support::module_property(Entity, file(Path)),
( member(path_url_prefixes(Prefix, _, DocPrefix), Options),
DocPrefix \== '',
atom_concat(Prefix, _, Path) ->
entity_to_html_name(module, Entity, Name),
atom_concat(DocPrefix, Name, DocURL0),
memberchk(entity_url_suffix_target(Suffix, _), Options),
atom_concat(DocURL0, Suffix, DocURL),
EntityOptions = [url(DocURL)| Options]
; EntityOptions = Options
; EntityOptions = [url('')| Options]
).
add_external_entity_documentation_url(logtalk, Entity, Options, EntityOptions) :-
( current_object(Entity) ->
@@ -235,7 +235,7 @@
memberchk(entity_url_suffix_target(Suffix, _), Options),
atom_concat(DocURL0, Suffix, DocURL),
EntityOptions = [url(DocURL)| Options]
; EntityOptions = Options
; EntityOptions = [url('')| Options]
).

entity_to_html_name(module, Entity, Entity).
@@ -3,9 +3,9 @@
extends(diagram(Format))).

:- info([
version is 2.6,
version is 2.7,
author is 'Paulo Moura',
date is 2019/04/14,
date is 2019/04/15,
comment is 'Common predicates for generating library diagrams.',
parnames is ['Format']
]).
@@ -101,14 +101,14 @@
Format::graph_footer(diagram_output_file, other, '(external libraries)', external, [url(''), tooltip('(external libraries)')| Options]).

add_library_documentation_url(logtalk, Options, Library, NodeOptions) :-
( member(urls(_, DocPrefix), Options),
( memberchk(urls(_, DocPrefix), Options),
DocPrefix \== '' ->
memberchk(entity_url_suffix_target(Suffix, Target), Options),
atom_concat(DocPrefix, Suffix, URL0),
atom_concat(URL0, Target, URL1),
atom_concat(URL1, Library, URL),
NodeOptions = [url(URL)| Options]
; NodeOptions = Options
; NodeOptions = [url('')| Options]
).
% tbd
add_library_documentation_url(prolog, NodeOptions, _, NodeOptions).
@@ -22,9 +22,9 @@
extends(entity_diagram(Format))).

:- info([
version is 2.33,
version is 2.34,
author is 'Paulo Moura',
date is 2019/04/14,
date is 2019/04/15,
comment is 'Predicates for generating predicate call cross-referencing diagrams.',
parnames is ['Format'],
see_also is [entity_diagram(_), inheritance_diagram(_), uses_diagram(_)]
@@ -317,7 +317,7 @@
),
XRefOptions = [url(DocURL)| Options]
; % could not find entity file or URL prefixes not defined
XRefOptions = Options
XRefOptions = [url('')| Options]
).

add_predicate_code_url(Options, Entity, Properties, PredicateOptions) :-

0 comments on commit 23ea328

Please sign in to comment.
You can’t perform that action at this time.