Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace more screenshot into redot interface #23

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9c73b5a
Add permissions
adikhoff Oct 12, 2024
2835e22
Change permissions
adikhoff Oct 12, 2024
6470131
More permissions
adikhoff Oct 12, 2024
0b5a6f2
Make urls local
adikhoff Oct 12, 2024
828ebc4
Copyright notices
adikhoff Oct 12, 2024
14f8208
Fix copyright
adikhoff Oct 12, 2024
fe12303
Bits and bobs
adikhoff Oct 12, 2024
7b92b40
Fix bug
adikhoff Oct 12, 2024
55816f9
Fix version select
adikhoff Oct 12, 2024
2b58ae6
Improve migration script
adikhoff Oct 12, 2024
791b4ec
Linter bullshit
adikhoff Oct 12, 2024
605ada7
Try full compile
adikhoff Oct 12, 2024
34bd91f
Fix bug
adikhoff Oct 12, 2024
ad82e9d
Improve migrate
adikhoff Oct 13, 2024
6001bbd
Ensure dir exists before deleting
adikhoff Oct 13, 2024
a0de8f3
Universal now?
adikhoff Oct 13, 2024
f2ed329
upload new rodot interface
Assetvi Oct 13, 2024
8d5a3bc
Delete tutorials/3d/img/3d_toolbar.webp
Assetvi Oct 13, 2024
5f68514
Delete tutorials/3d/img/tuto_3d6_1.webp
Assetvi Oct 13, 2024
feece6e
Delete tutorials/3d/img/tuto_3d6.webp
Assetvi Oct 13, 2024
fabb57b
Delete tutorials/3d/img/tuto_3d6_2.webp
Assetvi Oct 13, 2024
e83bf12
Delete tutorials/3d/img/tuto_3d4.webp
Assetvi Oct 13, 2024
4141ad1
Update introduction_to_3d.rst
Assetvi Oct 13, 2024
2dff1ba
Delete tutorials/3d/img/redot06.png
Assetvi Oct 13, 2024
584fd04
replace the screenshot with a better one
Assetvi Oct 13, 2024
7bb3a87
Delete tutorials/3d/img/redot06.png
Assetvi Oct 13, 2024
f3a79c9
Add files via upload
Assetvi Oct 13, 2024
ffde334
Update runtime_file_loading_and_saving.rst
Assetvi Oct 13, 2024
a73bd1c
Merge branch 'master' into pictures-0.1
adikhoff Oct 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_offline_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Migrate to Redot
run: |
python migrate.py . _migrated False
python migrate.py . _migrated
- name: Sphinx - Build HTML
run: make SPHINXOPTS='--color -j 4' SPHINXSOURCEDIR='./_migrated' html
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Migrate to Redot
run: |
python migrate.py . _migrated True
python migrate.py . _migrated
# Use dummy builder to improve performance as we don't need the generated HTML in this workflow.
- name: Sphinx build
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/sync_class_ref.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:
runs-on: ubuntu-latest
env:
engine_rev: 'master'

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout the documentation repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion _extensions/gdscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Lexer for GDScript.
:copyright: Copyright 2xxx by The Godot Engine Community
:copyright: Copyright 2xxx by the Redot community, modified from an original work by the G-dot Engine Community
:license: MIT.
modified by Daniel J. Ramirez <[email protected]> based on the original python.py pygment
Expand Down
2 changes: 1 addition & 1 deletion _extensions/godot_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Sphinx extension to automatically generate HTML meta description tags
for all pages. Also comes with some special support for Godot class docs.
:copyright: Copyright 2021 by The Godot Engine Community
:copyright: Copyright 2021 by the Redot community, modified from an original work by the G-dot Engine Community
:license: MIT.
based on the work of Takayuki Shimizukawa on OpenGraph support for Sphinx,
Expand Down
14 changes: 0 additions & 14 deletions _templates/versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,10 @@
<dd><a href="{{ url }}">{{ slug }}</a></dd>
{% endfor %}
</dl>
<dl>
{# Translators: The phrase "Read the Docs" is not translated #}
<dt>{{ _('On Read the Docs') }}</dt>
<dd>
<a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}">{{ _('Project Home') }}</a>
</dd>
<dd>
<a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/builds/">{{ _('Builds') }}</a>
</dd>
<dd>
<a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/downloads/">{{ _('Downloads') }}</a>
</dd>
</dl>

<hr>
<small>
<span>Hosted by <a href="https://readthedocs.org">Read the Docs</a></span>
<span> · </span>
<a href="https://docs.readthedocs.io/page/privacy-policy.html">Privacy Policy</a>
</small>

Expand Down
2 changes: 1 addition & 1 deletion about/complying_with_licenses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This text reads as follows::

This game uses Godot Engine, available under the following license:

Copyright (c) 2014-present Godot Engine contributors.
Copyright (c) 2014-present the Redot community, modified from an original work by G-dot Engine contributors.
Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
4 changes: 2 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@
# General information about the project
project = "Godot Engine"
copyright = (
"2014-present Juan Linietsky, Ariel Manzur and the Godot community (CC BY 3.0)"
"2024-present by the Redot community, modified from an original work by Juan Linietsky, Ariel Manzur and the G-dot community (CC BY 3.0)"
)
author = "Juan Linietsky, Ariel Manzur and the Godot community"
author = "the Redot community, modified from an original work by Juan Linietsky, Ariel Manzur and the G-dot community"

# Version info for the project, acts as replacement for |version| and |release|
# The short X.Y version
Expand Down
6 changes: 4 additions & 2 deletions contributing/development/code_style_guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ Example:
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2014-present the Redot community, modified from an */
/* original work by G-dot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
Expand Down Expand Up @@ -222,7 +223,8 @@ Example:
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2014-present the Redot community, modified from an */
/* original work by Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ like ``core/math/a_star_grid_2d.compat.inc`` in this case:
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2014-present the Redot community, modified from an */
/* original work by G-dot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
Expand Down
Binary file added favicon.ico
Binary file not shown.
165 changes: 110 additions & 55 deletions migrate.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
"""
## Migrate files from Godot to Redot

Usage (order is important):
py migrate.py [inputdir] [outputdir] [include unimplemented]
usage: Migrate [-h] [-e] [-t] [-v] input output

example:
py migrate.py . _migrated True
Simple file migrator. Uses str.replace to map from Godot to Redot. Also converts some filenames.

Will replace specific godot strings with redot. It tries to ignore external projects and other things that can't
positional arguments:
input Input directory relative to current
output Output directory relative to current

options:
-h, --help show this help message and exit
-e, --extended Include unimplemented substitutions, don't use in production
-t, --tiny Exclude classes directory
-v, --verbose

Will replace specific godot strings with redot. It tries to ignore external projects and other things that shouldn't
change.

A distinction is made between unimplemented instances of the godot keyword (for instance references to the main
Expand All @@ -23,18 +31,23 @@
From there, the docs can be built in the normal way.
"""

import argparse
import fnmatch
import os
import re
from shutil import copyfile
import shutil
import sys
import codecs
from distutils.dir_util import copy_tree

encoding = 'utf-8'
defaultInputDirectory = '.'
defaultOutputDirectory = '_migrated'
defaultIncludeUnimplemented = False
defaultIgnoreClasses = True
defaultVerbose = False

encoding = 'utf-8'
filename_masks = ['.rst', '.md']

# Mappings that will currently lead to nowhere. Can be treated as a todo list.
Expand Down Expand Up @@ -72,7 +85,6 @@
('Support/Godot/', 'Support/Redot/'),
('config/godot/', 'config/redot/'),
('share/godot/', 'share/redot/'),
(' godot_', ' redot_'),
('org.godotengine.Godot', 'org.redotengine.Redot'),
('godot-ios-plugins', 'redot-ios-plugins'),
('godot-syntax-themes', 'redot-syntax-themes'),
Expand Down Expand Up @@ -128,6 +140,7 @@
('| ``"Please include this when reporting the bug on: https://github.com/godotengine/godot/issues"`` |', '| ``"Please include this when reporting the bug on: https://github.com/redot-engine/godot/issues"``|'),
('https://github.com/godotengine/godot/pull/40364>`_ for more. |', 'https://github.com/redot-engine/redot/pull/40364>`_ for more. |'),
# Almost existing urls
('https://docs.godotengine.org/', '/'),
('https://docs.godotengine.org', 'https://docs.redotengine.org'),
('https://godotengine.org', 'https://redotengine.org'),
# Existing urls
Expand All @@ -144,6 +157,7 @@
('https://chat.godotengine.org/', 'https://discord.gg/a53QyHJZ'),
# Generic replacements
('GODOT_COPYRIGHT.txt', 'REDOT_COPYRIGHT.txt'),
('godotengine.org', 'redotengine.org'),
('godot-docs', 'redot-docs'),
('GODOT ENGINE', 'REDOT ENGINE'),
('/bin/godot', '/bin/redot'),
Expand Down Expand Up @@ -178,6 +192,16 @@
('godot.html', 'redot.html'),
('by-godot', 'by-redot'),
('MadeWithGodot', 'MadeWithRedot'),
(' if on_rtd else "(DEV) "', ''),
('<span class="fa fa-book"> Read the Docs</span>', '<span class="fa fa-book"> Versions</span>'),
("const homeUrl = baseUrl.split('/latest/')[0] + '/stable/';", "const homeUrl = 'https://redot-docs-4-3.pages.dev/';"),
('{% set listed_languages = ({"en":"#", "de":"#", "es":"#", "fr":"#"}).items() -%}', '{% set listed_languages = ({"en":"#"}).items() -%}'),
('({"stable":"#", "latest":"#"})', '({"stable":"https://redot-docs-4-3.pages.dev/", "latest":"https://redot-docs-4-4.pages.dev/", "3.6":"https://redot-docs-3-6.pages.dev/"})'),
('Hosted by <a href="https://readthedocs.org">Read the Docs', 'Hosted by <a href="https://cloudflare.com">CloudFlare'),
('<a href="https://docs.readthedocs.io/page/privacy-policy.html">Privacy Policy</a>', ''),
('G-dot', 'Godot'),
(' godot_', ' redot_'),
('class_godotsharp', 'class_redotsharp'),
]

filename_mappings = [
Expand Down Expand Up @@ -214,6 +238,13 @@
def is_target(filename):
return any(filename.lower().endswith(m) for m in filename_masks)

def ensureDirExists(outputName):
dirname = os.path.dirname(outputName)
try:
os.makedirs(dirname)
except FileExistsError:
pass

def generateOutputName(root, fileName, outputDirectory):
on = os.path.join('.', outputDirectory, root, fileName)
on = convertContent(on, filename_mappings)
Expand All @@ -227,25 +258,18 @@ def convertContent(content, mappings):
content = content.replace(search, replace)
return content

def ensureDirExists(outputName):
dirname = os.path.dirname(outputName)
try:
os.makedirs(dirname)
except FileExistsError:
pass

def copyFile(root, filename, outputDirectory):
def copyFile(root, filename, outputDirectory, verbose):
inputName = os.path.join(root, filename)
outputName = generateOutputName(root, inputName.replace('.\\', '').replace('./', ''), outputDirectory)

print(f'Copying "{inputName}" to "{outputName}"')
if verbose: print(f'Copying "{inputName}" to "{outputName}"')
shutil.copyfile(inputName, outputName)

def convertFile(root, filename, outputDirectory, includeUnimplemented):
def convertFile(root, filename, outputDirectory, includeUnimplemented, verbose):
inputName = os.path.join(root, filename)
outputName = generateOutputName(root, filename, outputDirectory)

print(f'Converting "{inputName}" to "{outputName}"')
if verbose: print(f'Converting "{inputName}" to "{outputName}"')
with open(inputName, mode = 'r', encoding = encoding) as input:
data = input.read()

Expand All @@ -256,63 +280,94 @@ def convertFile(root, filename, outputDirectory, includeUnimplemented):
with open(outputName, mode = 'w', encoding = encoding) as output:
output.write(data)

def copyGlobalDir(inputDirectory, inputMask, outputDirectory):
def copyGlobalDir(inputDirectory, inputMask, outputDirectory, verbose):
for root, dirs, files in os.walk(inputDirectory):
if (inputMask in root and outputDirectory not in root):
for f in files:
inputName = os.path.join(root, f)
outputName = generateOutputName(root, f, outputDirectory)
ensureDirExists(outputName)
print(f"Copying {inputName} to {outputName}")
if verbose: print(f"Copying {inputName} to {outputName}")
copyfile(inputName, outputName)

def convertStaticDir(inputDirectory, outputDirectory):
def convertStaticDir(inputDirectory, outputDirectory, verbose):
for root, dirs, files in os.walk(inputDirectory):
if (outputDirectory not in root and '__' not in root):
for f in files:
if (f.split('.')[1] in alphanumeric):
convertFile(root, f, outputDirectory, True)
convertFile(root, f, outputDirectory, True, verbose)
else:
copyFile(root, f, outputDirectory)
copyFile(root, f, outputDirectory, verbose)

def migrate(inputDirectory, outputDirectory, includeUnimplemented):
def migrate(inputDirectory, outputDirectory, includeUnimplemented, ignoreClasses, verbose):
outputsig = os.path.join('.', outputDirectory)
for root, dirs, files in os.walk(inputDirectory):
# ignore output path
if (root.startswith(outputsig)):
continue

if (ignoreClasses and 'classes' in root):
continue

items = filter(is_target, files)
for item in items:
convertFile(root, item, outputDirectory, includeUnimplemented)

inputDir = defaultInputDirectory
outputDir = defaultOutputDirectory
includeUnimplemented = defaultIncludeUnimplemented
if (len(sys.argv) > 1):
inputDir = sys.argv[1]
if (len(sys.argv) > 2):
outputDir = sys.argv[2]
if (len(sys.argv) > 3):
includeUnimplemented = sys.argv[3]

print(f"Simple rst migrator. Uses str.replace to map from Godot to Redot.")
print(f"Usage: py migrate.py [inputDir] [outputDir] [includeUnimplemented], example: py migrate.py . _mymigration True")
print(f"Author: @Craptain on X")
print(f"Input directory: {inputDir}, output directory: {outputDir}, include unimplemented: {includeUnimplemented}")

migrate(inputDir, outputDir, includeUnimplemented)

print("Copying config files...")
convertFile(inputDir, 'conf.py', outputDir, includeUnimplemented)
convertFile(inputDir, 'robots.txt', outputDir, includeUnimplemented)
print("Copying static directories...")

for dir in static_dirs:
if ('**' in dir):
print(f"Copying dirs with mask {dir}")
copyGlobalDir(inputDir, dir.split('/')[1], outputDir)
convertFile(root, item, outputDirectory, includeUnimplemented, verbose)

def main():
inputDir = defaultInputDirectory
outputDir = defaultOutputDirectory
includeUnimplemented = defaultIncludeUnimplemented
ignoreClasses = defaultIgnoreClasses
verbose = defaultVerbose

parser = argparse.ArgumentParser(
prog='Migrate',
description='Simple file migrator. Uses str.replace to map from Godot to Redot. Also converts some filenames.',
epilog='Done. Made by @Craptain')

parser.add_argument('input', help='Input directory relative to current')
parser.add_argument('output', help='Output directory relative to current')
parser.add_argument('-e', '--extended', action='store_true', help='Include unimplemented substitutions, don\'t use in production')
parser.add_argument('-t', '--tiny', action='store_true', help='Exclude classes directory')
parser.add_argument('-v', '--verbose', action='store_true')

args = parser.parse_args()
verbose = args.verbose
if (verbose):
print("arguments:")
print(args)

inputDir = args.input
if (args.output != '.' and not args.output.startswith('/')):
outputDir = args.output
else:
print(f"Converting dir {dir}")
convertStaticDir(dir, outputDir)
print("Done")
print("output can't be . or start with /")
exit(1)
includeUnimplemented = args.extended
ignoreClasses = args.tiny

if (os.path.exists(outputDir)):
print(f"Deleting {outputDir}")
shutil.rmtree(outputDir)

print("Migrating...")
migrate(inputDir, outputDir, includeUnimplemented, ignoreClasses, verbose)

print("Copying config files...")
convertFile(inputDir, 'conf.py', outputDir, includeUnimplemented, verbose)
convertFile(inputDir, 'robots.txt', outputDir, includeUnimplemented, verbose)
copyFile(inputDir, 'favicon.ico', outputDir, verbose)

print("Copying static directories...")
for dir in static_dirs:
if ('**' in dir):
if verbose: print(f"Copying dirs with mask {dir}")
copyGlobalDir(inputDir, dir.split('/')[1], outputDir, verbose)
else:
if verbose: print(f"Converting dir {dir}")
convertStaticDir(dir, outputDir, verbose)

print(parser.epilog)

if __name__ == "__main__":
main()
Binary file removed tutorials/3d/img/3d_toolbar.webp
Binary file not shown.
Binary file added tutorials/3d/img/redot05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tutorials/3d/img/redot06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed tutorials/3d/img/tuto_3d4.webp
Binary file not shown.
Binary file removed tutorials/3d/img/tuto_3d6.webp
Binary file not shown.
Binary file removed tutorials/3d/img/tuto_3d6_1.webp
Binary file not shown.
Binary file removed tutorials/3d/img/tuto_3d6_2.webp
Binary file not shown.
Loading