Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lesson Template
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
prace-lessons
Lesson Template
Commits
4fce8aea
Commit
4fce8aea
authored
9 years ago
by
Raniere Silva
Browse files
Options
Downloads
Plain Diff
Merge pull request #236 from r-gaia-cs/core-subheading
Sub-heading raise warning not error
parents
c75c476c
68eb006c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/check.py
+10
-11
10 additions, 11 deletions
tools/check.py
with
10 additions
and
11 deletions
tools/check.py
+
10
−
11
View file @
4fce8aea
...
...
@@ -37,7 +37,7 @@ class MarkdownValidator(object):
# Dict of tuples for each callout type: {style: (title, min, max)}
CALLOUTS
=
{}
WARN_ON_EXTRA_HEADINGS
=
Tru
e
# Warn when other headings are present?
WARN_ON_EXTRA_HEADINGS
=
Fals
e
# Warn when other headings are present?
# Validate YAML doc headers: dict of {header text: validation_func}
DOC_HEADERS
=
{}
...
...
@@ -501,17 +501,16 @@ class TopicPageValidator(MarkdownValidator):
The top-level document has no headings indicating subtopics.
The only valid subheadings are nested in blockquote elements
"""
heading_nodes
=
self
.
ast
.
get_section_headings
()
if
len
(
heading_nodes
)
==
0
:
return
True
if
len
(
heading_nodes
)
!=
0
:
# Individual heading msgs are logged by validate_section_heading_order
logging
.
warning
(
"
In {0}:
"
"
Sub-headings are often a sign
"
"
a lesson needs to be split into multiple topics.
"
"
Please make sure this subsection doesn
'
t belong
"
"
in a separate lesson.
"
.
format
(
self
.
filename
))
# Individual heading msgs are logged by validate_section_heading_order
logging
.
error
(
"
In {0}:
"
"
The topic page should not have sub-headings
"
"
outside of special blocks.
"
"
If a topic needs sub-headings,
"
"
it should be broken into multiple topics.
"
.
format
(
self
.
filename
))
return
False
return
True
def
_run_tests
(
self
):
parent_tests
=
super
(
TopicPageValidator
,
self
).
_run_tests
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment