mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 20:55:50 +00:00
[TOOL] simple script to do find/replace on docs to export back to other github projects
This commit is contained in:
27
tool/githubify.py
Executable file
27
tool/githubify.py
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/env python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def convert_page(text):
|
||||||
|
replacements = {
|
||||||
|
"<div class='multicode'>": "<!-- <div class='multicode'> -->",
|
||||||
|
"</div>": "<!-- </div> -->",
|
||||||
|
"(rest-api-tool.html": "(https://ripple.com/build/rest-tool",
|
||||||
|
"(transactions.html": "(https://ripple.com/build/transactions",
|
||||||
|
"(rippled-apis.html": "(https://ripple.com/build/rippled-apis",
|
||||||
|
}
|
||||||
|
|
||||||
|
for (k,v) in replacements.items():
|
||||||
|
text = text.replace(k,v)
|
||||||
|
|
||||||
|
return text
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
exit("usage: %s infile" % sys.argv[0])
|
||||||
|
|
||||||
|
with open(sys.argv[1]) as f:
|
||||||
|
text = f.read()
|
||||||
|
text = convert_page(text)
|
||||||
|
print(text)
|
||||||
|
|
||||||
Reference in New Issue
Block a user