Fix #117636: Update check file structure script for docs #117684
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117684
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Prikshit-singh/blender:Update/check_file_structure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Renamed file and made changes to function to handle markdown file and also added additional '-o'/'--output' argument to specify the file to write to.
It tried renaming some folders in
source/blender
to see if it would tell me about that, but it always says the markdown is up to date. Does it work for you?@ -0,0 +8,4 @@
https://developer.blender.org/docs/features/code_layout/
It can run without any arguments, where it will download the MARKDOWN to Blender's source root:
MARKDOWN can be lowercase here and in other places.
@ -0,0 +10,4 @@
It can run without any arguments, where it will download the MARKDOWN to Blender's source root:
You may pass the markdown as an argument, e.g.
I would keep the "text" word, here and in other places.
@ -0,0 +43,4 @@
return "\n{:s}\n{:s}\n".format(text, len(text) * underline)
def html_extract_markdown(data: str) -> Optional[str]:
This code is probably not needed at all anymore?
It was previous getting the raw wiki text from a textarea on a html page. But now we have a link to get the raw text directly.
@ -0,0 +227,4 @@
default=os.path.join(SOURCE_DIR, "markdown_file_structure.txt"),
help="markdown file path, NOTE: this will be downloaded if not found!",
)
parser.add_argument(
I was confused, I think this is actually not needed at all since it really is the same thing as the
-m
option. I thought the script would write some fixed output, but actually it only tells you where the errors are.So this option can be removed again.
No actually 'wiki_to_paths_and_docstrings' was made to extract from html that's why its not able to detect, but I have changed the function, now its working. I wanted to know how does docstring looks like in markdown.
Also two files are mentioned in markdown which are not in Blender repo could you confirm:
These folders were indeed renamed, and the code layout page should be updated for that.
I would not expect a Python error to happen because of that, it should be handled more gracefully.
I have handled that error wanted to ask you that it also shows this, Do need to fix my code for this one or this is also intended to happen:
That looks good. I guess you still need to push your updated code to this pull request?
Yes just wanted you confirmation on this
@ -0,0 +85,4 @@
def markdown_to_paths_and_docstrings(markdown: str) -> Tuple[List[str], List[str]]:
file_paths = []
file_paths_docstring = []
This code can be simplify if you remove these tags from the entire markdown text at the start.
Then all you need to check is that the line starts with
<td markdown>/
, and the rest of the line should be ok to test as a path.Thank you for the advice, wanted to ask how should I handle file_path_docstring.
In the latest PR I Wanted to know what is the purpose of
file_paths_docstring
in markdown_to_paths_and_docstringswhat was it extracting in older file.
It's about detecting TODO text in the description. But I don't think that's very useful, it's trivial to see by just looking at the page. So just remove the code for those docstrings.
sure anything else
@ -0,0 +63,4 @@
def markdown_to_paths_and_docstrings(markdown: str) -> Tuple[List[str], List[str]]:
file_paths = []
file_paths_docstring = []
start_index=0
Remove this line, it's not needed.
@ -0,0 +71,4 @@
markdown = markdown.replace("</td>", "")
lines = markdown.split("\n")
i = 0
while i < len(lines):
This code can be simplified to:
@ -0,0 +73,4 @@
i = 0
while i < len(lines):
if lines[i].startswith("<td markdown>/"):
start_index=len("<td markdown>")
Follow code style with spaces around operators:
@ -0,0 +96,4 @@
def report_missing_source(file_paths: List[str]) -> int:
heading = "Missing in Source Dir"
test = [p for p in file_paths if not os.path.exists(os.path.join(SOURCE_DIR, p.lstrip("/")))]
Better to strip this
/
inmarkdown_to_paths_and_docstrings
as it was doing before.@ -0,0 +123,4 @@
if not p.startswith("."):
p_abs = os.path.join(base_abs, p)
if os.path.isdir(p_abs):
p_rel = os.path.join(base, p+"/")
Also need spaces are
+
here, but if you strip this earlier as suggested, I guess this change is no longer needed.Thanks, I found one more issue and fixed it.
Thank you, for putting your time into this PR.