mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 04:35:49 +00:00
parse_pages - strip RippleAPI table-of-contents
This commit is contained in:
@@ -138,71 +138,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='content'>
|
<div class='content'>
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<h1 id="introduction">Introduction</h1>
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
||||||
<h1 id="rippleapi-reference">RippleAPI Reference</h1>
|
|
||||||
<ul>
|
|
||||||
<li><a href="#introduction">Introduction</a></li>
|
|
||||||
<li><a href="#boilerplate">Boilerplate</a></li>
|
|
||||||
<li><a href="#offline-functionality">Offline functionality</a></li>
|
|
||||||
<li><a href="#basic-types">Basic Types</a></li>
|
|
||||||
<li><a href="#ripple-address">Ripple Address</a></li>
|
|
||||||
<li><a href="#account-sequence-number">Account Sequence Number</a></li>
|
|
||||||
<li><a href="#currency">Currency</a></li>
|
|
||||||
<li><a href="#value">Value</a></li>
|
|
||||||
<li><a href="#amount">Amount</a></li>
|
|
||||||
<li><a href="#transaction-overview">Transaction Overview</a></li>
|
|
||||||
<li><a href="#transaction-types">Transaction Types</a></li>
|
|
||||||
<li><a href="#transaction-flow">Transaction Flow</a></li>
|
|
||||||
<li><a href="#transaction-fees">Transaction Fees</a></li>
|
|
||||||
<li><a href="#transaction-instructions">Transaction Instructions</a></li>
|
|
||||||
<li><a href="#transaction-id">Transaction ID</a></li>
|
|
||||||
<li><a href="#transaction-memos">Transaction Memos</a></li>
|
|
||||||
<li><a href="#transaction-specifications">Transaction Specifications</a></li>
|
|
||||||
<li><a href="#payment">Payment</a></li>
|
|
||||||
<li><a href="#trustline">Trustline</a></li>
|
|
||||||
<li><a href="#order">Order</a></li>
|
|
||||||
<li><a href="#order-cancellation">Order Cancellation</a></li>
|
|
||||||
<li><a href="#settings">Settings</a></li>
|
|
||||||
<li><a href="#suspended-payment-creation">Suspended Payment Creation</a></li>
|
|
||||||
<li><a href="#suspended-payment-cancellation">Suspended Payment Cancellation</a></li>
|
|
||||||
<li><a href="#suspended-payment-execution">Suspended Payment Execution</a></li>
|
|
||||||
<li><a href="#api-methods">API Methods</a></li>
|
|
||||||
<li><a href="#connect">connect</a></li>
|
|
||||||
<li><a href="#disconnect">disconnect</a></li>
|
|
||||||
<li><a href="#isconnected">isConnected</a></li>
|
|
||||||
<li><a href="#getserverinfo">getServerInfo</a></li>
|
|
||||||
<li><a href="#getfee">getFee</a></li>
|
|
||||||
<li><a href="#getledgerversion">getLedgerVersion</a></li>
|
|
||||||
<li><a href="#gettransaction">getTransaction</a></li>
|
|
||||||
<li><a href="#gettransactions">getTransactions</a></li>
|
|
||||||
<li><a href="#gettrustlines">getTrustlines</a></li>
|
|
||||||
<li><a href="#getbalances">getBalances</a></li>
|
|
||||||
<li><a href="#getbalancesheet">getBalanceSheet</a></li>
|
|
||||||
<li><a href="#getpaths">getPaths</a></li>
|
|
||||||
<li><a href="#getorders">getOrders</a></li>
|
|
||||||
<li><a href="#getorderbook">getOrderbook</a></li>
|
|
||||||
<li><a href="#getsettings">getSettings</a></li>
|
|
||||||
<li><a href="#getaccountinfo">getAccountInfo</a></li>
|
|
||||||
<li><a href="#getledger">getLedger</a></li>
|
|
||||||
<li><a href="#preparepayment">preparePayment</a></li>
|
|
||||||
<li><a href="#preparetrustline">prepareTrustline</a></li>
|
|
||||||
<li><a href="#prepareorder">prepareOrder</a></li>
|
|
||||||
<li><a href="#prepareordercancellation">prepareOrderCancellation</a></li>
|
|
||||||
<li><a href="#preparesettings">prepareSettings</a></li>
|
|
||||||
<li><a href="#preparesuspendedpaymentcreation">prepareSuspendedPaymentCreation</a></li>
|
|
||||||
<li><a href="#preparesuspendedpaymentcancellation">prepareSuspendedPaymentCancellation</a></li>
|
|
||||||
<li><a href="#preparesuspendedpaymentexecution">prepareSuspendedPaymentExecution</a></li>
|
|
||||||
<li><a href="#sign">sign</a></li>
|
|
||||||
<li><a href="#submit">submit</a></li>
|
|
||||||
<li><a href="#generateaddress">generateAddress</a></li>
|
|
||||||
<li><a href="#computeledgerhash">computeLedgerHash</a></li>
|
|
||||||
<li><a href="#api-events">API Events</a></li>
|
|
||||||
<li><a href="#ledger">ledger</a></li>
|
|
||||||
<li><a href="#error">error</a></li>
|
|
||||||
</ul>
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
||||||
<h1 id="introduction">Introduction</h1>
|
|
||||||
<p>RippleAPI is the official client library to the Ripple Consensus Ledger. Currently, RippleAPI is only available in JavaScript.
|
<p>RippleAPI is the official client library to the Ripple Consensus Ledger. Currently, RippleAPI is only available in JavaScript.
|
||||||
Using RippleAPI, you can:</p>
|
Using RippleAPI, you can:</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ MULTICODE_TAB_TARGETS = ["local","ripple.com"]
|
|||||||
|
|
||||||
MC_START_REGEX = re.compile("<!-- *<div class='multicode'[^>]*> *-->")
|
MC_START_REGEX = re.compile("<!-- *<div class='multicode'[^>]*> *-->")
|
||||||
MC_END_REGEX = re.compile("<!-- *</div> *-->")
|
MC_END_REGEX = re.compile("<!-- *</div> *-->")
|
||||||
|
DOCTOC_START = "<!-- START doctoc generated TOC please keep comment here to allow auto update -->"
|
||||||
|
DOCTOC_END = "<!-- END doctoc generated TOC please keep comment here to allow auto update -->"
|
||||||
|
|
||||||
def parse_markdown(md, target=DEFAULT_TARGET, pages=None):
|
def parse_markdown(md, target=DEFAULT_TARGET, pages=None):
|
||||||
## Python markdown requires markdown="1" on HTML block elements
|
## Python markdown requires markdown="1" on HTML block elements
|
||||||
@@ -59,6 +61,12 @@ def parse_markdown(md, target=DEFAULT_TARGET, pages=None):
|
|||||||
# md = re.sub("(<div[^>]*)>", add_markdown_class, md)
|
# md = re.sub("(<div[^>]*)>", add_markdown_class, md)
|
||||||
# print("done")
|
# print("done")
|
||||||
|
|
||||||
|
#Strip out doctoc Table of Contents for RippleAPI
|
||||||
|
doctoc_start_i = md.find(DOCTOC_START)
|
||||||
|
doctoc_end_i = md.find(DOCTOC_END)
|
||||||
|
if doctoc_start_i != -1 and doctoc_end_i != -1:
|
||||||
|
md = md[:doctoc_start_i]+md[doctoc_end_i+len(DOCTOC_END):]
|
||||||
|
|
||||||
#the actual markdown parsing is the easy part
|
#the actual markdown parsing is the easy part
|
||||||
print("parsing markdown...")
|
print("parsing markdown...")
|
||||||
html = markdown(md, extensions=["markdown.extensions.extra",
|
html = markdown(md, extensions=["markdown.extensions.extra",
|
||||||
|
|||||||
Reference in New Issue
Block a user