Merge branch '2016-06' of github.com:swcarpentry/styles into 2016-06
authorGreg Wilson <gvwilson@third-bit.com>
Mon, 27 Jun 2016 00:46:42 +0000 (20:46 -0400)
committerGreg Wilson <gvwilson@third-bit.com>
Mon, 27 Jun 2016 00:46:42 +0000 (20:46 -0400)
bin/lesson_check.py
bin/lesson_initialize.py

index f2d391f016ff8db0b387527fbde142c5da464c14..f858ebd14a513b13d800e8d3c6a851940028591f 100755 (executable)
@@ -38,6 +38,12 @@ REQUIRED_FILES = {
     '%/setup.md': True,
 }
 
+# Required non-Markdown files.
+NON_MARKDOWN_FILES = {
+    "AUTHORS",
+    "CITATION"
+}
+
 # Episode filename pattern.
 P_EPISODE_FILENAME = re.compile(r'/_episodes/(\d\d)-[-\w]+.md$')
 
@@ -93,6 +99,7 @@ def main():
     args = parse_args()
     args.reporter = Reporter(args)
     check_config(args)
+    check_non_markdown_files(args.source_dir, args.reporter)
     docs = read_all_markdown(args, args.source_dir)
     check_fileset(args.source_dir, args.reporter, docs.keys())
     for filename in docs.keys():
@@ -137,6 +144,16 @@ def check_config(args):
     args.reporter.check_field(config_file, 'configuration', config, 'kind', 'lesson')
 
 
+def check_non_markdown_files(source_dir, reporter):
+    """Check presence of non-Markdown files."""
+
+    for filename in NON_MARKDOWN_FILES:
+        path = os.path.join(source_dir, filename)
+        reporter.check(os.path.exists(path),
+                       filename,
+                       "File not found")
+
+
 def read_all_markdown(args, source_dir):
     """Read source files, returning
     {path : {'metadata':yaml, 'metadata_len':N, 'text':text, 'lines':[(i, line, len)], 'doc':doc}}
@@ -175,9 +192,9 @@ def check_fileset(source_dir, reporter, filenames_present):
 
     # Check for duplicate episode numbers.
     reporter.check(len(seen) == len(set(seen)),
-                        None,
-                        'Duplicate episode numbers {0} vs {1}',
-                        sorted(seen), sorted(set(seen)))
+                   None,
+                   'Duplicate episode numbers {0} vs {1}',
+                   sorted(seen), sorted(set(seen)))
 
     # Check that numbers are consecutive.
     seen = [int(s) for s in seen]
@@ -222,7 +239,6 @@ class CheckBase(object):
         self.text = text
         self.lines = lines
         self.doc = doc
-
         self.layout = None
 
 
@@ -355,6 +371,7 @@ class CheckEpisode(CheckBase):
     def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
         super(CheckEpisode, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
 
+
     def check_metadata(self):
         super(CheckEpisode, self).check_metadata()
         if self.metadata:
index 0a7e7c449b97b971985014edf9271745423ee33b..853285e9dba4224f43a44b9c0e520578a877bc87 100755 (executable)
@@ -61,7 +61,24 @@ and to meet some of our community members.
     you can submit a pull request (PR).
     Instructions for doing this are [included below](#using-github).
 
-## What We're Looking For
+## Where to Contribute
+
+1.  If you wish to change this example lesson,
+    please work in <https://github.com/swcarpentry/lesson-example>.
+    This lesson documents the format of our lessons,
+    and can be viewed at <https://swcarpentry.github.io/lesson-example>.
+
+2.  If you wish to change the template used for workshop websites,
+    please work in <https://github.com/swcarpentry/workshop-template>.
+    The home page of that repository explains how to set up workshop websites,
+    while the extra pages in <https://swcarpentry.github.io/workshop-template>
+    provide more background on our design choices.
+
+3.  If you wish to change CSS style files, tools,
+    or HTML boilerplate for lessons or workshops stored in `_includes` or `_layouts`,
+    please work in <https://github.com/swcarpentry/styles>.
+
+## What to Contribute
 
 There are many ways to contribute,
 from writing new exercises and improving existing ones
@@ -80,7 +97,7 @@ it's easy for people who have been using these lessons for a while
 to forget how impenetrable some of this material can be,
 so fresh eyes are always welcome.
 
-## What We're *Not* Looking For
+## What *Not* to Contribute
 
 Our lessons already contain more material than we can cover in a typical workshop,
 so we are usually *not* looking for more concepts or tools to add to them.
@@ -96,16 +113,9 @@ Our workshops typically contain a mixture of Windows, Mac OS X, and Linux users;
 in order to be usable,
 our lessons must run equally well on all three.
 
-## Getting Started
+## Using GitHub
 
-The easiest way to get started is to file an issue
-to tell us about a spelling mistake,
-some awkward wording,
-or a factual error.
-This is a good way to introduce yourself
-and to meet some of our community members.
-
-If you want to start adding or fixing material yourself,
+If you choose to contribute via GitHub,
 you may want to look at
 [How to Contribute to an Open Source Project on GitHub][how-contribute].
 In brief:
@@ -132,11 +142,6 @@ or encourage others to do so.
 The maintainers are community volunteers,
 and have final say over what gets merged into the lesson.
 
-## Our Template
-
-[This documentation][example-site] explains how we format our lessons
-(and is itself an example of that formatting).
-
 ## Other Resources
 
 General discussion of [Software Carpentry][swc-site] and [Data Carpentry][dc-site]
@@ -154,8 +159,8 @@ You can also [reach us by email][contact].
 [github-flow]: https://guides.github.com/introduction/flow/
 [github-join]: https://github.com/join
 [how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
-[issues]: https://github.com/{USERNAME}/{LESSON-NAME}/issues/
-[repo]: https://github.com/{USERNAME}/{LESSON-NAME}/
+[issues]: https://github.com/swcarpentry/lesson-example/issues/
+[repo]: https://github.com/swcarpentry/lesson-example/
 [swc-issues]: https://github.com/issues?q=user%3Aswcarpentry
 [swc-lessons]: http://software-carpentry.org/lessons/
 [swc-site]: http://software-carpentry.org/