Skip to content

Commit 2b62314

Browse files
Remove legacy guide.adoc (#345)
1 parent c42022d commit 2b62314

File tree

8 files changed

+12
-442
lines changed

8 files changed

+12
-442
lines changed

.github/scripts/check_chapter_references.py

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
# Paths to the files that need to be checked
1818
README_PATH = "README.adoc"
19-
GUIDE_PATH = "guide.adoc"
2019
NAV_PATH = "antora/modules/ROOT/nav.adoc"
2120

2221
# Directories to scan for chapter files
@@ -96,31 +95,6 @@ def check_readme_references(chapter_files):
9695
print(f"Error checking README.adoc: {e}")
9796
return list(chapter_files.values())
9897

99-
def check_guide_references(chapter_files):
100-
"""
101-
Check if all chapter files are referenced in guide.adoc.
102-
Returns a list of files that are not referenced.
103-
"""
104-
try:
105-
with open(GUIDE_PATH, 'r', encoding='utf-8') as f:
106-
guide_content = f.read()
107-
108-
missing_files = []
109-
for file_path, info in chapter_files.items():
110-
# Convert path to the format used in guide.adoc
111-
rel_path = file_path.replace(CHAPTERS_DIR + "/", "")
112-
113-
# Check if the file is referenced in guide.adoc
114-
# The pattern needs to match both include:{chapters}file.adoc[] and include::{chapters}file.adoc[]
115-
if not (re.search(rf'include:\{{chapters\}}{re.escape(rel_path)}', guide_content) or
116-
re.search(rf'include::\{{chapters\}}{re.escape(rel_path)}', guide_content)):
117-
missing_files.append(info)
118-
119-
return missing_files
120-
except Exception as e:
121-
print(f"Error checking guide.adoc: {e}")
122-
return list(chapter_files.values())
123-
12498
def check_nav_references(chapter_files):
12599
"""
126100
Check if all chapter files are referenced in nav.adoc.
@@ -193,54 +167,6 @@ def update_readme(missing_files):
193167
print(f"Error updating README.adoc: {e}")
194168
return False
195169

196-
def update_guide(missing_files):
197-
"""
198-
Update guide.adoc to include missing chapter references.
199-
Returns True if the file was updated, False otherwise.
200-
"""
201-
if not missing_files:
202-
return False
203-
204-
try:
205-
with open(GUIDE_PATH, 'r', encoding='utf-8') as f:
206-
content = f.readlines()
207-
208-
# Find appropriate sections to add the missing files
209-
extensions_section_idx = None
210-
main_section_idx = None
211-
212-
for i, line in enumerate(content):
213-
if "= When and Why to use Extensions" in line:
214-
extensions_section_idx = i
215-
elif "= Using Vulkan" in line:
216-
main_section_idx = i
217-
218-
if extensions_section_idx is None or main_section_idx is None:
219-
print("Could not find appropriate sections in guide.adoc")
220-
return False
221-
222-
# Add missing files to appropriate sections
223-
for file_info in missing_files:
224-
rel_path = file_info["path"].replace(CHAPTERS_DIR + "/", "")
225-
226-
if file_info["is_extension"]:
227-
# Add to extensions section
228-
content.insert(extensions_section_idx + 2, f"include::{{chapters}}{rel_path}[]\n\n")
229-
extensions_section_idx += 2 # Adjust index for next insertion
230-
else:
231-
# Add to main section
232-
content.insert(main_section_idx + 2, f"include::{{chapters}}{rel_path}[]\n\n")
233-
main_section_idx += 2 # Adjust index for next insertion
234-
235-
# Write updated content back to file
236-
with open(GUIDE_PATH, 'w', encoding='utf-8') as f:
237-
f.writelines(content)
238-
239-
return True
240-
except Exception as e:
241-
print(f"Error updating guide.adoc: {e}")
242-
return False
243-
244170
def update_nav(missing_files):
245171
"""
246172
Update nav.adoc to include missing chapter references.
@@ -301,27 +227,22 @@ def main():
301227

302228
# Check if all chapter files are referenced in the three files
303229
readme_missing = check_readme_references(chapter_files)
304-
guide_missing = check_guide_references(chapter_files)
305230
nav_missing = check_nav_references(chapter_files)
306231

307232
print(f"Missing from README.adoc: {len(readme_missing)}")
308-
print(f"Missing from guide.adoc: {len(guide_missing)}")
309233
print(f"Missing from nav.adoc: {len(nav_missing)}")
310234

311235
# Update files if needed
312236
readme_updated = update_readme(readme_missing)
313-
guide_updated = update_guide(guide_missing)
314237
nav_updated = update_nav(nav_missing)
315238

316239
if readme_updated:
317240
print("Updated README.adoc")
318-
if guide_updated:
319-
print("Updated guide.adoc")
320241
if nav_updated:
321242
print("Updated nav.adoc")
322243

323244
# Return non-zero exit code if any files were missing references
324-
if readme_missing or guide_missing or nav_missing:
245+
if readme_missing or nav_missing:
325246
print("Some chapter files were missing references and have been added.")
326247
return 1
327248
else:

CONTRIBUTING.adoc

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,20 @@ While open for contributions from all, there are a few contribution rules in pla
77

88
The main design goal for the Vulkan Guide is to be "`lean`" and prevent any duplication of information. When possible the Vulkan Guide should guide a user to another resource via a hyperlink.
99

10-
== Ways to Contribute
10+
== Repo Structure
1111

12-
* Fixing a typo, grammar error, or other minor change
13-
** Please feel free to make a PR and it will hopefully get merged in quickly.
14-
* Adding new content
15-
** If you think the guide needs another page, please raise an issue of what topic you feel is missing. This is not a requirement, but we hope to avoid people spending thier valuable time creating a PR for something that doesn't quite belong in the guides.
16-
** If adding another link, clarification, or any other small blurb then a PR works. The addition of information needs to not be redundant and add meaningful value to the guide.
17-
* Feel the guide is not accurately portraying a topic
18-
** There are a lot of ways to use Vulkan and the guide is aimed to be as objective as possible. This doesn't mean that the current information on the Vulkan Guide might be slightly incorrect. Please raise an issue what you feel is incorrect and a solution to how you would improve it.
12+
- `README.adoc` is the landing page if viewing from github
13+
- `antora/modules/ROOT/pages/index.adoc` is the landing page if viewing from docs.vulkan.org
1914

20-
== Images
15+
== Adding a new chapter
2116

22-
All images must be no wider than 1080px. This is to force any large images to be resized to a more reasonable size.
17+
When adding a new chapter, make sure to add the `.adoc` to both `README.adoc` and `antora/modules/ROOT/nav.adoc`
2318

2419
== Markup
2520

26-
The Guide has been converted from Markdown to Asciidoc markup format. It is
27-
possible to view the individual chapters (pages) as before, starting with
28-
the repository root README.adoc, or to generate a single document containing
29-
each chapter using 'make guide.html' with the 'asciidoctor' command-line
30-
tool installed.
21+
The Guide was converted from Markdown to Asciidoc markup format in the past.
3122

32-
We have added experimental support for the Antora site generator under the
33-
`antora/` directory.
23+
We have added support for the Antora site generator under the `antora/` directory.
3424
See https://github.com/KhronosGroup/Vulkan-Site for details and links to a
3525
site incorporating the Vulkan specification, proposals, and this guide.
3626

Makefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The Vulkan Guide is designed to help developers get up and going with the world
2929

3030
[NOTE]
3131
====
32-
The Vulkan Guide can be built as a single page using `asciidoctor guide.adoc`
32+
The Vulkan Guide content is also viewable from https://docs.vulkan.org/guide/latest/index.html
3333
====
3434

3535
:leveloffset: 1

antora/modules/ROOT/pages/index.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ image::vulkan_logo.png[Vulkan Logo]
66
image::khronos_logo.png[Khronos logo]
77
endif::[]
88

9-
// Extracted from boilerplate at start of guide.adoc
9+
// This text appears as https://docs.vulkan.org/guide/latest/index.html
1010

1111
The Vulkan Guide is designed to help developers get up and going with the world of Vulkan. It is aimed to be a light read that leads to many other useful links depending on what a developer is looking for. All information is intended to help better fill the gaps about the many nuances of Vulkan.
12+
13+
This page is generated from https://github.com/KhronosGroup/Vulkan-Guide

0 commit comments

Comments
 (0)