docs: Fix generated docs
In distributed docs - Make img tags absolute - Add donate link in docs - Fix provider table
This commit is contained in:
parent
022cda3109
commit
80dab10ec9
3 changed files with 17 additions and 13 deletions
|
@ -111,11 +111,15 @@ def read_doc(doc):
|
|||
contents = parts[2].strip()+"\n\n"
|
||||
# Remove icons
|
||||
contents = re.sub(r'<i class="fa.*?</i>\s*', "", contents)
|
||||
# Make any img tags absolute
|
||||
contents = re.sub(r'(<img.*?src=")/', r"\1https://rclone.org/", contents)
|
||||
# Make [...](/links/) absolute
|
||||
contents = re.sub(r'\]\((\/.*?\/(#.*)?)\)', r"](https://rclone.org\1)", contents)
|
||||
# Add additional links on the front page
|
||||
contents = re.sub(r'<!--MAINPAGELINK-->', "- [Donate.](https://rclone.org/donate/)", contents)
|
||||
# Interpret provider shortcode
|
||||
# {{< provider name="Amazon S3" home="https://aws.amazon.com/s3/" config="/s3/" >}}
|
||||
contents = re.sub(r'\{\{<\s+provider.*?name="(.*?)".*?>\}\}', r"\1", contents)
|
||||
contents = re.sub(r'\{\{<\s+provider.*?name="(.*?)".*?>\}\}', r"- \1", contents)
|
||||
return contents
|
||||
|
||||
def check_docs(docpath):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue