Skip to content

Commit 6cb0207

Browse files
committed
Documentation fixes
:method:... links should be :meth:... and '\' in the comments for scintilla functions automatically escaped in CreateWrapper.py.
1 parent 4a862d2 commit 6cb0207

2 files changed

Lines changed: 35 additions & 35 deletions

File tree

PythonScript/src/CreateWrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def writeScintillaDoc(f, out):
675675
out.write(".. method:: Editor.")
676676
out.write(getPythonSignature(v))
677677
out.write("\n\n ")
678-
out.write("\n ".join(v["Comment"]))
678+
out.write("\n ".join(v["Comment"]).replace('\\', '\\\\'))
679679
out.write("\n\n See Scintilla documentation for `{0} <http://www.scintilla.org/ScintillaDoc.html#{0}>`_\n\n".format(symbolName(v)))
680680

681681
def writeScintillaEnums(f, out):

docs/source/scintilla.rst

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,12 +1505,12 @@ Scintilla Methods
15051505

15061506
.. method:: Editor.replaceTargetRE(text) -> int
15071507

1508-
Replace the target text with the argument text after \d processing.
1508+
Replace the target text with the argument text after \\d processing.
15091509
Text is counted so it can contain NULs.
1510-
Looks for \d where d is between 1 and 9 and replaces these with the strings
1511-
matched in the last search operation which were surrounded by \( and \).
1510+
Looks for \\d where d is between 1 and 9 and replaces these with the strings
1511+
matched in the last search operation which were surrounded by \\( and \\).
15121512
Returns the length of the replacement text including any change
1513-
caused by processing the \d patterns.
1513+
caused by processing the \\d patterns.
15141514

15151515
See Scintilla documentation for `SCI_REPLACETARGETRE <http://www.scintilla.org/ScintillaDoc.html#SCI_REPLACETARGETRE>`_
15161516

@@ -4017,7 +4017,7 @@ Scintilla Methods
40174017

40184018
.. method:: Editor.propertyNames() -> str
40194019

4020-
Retrieve a '\n' separated list of properties understood by the current lexer.
4020+
Retrieve a '\\n' separated list of properties understood by the current lexer.
40214021

40224022
See Scintilla documentation for `SCI_PROPERTYNAMES <http://www.scintilla.org/ScintillaDoc.html#SCI_PROPERTYNAMES>`_
40234023

@@ -4035,7 +4035,7 @@ Scintilla Methods
40354035

40364036
.. method:: Editor.describeKeyWordSets() -> str
40374037

4038-
Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
4038+
Retrieve a '\\n' separated list of descriptions of the keyword sets understood by the current lexer.
40394039

40404040
See Scintilla documentation for `SCI_DESCRIBEKEYWORDSETS <http://www.scintilla.org/ScintillaDoc.html#SCI_DESCRIBEKEYWORDSETS>`_
40414041

@@ -4243,7 +4243,7 @@ Helper Methods
42434243
Note that ``Editor`` callbacks are processed *asynchronously* by default. What this means in practice is that your event handler function
42444244
(saveCurrentDoc in the previous example) is called just after the event has fired. If the callback handler is slow, and the callbacks occur quickly, you
42454245
could get "behind". Callbacks are placed in a queue and processed in the order they arrived. If you need to do something before letting the user continue, you
4246-
can use :method:`Editor.callbackSync`, which adds a synchronous callback.
4246+
can use :meth:`Editor.callbackSync`, which adds a synchronous callback.
42474247

42484248

42494249
.. method:: Editor.callbackSync(function, eventsList)
@@ -4253,13 +4253,13 @@ Helper Methods
42534253
What this means is that the handler function is called, and must complete, before control is returned to the user. If you perform a slow operation in your handler
42544254
function, this will have an effect on the speed of Notepad++ for the user (i.e. Notepad++ may appear to have "locked up", whilst your event processes).
42554255

4256-
Synchronous callbacks are mostly used for calling :method:`Editor.autoCCancel` in response to :class:`SCINTILLANOTIFICATION.AUTOCSELECTION`, but could be used for
4256+
Synchronous callbacks are mostly used for calling :meth:`Editor.autoCCancel` in response to :class:`SCINTILLANOTIFICATION.AUTOCSELECTION`, but could be used for
42574257
anything where the timing of the handler function is critical.
42584258

42594259

42604260
.. method:: Editor.replace(search, replace[, flags[, startPosition[, endPosition[, maxCount]]]])
42614261

4262-
See :method:`Editor.rereplace`, as this method is identical, with the exception that the search string is treated literally,
4262+
See :meth:`Editor.rereplace`, as this method is identical, with the exception that the search string is treated literally,
42634263
and not as a regular expression.
42644264

42654265
If you use a function as the replace argument, the function will still receive a ``re.MatchObject`` like object as the parameter,
@@ -4268,30 +4268,30 @@ Helper Methods
42684268
For example::
42694269

42704270
4271-
counter = 0
4271+
counter = 0
42724272

4273-
def get_counter(m):
4274-
global counter
4275-
counter += 1
4276-
return 'C' + str(counter)
4273+
def get_counter(m):
4274+
global counter
4275+
counter += 1
4276+
return 'C' + str(counter)
42774277

4278-
editor.replace('(x)', get_counter, re.IGNORECASE)
4278+
editor.replace('(x)', get_counter, re.IGNORECASE)
42794279

4280-
# Replacing:
4281-
#
4282-
# This (x) is some (X) text. The bracketed X's will (x) get numerical replacements
4283-
#
4284-
# results in
4285-
#
4286-
# This C1 is some C2 text. The bracketed X's will C3 get numerical replacements
4280+
# Replacing:
4281+
#
4282+
# This (x) is some (X) text. The bracketed X's will (x) get numerical replacements
4283+
#
4284+
# results in
4285+
#
4286+
# This C1 is some C2 text. The bracketed X's will C3 get numerical replacements
42874287

42884288

42894289

42904290

42914291
.. method:: Editor.rereplace(search, replace[, flags[, startPosition[, endPosition[, maxCount]]]])
42924292

42934293
The main search and replace method, using regular expressions. The regular expression syntax in use is
4294-
that from Notepad++, which is actually the `Boost::Regex <http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/index.html>`
4294+
that from Notepad++, which is actually the `Boost::Regex <http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/index.html>`_
42954295
implementation (specifically the Perl regular expression syntax).
42964296

42974297

@@ -4303,7 +4303,7 @@ Helper Methods
43034303

43044304
Note that line endings are now handled automatically.
43054305

4306-
``search`` can be a string, a unicode string, or an object. An object will be converted to a string using it's __str__ method.
4306+
``search`` can be a string, a unicode string, or an object. An object will be converted to a string using it's ``__str__`` method.
43074307
For a unicode string, the current document encoding is checked, and an attempt is made at a conversion. If the conversion cannot be
43084308
successfully performed, an error occurs. When a standard Python string is used, no conversion takes place. If you need to replace
43094309
strings in documents in both UTF-8 and ANSI (or other single byte encodings), then it's best to pass unicode strings.
@@ -4326,10 +4326,10 @@ Helper Methods
43264326

43274327
editor.rereplace('X([0-9]+)', add_1);
43284328

4329-
``startPosition`` is the binary position to start the search. Use :method:`Editor.positionFromLine`
4329+
``startPosition`` is the binary position to start the search. Use :meth:`Editor.positionFromLine`
43304330
to get the binary position from the (zero indexed) line number.
43314331

4332-
``endPosition`` is the binary position to end the search. Use :method:`Editor.positionFromLine`
4332+
``endPosition`` is the binary position to end the search. Use :meth:`Editor.positionFromLine`
43334333
to get the binary position from the (zero indexed) line number.
43344334

43354335
A maximum of ``count`` replacements are made, if zero or None, then all replacements are made.
@@ -4343,7 +4343,7 @@ Helper Methods
43434343
.. method:: Editor.research(search, matchFunction[, flags[, startPosition[, endPosition[, maxCount]]]])
43444344

43454345
The main search method, using regular expressions. The regular expression syntax in use is
4346-
that from Notepad++, which is actually the `Boost::Regex <http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/index.html>`
4346+
that from Notepad++, which is actually the `Boost::Regex <http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/index.html>`_
43474347
implementation (specifically the Perl regular expression syntax).
43484348

43494349
``flags`` are from the re module (e.g. ``re.IGNORECASE``), so ``import re`` if you use the flags.
@@ -4354,7 +4354,7 @@ Helper Methods
43544354

43554355
Note that line endings are now handled automatically.
43564356

4357-
``search`` can be a string, a unicode string, or an object. An object will be converted to a string using it's __str__ method.
4357+
``search`` can be a string, a unicode string, or an object. An object will be converted to a string using it's ``__str__`` method.
43584358
For a unicode string, the current document encoding is checked, and an attempt is made at a conversion. If the conversion cannot be
43594359
successfully performed, an error occurs. When a standard Python string is used, no conversion takes place. If you need to replace
43604360
strings in documents in both UTF-8 and ANSI (or other single byte encodings), then it's best to pass unicode strings.
@@ -4385,10 +4385,10 @@ Helper Methods
43854385

43864386

43874387

4388-
``startPosition`` is the binary position to start the search. Use :method:`Editor.positionFromLine`
4388+
``startPosition`` is the binary position to start the search. Use :meth:`Editor.positionFromLine`
43894389
to get the binary position from the (zero indexed) line number.
43904390

4391-
``endPosition`` is the binary position to end the search. Use :method:`Editor.positionFromLine`
4391+
``endPosition`` is the binary position to end the search. Use :meth:`Editor.positionFromLine`
43924392
to get the binary position from the (zero indexed) line number.
43934393

43944394
If ``maxCount`` is not zero or None, then the search stops as soon as ``maxCount`` matches have been found.
@@ -4398,7 +4398,7 @@ Helper Methods
43984398

43994399
This method has been removed from version 1.0. It was last present in version 0.9.2.0
44004400

4401-
You should use :method:`Editor.rereplace`.
4401+
You should use :meth:`Editor.rereplace`.
44024402

44034403

44044404

@@ -4408,20 +4408,20 @@ Helper Methods
44084408

44094409
This method has been removed from version 1.0. It was last present in version 0.9.2.0
44104410

4411-
You should use :method:`Editor.rereplace`.
4411+
You should use :meth:`Editor.rereplace`.
44124412

44134413

44144414
.. method:: Editor.pysearch(expression, function[, flags[, startLine[, endLine]]])
44154415

44164416
This method has been removed from version 1.0. It was last present in version 0.9.2.0
44174417

4418-
You should use :method:`Editor.research`.
4418+
You should use :meth:`Editor.research`.
44194419

44204420

44214421
.. method:: Editor.pymlsearch(expression, function[, flags[, startPosition[, endPosition]]])
44224422

44234423
This method has been removed from version 1.0. It was last present in version 0.9.2.0
44244424

4425-
You should use :method:`Editor.research`.
4425+
You should use :meth:`Editor.research`.
44264426

44274427

0 commit comments

Comments
 (0)