From 5477c3d72a0003e5ff16658f0047496cd2b9fe4b Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sat, 14 Jan 2023 22:30:38 +0100 Subject: [PATCH] Replace links in documentation pages. --- docs/Page_ContributionGuidelines.html | 2 +- docs/Page_Installation.html | 2 +- docs/Page_Usage.html | 6 +++--- docs/index.html | 8 ++++---- docs/source/ContributionGuidelines.html | 2 +- docs/source/Installation.html | 2 +- docs/source/Usage.html | 6 +++--- docs/source/index.html | 8 ++++---- tools/lib/doc_entities.py | 4 ++-- tools/lib/doc_utils.py | 9 ++++++--- 10 files changed, 26 insertions(+), 23 deletions(-) diff --git a/docs/Page_ContributionGuidelines.html b/docs/Page_ContributionGuidelines.html index ec0a374..45dbc00 100644 --- a/docs/Page_ContributionGuidelines.html +++ b/docs/Page_ContributionGuidelines.html @@ -65,7 +65,7 @@

Basic Guidelines

-

Before you start, learn how to Set Up the Environment. Pull requests must target the dev branch. Please create a separate pull request for every feature or bug fix.

+

Before you start, read the Environment Setup page. Pull requests must target the dev branch. Please create a separate pull request for every feature or bug fix.

Bug Fixing Guidelines

diff --git a/docs/Page_Installation.html b/docs/Page_Installation.html index db40ff7..8a1d9ff 100644 --- a/docs/Page_Installation.html +++ b/docs/Page_Installation.html @@ -77,7 +77,7 @@

Download as browser-ready bundle

-

A bundle is available for every release. You need to download the zip file attached to the latest release. After that, copy the content of the zip file on your server, and include the main file on your site.

+

A bundle is available for every release. You need to download the zip file attached to the latest release. After that, copy the content of the zip file on your server, and include the main file on your site.

<script type="text/javascript" src="o3dv.min.js"></script>
diff --git a/docs/Page_Usage.html b/docs/Page_Usage.html index 5f028de..98088df 100644 --- a/docs/Page_Usage.html +++ b/docs/Page_Usage.html @@ -69,7 +69,7 @@ There are two ways to use the library:

External library handling

-

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 SetExternalLibLocation function. Make sure to call it before any other engine calls.

+

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 SetExternalLibLocation function. Make sure to call it before any other engine calls.

Automatic initialization

@@ -91,7 +91,7 @@ There are two ways to use the library:
  • environmentmapbg: Boolean ("true" or "false") to set the environment map as background.
  • -

    After placing the elements, call the Init3DViewerElements function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.

    +

    After placing the elements, call the Init3DViewerElements function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.

    // tell the engine where to find the libs folder
     OV.SetExternalLibLocation ('libs');
    @@ -100,7 +100,7 @@ OV.Init3DViewerElements ();

    Initialization from code

    -

    You can also initalize the engine from code. In this case you can provide all the parameters as a JavaScript object. See the EmbeddedViewer documentation for more details.

    +

    You can also initalize the engine from code. In this case you can provide all the parameters as a JavaScript object. See the EmbeddedViewer documentation for more details.

    window.addEventListener ('load', () => {
         // set the location of the external libraries
    diff --git a/docs/index.html b/docs/index.html
    index 9d66006..d268be9 100644
    --- a/docs/index.html
    +++ b/docs/index.html
    @@ -73,8 +73,8 @@
     

    These documents help you understanding how to use the engine in your own solution.

      -
    • Installation - How to get the package?
    • -
    • Usage - How to use it to embed 3D models?
    • +
    • Installation - How to get the package?
    • +
    • Usage - How to use it to embed 3D models?

    Contribution

    @@ -82,8 +82,8 @@

    If you would like to contribute to the codebase, these documents help you to start.

    diff --git a/docs/source/ContributionGuidelines.html b/docs/source/ContributionGuidelines.html index 6f3d012..5b5ca5b 100644 --- a/docs/source/ContributionGuidelines.html +++ b/docs/source/ContributionGuidelines.html @@ -4,7 +4,7 @@

    Basic Guidelines

    -

    Before you start, learn how to Set Up the Environment. Pull requests must target the dev branch. Please create a separate pull request for every feature or bug fix.

    +

    Before you start, read the {@link Environment Setup} page. Pull requests must target the dev branch. Please create a separate pull request for every feature or bug fix.

    Bug Fixing Guidelines

    diff --git a/docs/source/Installation.html b/docs/source/Installation.html index 48f8bc2..9dd86d3 100644 --- a/docs/source/Installation.html +++ b/docs/source/Installation.html @@ -16,6 +16,6 @@

    Download as browser-ready bundle

    -

    A bundle is available for every release. You need to download the zip file attached to the latest release. After that, copy the content of the zip file on your server, and include the main file on your site.

    +

    A bundle is available for every release. You need to download the zip file attached to the latest release. After that, copy the content of the zip file on your server, and include the main file on your site.

    <script type="text/javascript" src="o3dv.min.js"></script>
    diff --git a/docs/source/Usage.html b/docs/source/Usage.html index f9d8cb0..4951a1d 100644 --- a/docs/source/Usage.html +++ b/docs/source/Usage.html @@ -8,7 +8,7 @@ There are two ways to use the library:

    External library handling

    -

    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 SetExternalLibLocation function. Make sure to call it before any other engine calls.

    +

    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.

    Automatic initialization

    @@ -30,7 +30,7 @@ There are two ways to use the library:
  • environmentmapbg: Boolean ("true" or "false") to set the environment map as background.
  • -

    After placing the elements, call the Init3DViewerElements function to initalize all the viewers. It must be called from the main JavaScript file outside of the onload event.

    +

    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.

    // tell the engine where to find the libs folder
     OV.SetExternalLibLocation ('libs');
    @@ -39,7 +39,7 @@ OV.Init3DViewerElements ();

    Initialization from code

    -

    You can also initalize the engine from code. In this case you can provide all the parameters as a JavaScript object. See the EmbeddedViewer documentation for more details.

    +

    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.

    window.addEventListener ('load', () => {
         // set the location of the external libraries
    diff --git a/docs/source/index.html b/docs/source/index.html
    index 97ab839..5de9c73 100644
    --- a/docs/source/index.html
    +++ b/docs/source/index.html
    @@ -12,8 +12,8 @@
     

    These documents help you understanding how to use the engine in your own solution.

      -
    • Installation - How to get the package?
    • -
    • Usage - How to use it to embed 3D models?
    • +
    • {@link Installation} - How to get the package?
    • +
    • {@link Usage} - How to use it to embed 3D models?

    Contribution

    @@ -21,6 +21,6 @@

    If you would like to contribute to the codebase, these documents help you to start.

      -
    • Contribution Guidelines - How to contribute to the repository?
    • -
    • Environment Setup - How to set up your environment for development?
    • +
    • {@link Contribution Guidelines} - How to contribute to the repository?
    • +
    • {@link Environment Setup} - How to set up your environment for development?
    diff --git a/tools/lib/doc_entities.py b/tools/lib/doc_entities.py index 44a87cd..81af462 100644 --- a/tools/lib/doc_entities.py +++ b/tools/lib/doc_entities.py @@ -3,7 +3,7 @@ from enum import Enum from . import utils as Utils from .html_generator import HtmlGenerator -from .doc_utils import FinalizeDescription, FunctionType, GenerateFunctionHtml +from .doc_utils import ReplaceLinksInText, FinalizeDescription, FunctionType, GenerateFunctionHtml class DocEntity: def GetName (self): @@ -47,7 +47,7 @@ class PageDoc (DocEntity): def GetHtml (self, entityLinks, eol): if self.type == PageType.Internal: pageContent = Utils.GetFileContent (os.path.join (self.folder, self.link)) - return '
    ' + eol + pageContent + eol + '
    ' + return '
    ' + eol + ReplaceLinksInText (pageContent, entityLinks) + eol + '
    ' else: raise Exception ('GetHtml called for external link.') diff --git a/tools/lib/doc_utils.py b/tools/lib/doc_utils.py index 4b48eb4..b1b806c 100644 --- a/tools/lib/doc_utils.py +++ b/tools/lib/doc_utils.py @@ -28,9 +28,8 @@ def FinalizeType (text, entityLinks): return GenerateLink (text, entityLinks[text]) return text -def FinalizeDescription (text, entityLinks): - text = CleanUpText (text) - links = re.findall ('{@link (.+)}', text) +def ReplaceLinksInText (text, entityLinks): + links = re.findall ('{@link ([^{}]+)}', text) for link in links: if link in entityLinks: text = text.replace ('{@link ' + link + '}', GenerateLink (link, entityLinks[link])) @@ -38,6 +37,10 @@ def FinalizeDescription (text, entityLinks): text = text.replace ('{@link ' + link + '}', link) return text +def FinalizeDescription (text, entityLinks): + text = CleanUpText (text) + return ReplaceLinksInText (text, entityLinks) + def GenerateParameterTypesHtml (paramTypes, generator, entityLinks): for i in range (0, len (paramTypes)): paramType = paramTypes[i]