Skip to content

Commit 7f6a692

Browse files
committed
Merge branch gh-pages from carpentries/styles
No merge conflicts Signed-off-by: Maxim Belkin <[email protected]>
2 parents d2ae528 + 450a6fc commit 7f6a692

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

bin/boilerplate/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ carpentries_site: "https://carpentries.org/"
3535
dc_site: "http://datacarpentry.org"
3636
example_repo: "https://github.com/carpentries/lesson-example"
3737
example_site: "https://carpentries.github.io/lesson-example"
38-
lc_site: "https://librarycarpentry.github.io/"
38+
lc_site: "https://librarycarpentry.org/"
3939
swc_github: "https://github.com/swcarpentry"
4040
swc_pages: "https://swcarpentry.github.io"
4141
swc_site: "https://software-carpentry.org"

bin/lesson_check.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# Where to look for source Markdown files.
1919
SOURCE_DIRS = ['', '_episodes', '_extras']
2020

21+
# Where to look for source Rmd files.
22+
SOURCE_RMD_DIRS = ['_episodes_rmd']
23+
2124
# Required files: each entry is ('path': YAML_required).
2225
# FIXME: We do not yet validate whether any files have the required
2326
# YAML headers, but should in the future.
@@ -108,6 +111,7 @@ def main():
108111
args = parse_args()
109112
args.reporter = Reporter()
110113
check_config(args.reporter, args.source_dir)
114+
check_source_rmd(args.reporter, args.source_dir, args.parser)
111115
args.references = read_references(args.reporter, args.reference_path)
112116

113117
docs = read_all_markdown(args.source_dir, args.parser)
@@ -184,6 +188,19 @@ def check_config(reporter, source_dir):
184188
'configuration',
185189
'"root" not set to "." in configuration')
186190

191+
def check_source_rmd(reporter, source_dir, parser):
192+
"""Check that Rmd episode files include `source: Rmd`"""
193+
194+
episode_rmd_dir = [os.path.join(source_dir, d) for d in SOURCE_RMD_DIRS]
195+
episode_rmd_files = [os.path.join(d, '*.Rmd') for d in episode_rmd_dir]
196+
results = {}
197+
for pat in episode_rmd_files:
198+
for f in glob.glob(pat):
199+
data = read_markdown(parser, f)
200+
dy = data['metadata']
201+
if dy:
202+
reporter.check_field(f, 'episode_rmd',
203+
dy, 'source', 'Rmd')
187204

188205
def read_references(reporter, ref_path):
189206
"""Read shared file of reference links, returning dictionary of valid references

0 commit comments

Comments
 (0)