diff --git a/.gitignore b/.gitignore index db21e46dcb6dc075afc7d50106de9ab47936fd42..6ee631a79f7cc5783b04b9cd653cc4fcd354fabc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *~ *.pyc +*.html .DS_Store _site diff --git a/pages/Makefile b/pages/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..887e071a405525c37291f6e023880c6d0ef4f915 --- /dev/null +++ b/pages/Makefile @@ -0,0 +1,43 @@ +# Directories. +SRC_DIR = . +DST_DIR = .. + +# Files. +SRC_PAGES = $(wildcard *.md) +DST_PAGES = $(patsubst %.md,$(DST_DIR)/%.html,$(SRC_PAGES)) + +# Make sure everything is built. +all : commands + +## preview : Build website locally for checking. +preview : $(DST_PAGES) + +# Pattern to build a page with Pandoc. +$(DST_DIR)/%.html : $(SRC_DIR)/%.md + pandoc -s -t html --title-prefix='Software Carpentry' --template=_layouts/page -o $@ $< + +## commands : Display available commands. +commands : Makefile + @sed -n 's/^## //p' $< + +## check : Check consistency. +# FIXME: should run a Python script to do the checking. +# Note: the line below breaks the keyword into two strings to avoid a false match on the command. +check : + @tools/check Makefile $(SRC_PAGES) + +## update : Update the shared files from the GitHub repo holding them. +# FIXME: need to create that repo. +update : + git pull --rebase=false https://github.com/swcarpentry/lesson-template-shared.git master + +## settings : Show variables and settings. +settings : + @echo 'SRC_DIR:' $(SRC_DIR) + @echo 'DST_DIR:' $(DST_DIR) + @echo 'SRC_PAGES:' $(SRC_PAGES) + @echo 'DST_PAGES:' $(DST_PAGES) + +## clean : Clean up temporary and intermediate files. +clean : + @rm -rf $$(find .. -name '*~' -print) diff --git a/pages/_layouts/lesson.html b/pages/_layouts/lesson.html deleted file mode 100644 index 4489725fac2117b213dc604d0167722bb1faa83e..0000000000000000000000000000000000000000 --- a/pages/_layouts/lesson.html +++ /dev/null @@ -1,31 +0,0 @@ ---- ---- - - - - {% if page.title %} - {{ page.title }} - {% endif %} - {% include header.html %} - - - -
- {% include banner.html %} - -
-
- - {% if page.title %} -

{{page.title}}

- {% endif %} - {{content}} - -
-
- - {% include footer.html %} -
- {% include javascript.html %} - - diff --git a/pages/_layouts/reference.html b/pages/_layouts/reference.html deleted file mode 100644 index 4489725fac2117b213dc604d0167722bb1faa83e..0000000000000000000000000000000000000000 --- a/pages/_layouts/reference.html +++ /dev/null @@ -1,31 +0,0 @@ ---- ---- - - - - {% if page.title %} - {{ page.title }} - {% endif %} - {% include header.html %} - - - -
- {% include banner.html %} - -
-
- - {% if page.title %} -

{{page.title}}

- {% endif %} - {{content}} - -
-
- - {% include footer.html %} -
- {% include javascript.html %} - - diff --git a/pages/_layouts/slides.html b/pages/_layouts/slides.html deleted file mode 100644 index 65aa4f735ef6262d79f0aeecfe90ce99470d2823..0000000000000000000000000000000000000000 --- a/pages/_layouts/slides.html +++ /dev/null @@ -1,260 +0,0 @@ ---- ---- - - - - - {{page.title}} - - - - - - - - - - - - -
-
- -{{content}} - -
-
- - - - - - - - - diff --git a/pages/_layouts/topic.html b/pages/_layouts/topic.html deleted file mode 100644 index 4489725fac2117b213dc604d0167722bb1faa83e..0000000000000000000000000000000000000000 --- a/pages/_layouts/topic.html +++ /dev/null @@ -1,31 +0,0 @@ ---- ---- - - - - {% if page.title %} - {{ page.title }} - {% endif %} - {% include header.html %} - - - -
- {% include banner.html %} - -
-
- - {% if page.title %} -

{{page.title}}

- {% endif %} - {{content}} - -
-
- - {% include footer.html %} -
- {% include javascript.html %} - - diff --git a/pages/tools/check b/pages/tools/check index d0e8545e896f07d55c08886f86333e133f727cdd..e750ec7633a97f41d1e3c440b2bc1f5d149f882a 100755 --- a/pages/tools/check +++ b/pages/tools/check @@ -1,8 +1,6 @@ #!/usr/bin/env bash -# check: Ensure that proper formatting has been used. -# Ensure we run from the lesson directory -cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. +# Placeholder for actual conformance checking script (which will +# probably be Python, not Bash). -# Show all of the FIXMEs in the lessons content -grep -i -n FIXME ??-*.md +grep -i -n 'FIX''ME' $* diff --git a/pages/tools/clean b/pages/tools/clean deleted file mode 100755 index 646f84bd0f757c1d1e25d13b3137db8ef2c8f82b..0000000000000000000000000000000000000000 --- a/pages/tools/clean +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# Delete junk files. -rm -rf $(find . -name '*~' -print) -rm -rf $(find . -name '*.pyc' -print) -rm -rf $(find . -name '.DS_Store' -print) -rm -rf _site diff --git a/pages/tools/preview b/pages/tools/preview deleted file mode 100755 index e3174ec464422e4df85670b9a10dbeb6957fcc27..0000000000000000000000000000000000000000 --- a/pages/tools/preview +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# build: Build the lesson site. - -# Ensure we run from the lesson directory -cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. - -# Run our checks first -tools/check - -SITE="_site" - -jekyll build -t -d $SITE diff --git a/pages/tools/update b/pages/tools/update deleted file mode 100755 index 3237442a6526cff6178692556ae5ed088e2923ef..0000000000000000000000000000000000000000 --- a/pages/tools/update +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -# update: Get the latest versions of shared files - -# Ensure we run from the lesson directory -cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. - -git pull --rebase=false https://github.com/tbekolay/swc-shared.git master