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
cc09ed11
Commit
cc09ed11
authored
8 years ago
by
Greg Wilson
Browse files
Options
Downloads
Plain Diff
Merge branch 'gh-pages' of github.com:gvwilson/new-template into gh-pages
parents
9a9cbcdb
efef74df
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_templates/_config.yml
+0
-63
0 additions, 63 deletions
_templates/_config.yml
bin/initialize
+164
-2
164 additions, 2 deletions
bin/initialize
with
164 additions
and
65 deletions
_templates/_config.yml
deleted
100644 → 0
+
0
−
63
View file @
9a9cbcdb
#------------------------------------------------------------
# Values for this site.
#------------------------------------------------------------
# Domain for searches.
domain
:
"
https://USERNAME.github.io/LESSON-NAME"
# URL for repository.
repo
:
"
https://github.com/USERNAME/LESSON-NAME"
# Root URL for lesson below domain.
root
:
"
/LESSON-NAME"
# Overall lesson title.
title
:
"
LESSON
TITLE"
# Contact email address.
email
:
USERNAME@SOME.WHERE
# Is this a workshop site (if not, interpreted as a lesson site)?
is_workshop
:
true
#------------------------------------------------------------
# Generic settings (should not need to change).
#------------------------------------------------------------
# Sites.
amy_site
:
"
https://amy.software-carpentry.org/workshops"
dc_site
:
"
https://datacarpentry.org"
swc_github
:
"
https://github.com/swcarpentry"
swc_site
:
"
https://software-carpentry.org"
template_repo
:
"
https://github.com/gvwilson/new-lesson-template"
example_repo
:
"
https://github.com/gvwilson/new-lesson-example"
example_site
:
"
https://gvwilson.github.com/new-lesson-example"
workshop_repo
:
"
https://github.com/gvwilson/new-workshop-template"
workshop_site
:
"
https://gvwilson.github.io/new-workshop-template"
# Start time in minutes (540 is 09:00 am)
start_time
:
540
# Specify that things in the episodes collection should be output.
collections
:
episodes
:
output
:
true
permalink
:
/:path/
extras
:
output
:
true
# Set the default layout for things in the episodes collection.
defaults
:
-
scope
:
path
:
"
"
type
:
episodes
values
:
layout
:
episode
# Files and directories that are not to be copied.
exclude
:
-
Makefile
-
bin
# Turn off built-in syntax highlighting.
highlighter
:
false
This diff is collapsed.
Click to expand it.
_templates/CONTRIBUTING.md
→
bin/initialize
100644 → 100755
+
164
−
2
View file @
cc09ed11
#!/usr/bin/env python
'''
Initialize a newly-created repository.
'''
import
sys
import
os
ROOT_CONTRIBUTING_MD
=
'''
\
# Contributing
Thank you for thinking about contributing to [Software Carpentry][swc-site].
...
...
@@ -107,8 +117,160 @@ created by [Nadia Eghbal][eghbal].
[eghbal]: https://github.com/nayafia
[github-flow]: https://guides.github.com/introduction/flow/
[how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
[
issues
]:
https://github.com/gvwilson/
new-lesson-template
/issues/
[
repo
]:
https://github.com/gvwilson/
new-lesson-template
/
[issues]: https://github.com/gvwilson/
{LESSON-NAME}
/issues/
[repo]: https://github.com/gvwilson/
{LESSON-NAME}
/
[swc-issues]: https://github.com/issues?q=user%3Aswcarpentry
[swc-lessons]: http://software-carpentry.org/lessons/
[swc-site]: http://software-carpentry.org/
'''
ROOT_CONFIG_YML
=
'''
\
#------------------------------------------------------------
# Values for this site.
#------------------------------------------------------------
# Domain for searches.
domain:
"
https://{USERNAME}.github.io/{LESSON-NAME}
"
# URL for repository.
repo:
"
https://github.com/{USERNAME}/{LESSON-NAME}
"
# Root URL for lesson below domain.
root:
"
/{LESSON-NAME}
"
# Overall lesson title.
title:
"
{LESSON-TITLE}
"
# Contact email address.
email: {USERNAME}@{SITE-NAME}
# Is this a workshop site (if not, interpreted as a lesson site)?
is_workshop: true
#------------------------------------------------------------
# Generic settings (should not need to change).
#------------------------------------------------------------
# Sites.
amy_site:
"
https://amy.software-carpentry.org/workshops
"
dc_site:
"
https://datacarpentry.org
"
swc_github:
"
https://github.com/swcarpentry
"
swc_site:
"
https://software-carpentry.org
"
template_repo:
"
https://github.com/gvwilson/new-lesson-template
"
example_repo:
"
https://github.com/gvwilson/new-lesson-example
"
example_site:
"
https://gvwilson.github.com/new-lesson-example
"
workshop_repo:
"
https://github.com/gvwilson/new-workshop-template
"
workshop_site:
"
https://gvwilson.github.io/new-workshop-template
"
# Start time in minutes (540 is 09:00 am)
start_time: 540
# Specify that things in the episodes collection should be output.
collections:
episodes:
output: true
permalink: /:path/
extras:
output: true
# Set the default layout for things in the episodes collection.
defaults:
- scope:
path:
""
type: episodes
values:
layout: episode
# Files and directories that are not to be copied.
exclude:
- Makefile
- bin
# Turn off built-in syntax highlighting.
highlighter: false
'''
ROOT_INDEX_MD
=
'''
\
---
layout: lesson_homepage
---
FIXME: home page introduction
> ## Prerequisites
>
> FIXME
{: .prereq}
'''
ROOT_REFERENCE_MD
=
'''
\
---
layout: reference
title: Reference
permalink: /reference/
---
## Glossary
FIXME
'''
ROOT_SETUP_MD
=
'''
\
---
layout: page
title: Setup
permalink: /setup/
---
FIXME
'''
EXTRAS_DISCUSS_MD
=
'''
\
---
layout: page
title: Discussion
permalink: /discuss/
---
FIXME
'''
EXTRAS_GUIDE_MD
=
'''
\
---
layout: page
title:
"
Instructors
'
Guide
"
permalink: /guide/
---
FIXME
'''
BOILERPLATE
=
(
(
'
CONTRIBUTING.md
'
,
ROOT_CONTRIBUTING_MD
),
(
'
_config.yml
'
,
ROOT_CONFIG_YML
),
(
'
index.md
'
,
ROOT_INDEX_MD
),
(
'
reference.md
'
,
ROOT_REFERENCE_MD
),
(
'
setup.md
'
,
ROOT_SETUP_MD
),
(
'
_extras/discuss.md
'
,
EXTRAS_DISCUSS_MD
),
(
'
_extras/guide.md
'
,
EXTRAS_GUIDE_MD
)
)
def
main
():
'''
Check for collisions, then create.
'''
# Check.
errors
=
False
for
(
path
,
_
)
in
BOILERPLATE
:
if
os
.
path
.
exists
(
path
):
print
(
'
Warning: {0} already exists.
'
.
format
(
path
),
file
=
sys
.
stderr
)
errors
=
True
if
errors
:
print
(
'
**Exiting without creating files.**
'
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
# Create.
for
(
path
,
content
)
in
BOILERPLATE
:
with
open
(
path
,
'
w
'
)
as
writer
:
writer
.
write
(
content
)
if
__name__
==
'
__main__
'
:
main
()
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