mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-15 00:07:25 -05:00
Don't mangle http see links in PyQGIS docs
This commit is contained in:
parent
534ca73c59
commit
f2e4c3dfb7
@ -718,7 +718,7 @@ Please note that the sum will be negative if the points are defined in clockwise
|
||||
Therefore, if you want to use the sum as an area (as the method name indicates) then you probably should use the absolute value,
|
||||
since otherwise a bug can be introduced (such as the bug fixed for github issue 49578)
|
||||
|
||||
.. seealso:: :py:func:`https` //en.wikipedia.org/wiki/Shoelace_formula#Triangle_formula
|
||||
.. seealso:: https://en.wikipedia.org/wiki/Shoelace_formula#Triangle_formula
|
||||
%End
|
||||
|
||||
virtual double vertexAngle( QgsVertexId vertex ) const;
|
||||
|
||||
@ -120,14 +120,14 @@ Returns a list of licences available by default in the wizard.
|
||||
%Docstring
|
||||
Returns a list of link types available by default in the wizard.
|
||||
|
||||
.. seealso:: :py:func:`https` //github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv
|
||||
.. seealso:: https://github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv
|
||||
%End
|
||||
|
||||
static QStringList parseMimeTypes();
|
||||
%Docstring
|
||||
Returns a list of MIME types available by default in the wizard.
|
||||
|
||||
.. seealso:: :py:func:`https` //fr.wikipedia.org/wiki/Type_MIME
|
||||
.. seealso:: https://fr.wikipedia.org/wiki/Type_MIME
|
||||
%End
|
||||
|
||||
static QMap<QString, QString> parseTypes();
|
||||
|
||||
@ -718,7 +718,7 @@ Please note that the sum will be negative if the points are defined in clockwise
|
||||
Therefore, if you want to use the sum as an area (as the method name indicates) then you probably should use the absolute value,
|
||||
since otherwise a bug can be introduced (such as the bug fixed for github issue 49578)
|
||||
|
||||
.. seealso:: :py:func:`https` //en.wikipedia.org/wiki/Shoelace_formula#Triangle_formula
|
||||
.. seealso:: https://en.wikipedia.org/wiki/Shoelace_formula#Triangle_formula
|
||||
%End
|
||||
|
||||
virtual double vertexAngle( QgsVertexId vertex ) const;
|
||||
|
||||
@ -120,14 +120,14 @@ Returns a list of licences available by default in the wizard.
|
||||
%Docstring
|
||||
Returns a list of link types available by default in the wizard.
|
||||
|
||||
.. seealso:: :py:func:`https` //github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv
|
||||
.. seealso:: https://github.com/OSGeo/Cat-Interop/blob/master/LinkPropertyLookupTable.csv
|
||||
%End
|
||||
|
||||
static QStringList parseMimeTypes();
|
||||
%Docstring
|
||||
Returns a list of MIME types available by default in the wizard.
|
||||
|
||||
.. seealso:: :py:func:`https` //fr.wikipedia.org/wiki/Type_MIME
|
||||
.. seealso:: https://fr.wikipedia.org/wiki/Type_MIME
|
||||
%End
|
||||
|
||||
static QMap<QString, QString> parseTypes();
|
||||
|
||||
@ -852,23 +852,29 @@ def process_doxygen_line(line: str) -> str:
|
||||
return create_class_links(depr_line)
|
||||
|
||||
# Handle see also
|
||||
see_matches = list(re.finditer(r'\\see +(\w+(\.\w+)*)(\([^()]*\))?', line))
|
||||
see_matches = list(re.finditer(r'\\see +([\w:/.#-]+(\.\w+)*)(\([^()]*\))?(\.?)', line))
|
||||
if see_matches:
|
||||
for see_match in reversed(see_matches):
|
||||
seealso = see_match.group(1)
|
||||
seealso_suffix = see_match.group(4)
|
||||
|
||||
seeline = ''
|
||||
dbg_info(f"see also: `{seealso}`")
|
||||
if re.match(r'^Qgs[A-Z]\w+(\([^()]*\))?$', seealso):
|
||||
dbg_info(f"\\see :py:class:`{seealso}`")
|
||||
seeline = f":py:class:`{seealso}`"
|
||||
elif re.match(r'^(Qgs[A-Z]\w+)\.(\w+)(\([^()]*\))?$', seealso):
|
||||
dbg_info(f"\\see py:func with param: :py:func:`{seealso}`")
|
||||
seeline = f":py:func:`{seealso}`"
|
||||
elif re.match(r'^[a-z]\w+(\([^()]*\))?$', seealso):
|
||||
dbg_info(f"\\see :py:func:`{seealso}`")
|
||||
seeline = f":py:func:`{seealso}`"
|
||||
if re.match(r'^http', seealso):
|
||||
seeline = f"{seealso}"
|
||||
elif seealso_match := re.match(r'^(Qgs[A-Z]\w+(\([^()]*\))?)(\.)?$', seealso):
|
||||
dbg_info(f"\\see :py:class:`{seealso_match.group(1)}`")
|
||||
seeline = f":py:class:`{seealso_match.group(1)}`{seealso_match.group(3) or ''}"
|
||||
elif seealso_match := re.match(r'^((Qgs[A-Z]\w+)\.(\w+)(\([^()]*\))?)(\.)?$', seealso):
|
||||
dbg_info(f"\\see py:func with param: :py:func:`{seealso_match.group(1)}`")
|
||||
seeline = f":py:func:`{seealso_match.group(1)}`{seealso_match.group(5) or ''}"
|
||||
elif seealso_match := re.match(r'^([a-z]\w+(\([^()]*\))?)(\.)?$', seealso):
|
||||
dbg_info(f"\\see :py:func:`{seealso_match.group(1)}`")
|
||||
seeline = f":py:func:`{seealso_match.group(1)}`{seealso_match.group(3) or ''}"
|
||||
|
||||
if full_line_match := re.match(r'^\s*\\see +(\w+(?:\.\w+)*)(?:\([^()]*\))?[\s,.:-]*(.*?)$', line):
|
||||
if seeline.startswith('http'):
|
||||
return f"\n.. seealso:: {seeline}\n"
|
||||
suffix = full_line_match.group(2)
|
||||
if suffix:
|
||||
return f"\n.. seealso:: {seeline or seealso} {suffix.strip()}\n"
|
||||
@ -876,7 +882,7 @@ def process_doxygen_line(line: str) -> str:
|
||||
return f"\n.. seealso:: {seeline or seealso}\n"
|
||||
else:
|
||||
if seeline:
|
||||
line = line[:see_match.start()] + seeline + line[
|
||||
line = line[:see_match.start()] + seeline + seealso_suffix + line[
|
||||
see_match.end():] # re.sub(r'\\see +(\w+(\.\w+)*(\(\))?)', seeline, line)
|
||||
else:
|
||||
line = line.replace('\\see', 'see')
|
||||
|
||||
@ -67,7 +67,7 @@ class RemoveRecentCrsDelegate : public QStyledItemDelegate SIP_SKIP
|
||||
* QgsProjectionSelectionDialog dialog. In most cases it is more
|
||||
* suitable to use the compact QgsProjectionSelectionWidget widget.
|
||||
*
|
||||
* \see QgsProjectionSelectionDialog.
|
||||
* \see QgsProjectionSelectionDialog
|
||||
* \see QgsProjectionSelectionWidget
|
||||
*/
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user