You've already forked code_examples_server
mirror of
https://github.com/AdaCore/code_examples_server.git
synced 2026-02-12 12:45:18 -08:00
Removing raw markdown from python files for error handling and added error handling pages.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
<div class="wrapper">
|
||||
<h3>AdaCore Books</h3>
|
||||
<br>
|
||||
<ul class="list-unstyled components">
|
||||
{% for b in books %}
|
||||
<li><a href="books/{{ b.url }}/part1-chapter1">{{ b.title }}</a></li>
|
||||
|
||||
@@ -165,9 +165,12 @@ def book_router(request, book, part, chapter):
|
||||
with open(content_page, 'r') as f:
|
||||
htmldata['content'] = f.read()
|
||||
else:
|
||||
htmldata['content'] = "# Page Under Construction"
|
||||
with open(os.path.join(resources_base_path,
|
||||
"under-construction.md")) as f:
|
||||
htmldata['content'] = f.read()
|
||||
else:
|
||||
htmldata['content'] = "### The page you have reached is invalid. " \
|
||||
"Please use the links at the left to navigate to a valid page."
|
||||
with open(os.path.join(resources_base_path,
|
||||
"invalid-page.md")) as f:
|
||||
htmldata['content'] = f.read()
|
||||
|
||||
return render(request, 'readerpage.html', htmldata)
|
||||
|
||||
2
resources/books/invalid-page.md
Normal file
2
resources/books/invalid-page.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# The page you have reached is invalid.
|
||||
### Please use the links at the left to navigate to a valid page.
|
||||
1
resources/books/under-construction.md
Normal file
1
resources/books/under-construction.md
Normal file
@@ -0,0 +1 @@
|
||||
# Page Under Construction
|
||||
Reference in New Issue
Block a user