[TOOL] simple script to do find/replace on docs to export back to other github projects

This commit is contained in:
mDuo13
2015-02-11 11:37:29 -08:00
parent a807b56192
commit 6c7cea9db8

27
tool/githubify.py Executable file
View 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)