Replace links in documentation pages.

This commit is contained in:
kovacsv 2023-01-14 22:30:38 +01:00
parent 1950e3619e
commit 5477c3d72a
10 changed files with 26 additions and 23 deletions

View File

@ -65,7 +65,7 @@
<h2>Basic Guidelines</h2> <h2>Basic Guidelines</h2>
<p>Before you start, learn how to <a href="EnvironmentSetupPage.html">Set Up the Environment</a>. Pull requests must target the <code class="inline">dev</code> branch. Please create a separate pull request for every feature or bug fix.</p> <p>Before you start, read the <a href="Page_EnvironmentSetup.html" target="_self">Environment Setup</a> page. Pull requests must target the <code class="inline">dev</code> branch. Please create a separate pull request for every feature or bug fix.</p>
<h2>Bug Fixing Guidelines</h2> <h2>Bug Fixing Guidelines</h2>

View File

@ -77,7 +77,7 @@
<h2>Download as browser-ready bundle</h2> <h2>Download as browser-ready bundle</h2>
<p>A bundle is available for every release. You need to download the zip file attached to the <a href="https://github.com/kovacsv/Online3DViewer/releases">latest release</a>. After that, copy the content of the zip file on your server, and include the main file on your site.</p> <p>A bundle is available for every release. You need to download the zip file attached to the <a href="https://github.com/kovacsv/Online3DViewer/releases" target="_blank">latest release</a>. After that, copy the content of the zip file on your server, and include the main file on your site.</p>
<pre><code class="language-html">&lt;script type="text/javascript" src="o3dv.min.js"&gt;&lt;/script&gt;</code></pre> <pre><code class="language-html">&lt;script type="text/javascript" src="o3dv.min.js"&gt;&lt;/script&gt;</code></pre>

View File

@ -69,7 +69,7 @@ There are two ways to use the library:
<h2>External library handling</h2> <h2>External library handling</h2>
<p>Some of the importers are implemented using external libraries. These are found in the libs folder of the package. To make these libraries available, you have to tell the engine where to find them. The location of the external libraries can be set with the <a href="SetExternalLibLocation.html">SetExternalLibLocation</a> function. Make sure to call it before any other engine calls.</p> <p>Some of the importers are implemented using external libraries. These are found in the libs folder of the package. To make these libraries available, you have to tell the engine where to find them. The location of the external libraries can be set with the <a href="Function_SetExternalLibLocation.html" target="_self">SetExternalLibLocation</a> function. Make sure to call it before any other engine calls.</p>
<h2>Automatic initialization</h2> <h2>Automatic initialization</h2>
@ -91,7 +91,7 @@ There are two ways to use the library:
<li><b>environmentmapbg:</b> Boolean ("true" or "false") to set the environment map as background.</li> <li><b>environmentmapbg:</b> Boolean ("true" or "false") to set the environment map as background.</li>
</ul> </ul>
<p>After placing the elements, call the <a href="Init3DViewerElements.html">Init3DViewerElements</a> function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.</p> <p>After placing the elements, call the <a href="Function_Init3DViewerElements.html" target="_self">Init3DViewerElements</a> function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.</p>
<pre><code class="language-js">// tell the engine where to find the libs folder <pre><code class="language-js">// tell the engine where to find the libs folder
OV.SetExternalLibLocation ('libs'); OV.SetExternalLibLocation ('libs');
@ -100,7 +100,7 @@ OV.Init3DViewerElements ();</code></pre>
<h2>Initialization from code</h2> <h2>Initialization from code</h2>
<p>You can also initalize the engine from code. In this case you can provide all the parameters as a JavaScript object. See the <a href="EmbeddedViewer.html">EmbeddedViewer</a> documentation for more details.</p> <p>You can also initalize the engine from code. In this case you can provide all the parameters as a JavaScript object. See the <a href="Class_EmbeddedViewer.html" target="_self">EmbeddedViewer</a> documentation for more details.</p>
<pre><code class="language-js">window.addEventListener ('load', () => { <pre><code class="language-js">window.addEventListener ('load', () => {
// set the location of the external libraries // set the location of the external libraries

View File

@ -73,8 +73,8 @@
<p>These documents help you understanding how to use the engine in your own solution.</p> <p>These documents help you understanding how to use the engine in your own solution.</p>
<ul> <ul>
<li><a href="Page_Installation.html">Installation</a> - How to get the package?</li> <li><a href="Page_Installation.html" target="_self">Installation</a> - How to get the package?</li>
<li><a href="Page_Usage.html">Usage</a> - How to use it to embed 3D models?</li> <li><a href="Page_Usage.html" target="_self">Usage</a> - How to use it to embed 3D models?</li>
</ul> </ul>
<h2>Contribution</h2> <h2>Contribution</h2>
@ -82,8 +82,8 @@
<p>If you would like to contribute to the codebase, these documents help you to start.</p> <p>If you would like to contribute to the codebase, these documents help you to start.</p>
<ul> <ul>
<li><a href="Page_ContributionGuidelines.html">Contribution Guidelines</a> - How to contribute to the repository?</li> <li><a href="Page_ContributionGuidelines.html" target="_self">Contribution Guidelines</a> - How to contribute to the repository?</li>
<li><a href="Page_EnvironmentSetup.html">Environment Setup</a> - How to set up your environment for development?</li> <li><a href="Page_EnvironmentSetup.html" target="_self">Environment Setup</a> - How to set up your environment for development?</li>
</ul> </ul>
</div> </div>

View File

@ -4,7 +4,7 @@
<h2>Basic Guidelines</h2> <h2>Basic Guidelines</h2>
<p>Before you start, learn how to <a href="EnvironmentSetupPage.html">Set Up the Environment</a>. Pull requests must target the <code class="inline">dev</code> branch. Please create a separate pull request for every feature or bug fix.</p> <p>Before you start, read the {@link Environment Setup} page. Pull requests must target the <code class="inline">dev</code> branch. Please create a separate pull request for every feature or bug fix.</p>
<h2>Bug Fixing Guidelines</h2> <h2>Bug Fixing Guidelines</h2>

View File

@ -16,6 +16,6 @@
<h2>Download as browser-ready bundle</h2> <h2>Download as browser-ready bundle</h2>
<p>A bundle is available for every release. You need to download the zip file attached to the <a href="https://github.com/kovacsv/Online3DViewer/releases">latest release</a>. After that, copy the content of the zip file on your server, and include the main file on your site.</p> <p>A bundle is available for every release. You need to download the zip file attached to the <a href="https://github.com/kovacsv/Online3DViewer/releases" target="_blank">latest release</a>. After that, copy the content of the zip file on your server, and include the main file on your site.</p>
<pre><code class="language-html">&lt;script type="text/javascript" src="o3dv.min.js"&gt;&lt;/script&gt;</code></pre> <pre><code class="language-html">&lt;script type="text/javascript" src="o3dv.min.js"&gt;&lt;/script&gt;</code></pre>

View File

@ -8,7 +8,7 @@ There are two ways to use the library:
<h2>External library handling</h2> <h2>External library handling</h2>
<p>Some of the importers are implemented using external libraries. These are found in the libs folder of the package. To make these libraries available, you have to tell the engine where to find them. The location of the external libraries can be set with the <a href="SetExternalLibLocation.html">SetExternalLibLocation</a> function. Make sure to call it before any other engine calls.</p> <p>Some of the importers are implemented using external libraries. These are found in the libs folder of the package. To make these libraries available, you have to tell the engine where to find them. The location of the external libraries can be set with the {@link SetExternalLibLocation} function. Make sure to call it before any other engine calls.</p>
<h2>Automatic initialization</h2> <h2>Automatic initialization</h2>
@ -30,7 +30,7 @@ There are two ways to use the library:
<li><b>environmentmapbg:</b> Boolean ("true" or "false") to set the environment map as background.</li> <li><b>environmentmapbg:</b> Boolean ("true" or "false") to set the environment map as background.</li>
</ul> </ul>
<p>After placing the elements, call the <a href="Init3DViewerElements.html">Init3DViewerElements</a> function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.</p> <p>After placing the elements, call the {@link Init3DViewerElements} function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.</p>
<pre><code class="language-js">// tell the engine where to find the libs folder <pre><code class="language-js">// tell the engine where to find the libs folder
OV.SetExternalLibLocation ('libs'); OV.SetExternalLibLocation ('libs');
@ -39,7 +39,7 @@ OV.Init3DViewerElements ();</code></pre>
<h2>Initialization from code</h2> <h2>Initialization from code</h2>
<p>You can also initalize the engine from code. In this case you can provide all the parameters as a JavaScript object. See the <a href="EmbeddedViewer.html">EmbeddedViewer</a> documentation for more details.</p> <p>You can also initalize the engine from code. In this case you can provide all the parameters as a JavaScript object. See the {@link EmbeddedViewer} documentation for more details.</p>
<pre><code class="language-js">window.addEventListener ('load', () => { <pre><code class="language-js">window.addEventListener ('load', () => {
// set the location of the external libraries // set the location of the external libraries

View File

@ -12,8 +12,8 @@
<p>These documents help you understanding how to use the engine in your own solution.</p> <p>These documents help you understanding how to use the engine in your own solution.</p>
<ul> <ul>
<li><a href="Page_Installation.html">Installation</a> - How to get the package?</li> <li>{@link Installation} - How to get the package?</li>
<li><a href="Page_Usage.html">Usage</a> - How to use it to embed 3D models?</li> <li>{@link Usage} - How to use it to embed 3D models?</li>
</ul> </ul>
<h2>Contribution</h2> <h2>Contribution</h2>
@ -21,6 +21,6 @@
<p>If you would like to contribute to the codebase, these documents help you to start.</p> <p>If you would like to contribute to the codebase, these documents help you to start.</p>
<ul> <ul>
<li><a href="Page_ContributionGuidelines.html">Contribution Guidelines</a> - How to contribute to the repository?</li> <li>{@link Contribution Guidelines} - How to contribute to the repository?</li>
<li><a href="Page_EnvironmentSetup.html">Environment Setup</a> - How to set up your environment for development?</li> <li>{@link Environment Setup} - How to set up your environment for development?</li>
</ul> </ul>

View File

@ -3,7 +3,7 @@ from enum import Enum
from . import utils as Utils from . import utils as Utils
from .html_generator import HtmlGenerator from .html_generator import HtmlGenerator
from .doc_utils import FinalizeDescription, FunctionType, GenerateFunctionHtml from .doc_utils import ReplaceLinksInText, FinalizeDescription, FunctionType, GenerateFunctionHtml
class DocEntity: class DocEntity:
def GetName (self): def GetName (self):
@ -47,7 +47,7 @@ class PageDoc (DocEntity):
def GetHtml (self, entityLinks, eol): def GetHtml (self, entityLinks, eol):
if self.type == PageType.Internal: if self.type == PageType.Internal:
pageContent = Utils.GetFileContent (os.path.join (self.folder, self.link)) pageContent = Utils.GetFileContent (os.path.join (self.folder, self.link))
return '<div class="page">' + eol + pageContent + eol + '</div>' return '<div class="page">' + eol + ReplaceLinksInText (pageContent, entityLinks) + eol + '</div>'
else: else:
raise Exception ('GetHtml called for external link.') raise Exception ('GetHtml called for external link.')

View File

@ -28,9 +28,8 @@ def FinalizeType (text, entityLinks):
return GenerateLink (text, entityLinks[text]) return GenerateLink (text, entityLinks[text])
return text return text
def FinalizeDescription (text, entityLinks): def ReplaceLinksInText (text, entityLinks):
text = CleanUpText (text) links = re.findall ('{@link ([^{}]+)}', text)
links = re.findall ('{@link (.+)}', text)
for link in links: for link in links:
if link in entityLinks: if link in entityLinks:
text = text.replace ('{@link ' + link + '}', GenerateLink (link, entityLinks[link])) text = text.replace ('{@link ' + link + '}', GenerateLink (link, entityLinks[link]))
@ -38,6 +37,10 @@ def FinalizeDescription (text, entityLinks):
text = text.replace ('{@link ' + link + '}', link) text = text.replace ('{@link ' + link + '}', link)
return text return text
def FinalizeDescription (text, entityLinks):
text = CleanUpText (text)
return ReplaceLinksInText (text, entityLinks)
def GenerateParameterTypesHtml (paramTypes, generator, entityLinks): def GenerateParameterTypesHtml (paramTypes, generator, entityLinks):
for i in range (0, len (paramTypes)): for i in range (0, len (paramTypes)):
paramType = paramTypes[i] paramType = paramTypes[i]