'%/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$')
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():
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}}
# 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]
self.text = text
self.lines = lines
self.doc = doc
-
self.layout = None
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:
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
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.
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:
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]
[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/