mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-20 04:38:40 +07:00
refactor(/docs): rework documentation structure layout (#179)
* refactor(/docs): rework documentation structure layout * refactor(/docs): update file reference paths * feat(/docs): add English version of other-proxy-protocol.md * refacotr: move docs/templates/ docs/sync/ to hack/ * fix(example.dae|readme): update ref link to adopt new file structure * refactor: rename other-proxy-protocol.md -> proxy-protocols.md * docs(readme): add ref to proxy-protocols.md * feat(/docs): add English version of how-it-works.md * refactor: rename how-it-works; add nav links * fix: fix linting errors * fix: fix linting errors --------- Co-authored-by: earrmouth <43926351+earrmouth@users.noreply.github.com>
This commit is contained in:
@ -2,15 +2,15 @@ import re
|
||||
|
||||
|
||||
def read_config(filename):
|
||||
with open(filename, 'r') as f:
|
||||
return ''.join(f.readlines())
|
||||
with open(filename, "r") as f:
|
||||
return "".join(f.readlines())
|
||||
|
||||
|
||||
def replacetext(src_file, dest_file, search_text, replace_text):
|
||||
with open(src_file, 'r+') as src:
|
||||
with open(src_file, "r+") as src:
|
||||
src_file = src.read() # Read
|
||||
src.close()
|
||||
with open(dest_file, 'w') as dest:
|
||||
with open(dest_file, "w") as dest:
|
||||
dest_file = re.sub(search_text, replace_text, src_file) # Replace
|
||||
dest.seek(0) # Setting the position to the top of the page to insert data
|
||||
dest.write(dest_file) # Write
|
||||
@ -19,16 +19,16 @@ def replacetext(src_file, dest_file, search_text, replace_text):
|
||||
|
||||
|
||||
def main():
|
||||
search_text = '<!-- TEXT REPLACE -->'
|
||||
replace_text = read_config('example.dae')
|
||||
search_text = "<!-- TEXT REPLACE -->"
|
||||
replace_text = read_config("example.dae")
|
||||
|
||||
replacetext(
|
||||
'docs/templates/example-config.md',
|
||||
'docs/sync/example-config.md',
|
||||
"hack/templates/example-config.md",
|
||||
"hack/sync/example-config.md",
|
||||
search_text,
|
||||
replace_text,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Reference in New Issue
Block a user