From 9560737e0d6bef2d2465e5fcb3a4d5258d1f2b92 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Thu, 21 May 2020 14:13:41 -0700 Subject: [PATCH] Fix up XRP-API docs for XRPL.org display --- dactyl-config.yml | 6 ++++++ tool/filter_xrpapi_readme.py | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tool/filter_xrpapi_readme.py diff --git a/dactyl-config.yml b/dactyl-config.yml index ff48224a91..b892704ef3 100644 --- a/dactyl-config.yml +++ b/dactyl-config.yml @@ -69,6 +69,8 @@ targets: github_forkurl: https://github.com/ripple/xrpl-dev-portal github_branch: master locale_file: locale/en/LC_MESSAGES/messages.mo + link_subs: + "./src/api-v3/paths/preparations/payments.ts": "https://github.com/xpring-eng/xrp-api/blob/master/src/api-v3/paths/preparations/payments.ts" - name: ja lang: ja @@ -169,6 +171,8 @@ targets: github_forkurl: https://github.com/ripple/xrpl-dev-portal github_branch: master no_cover: true + link_subs: + "./src/api-v3/paths/preparations/payments.ts": "https://github.com/xpring-eng/xrp-api/blob/master/src/api-v3/paths/preparations/payments.ts" # Data API target for porting changes to the README in the upstream repo # Intended for use in markdown (--md) mode. @@ -5555,6 +5559,8 @@ pages: funnel: Docs doc_type: References supercategory: XRP-API + filters: + - xrpapi_readme targets: - en - ja diff --git a/tool/filter_xrpapi_readme.py b/tool/filter_xrpapi_readme.py new file mode 100644 index 0000000000..1fae2d844f --- /dev/null +++ b/tool/filter_xrpapi_readme.py @@ -0,0 +1,13 @@ +def filter_markdown(md, **kwargs): + """ + Remove the link to the dev portal from the readme and replace it with + a link to the repo (since we're in the dev portal already). + """ + + REMOVE = """## [➡️ XRP API Reference Documentation](https://xrpl.org/xrp-api.html) + +See the full reference documentation on the XRP Ledger Dev Portal.""" + + REPLACEMENT = """[[Source]](https://github.com/xpring-eng/xrp-api "Source")""" + + return md.replace(REMOVE, REPLACEMENT)