Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/802910 )

Change subject: [doc] Fix documentation for data_ingestion.py
......................................................................

[doc] Fix documentation for data_ingestion.py

Also remove escape sequence for vertical bars

Change-Id: Ia3a1b877665813eeb6e0146c5a91ad09d80c1935
---
M docs/conf.py
M scripts/data_ingestion.py
2 files changed, 17 insertions(+), 23 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved



diff --git a/docs/conf.py b/docs/conf.py
index 2538d80..f36bc62 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -440,10 +440,6 @@
             # Reset length
             length = 0

-        if '|' in line:
-            # Escape vertical bars
-            lines[index] = line.replace('|', '\\|')
-

 def pywikibot_skip_members(app, what, name, obj, skip, options):
     """Skip certain members from documentation."""
diff --git a/scripts/data_ingestion.py b/scripts/data_ingestion.py
index c567c05..ac83770 100755
--- a/scripts/data_ingestion.py
+++ b/scripts/data_ingestion.py
@@ -50,18 +50,18 @@

 Example 'Data ingestion' template
 =================================
-.. code::
+.. code-block:: python

-    {{Data ingestion
-    |sourceFormat=csv
-    |csvFile=csv_ingestion.csv
-    |sourceFileKey=%(StockNumber)
-    |csvDialect=
-    |csvDelimiter=,
-    |csvEncoding=utf8
-    |formattingTemplate=Template:Data ingestion test configuration
-    |titleFormat=%(name)s - %(set)s.%(_ext)s
-    }}
+   {{Data ingestion
+   |sourceFormat=csv
+   |csvFile=csv_ingestion.csv
+   |sourceFileKey=%(StockNumber)
+   |csvDialect=
+   |csvDelimiter=,
+   |csvEncoding=utf8
+   |formattingTemplate=Template:Data ingestion test configuration
+   |titleFormat=%(name)s - %(set)s.%(_ext)s
+   }}


 Csv file
@@ -76,22 +76,20 @@

 Usage
 =====
-.. code::
+.. code-block:: python

-    python pwb.py data_ingestion -csvdir:<local_dir/> -page:<cfg_page_on_wiki>
+   python pwb.py data_ingestion -csvdir:<local_dir/> -page:<cfg_page_on_wiki>


 Example
 =======
-Warning! Put it in one line, otherwise it won't work correctly.
+.. code-block:: python

-.. code::
+   pwb.py data_ingestion -csvdir:"test/data" 
-page:"User:<Your-Username>/data_ingestion_test_template"

-    python pwb.py data_ingestion \
-        -csvdir:"test/data" \
-        -page:"User:<Your-Username>/data_ingestion_test_template"
+.. warning:: Put it in one line, otherwise it won't work correctly.

-"""
+"""  # noqa: E501
 #
 # (C) Pywikibot team, 2012-2022
 #

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/802910
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia3a1b877665813eeb6e0146c5a91ad09d80c1935
Gerrit-Change-Number: 802910
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to