Skip to content

Adapt folder layout to enable pandoc integration #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 60 commits into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
6a2f617
Ignore files generated during doc build
vulder Sep 20, 2021
384d506
Simplify spellchecking
vulder Oct 30, 2021
334cca1
Test
vulder Oct 31, 2021
ebbd552
Fix
vulder Oct 31, 2021
06e81c6
Register option
vulder Oct 31, 2021
c6daf51
Short git refs
vulder Oct 31, 2021
8800480
Empty V2
vulder Oct 31, 2021
f81aeaa
Update index and latest
vulder Oct 31, 2021
cfe6c40
Test without keep files
vulder Oct 31, 2021
f437054
Clean up
vulder Nov 1, 2021
db1b7e3
Removes old deploy script
vulder Nov 1, 2021
40c65aa
Clean up
vulder Nov 1, 2021
7b35218
Adds spelling error reporting (with two example error)
vulder Nov 1, 2021
84a80a5
Sync output
vulder Nov 1, 2021
ec08cba
Fix lb
vulder Nov 1, 2021
27955d4
Make error a bit clearer
vulder Nov 1, 2021
5f31801
Remove test spell errors
vulder Nov 1, 2021
031a1a2
Test linenumber printing
vulder Nov 1, 2021
887f9e7
Revert test spell error
vulder Nov 1, 2021
cafedcc
Adds automatic teaching module source detection
vulder Nov 1, 2021
8126af7
Fixes install version detection
vulder Nov 1, 2021
de0e7ce
Update obtaining doc
vulder Nov 1, 2021
c4b0ef4
Clean up to mainline doc to SG20
vulder Nov 1, 2021
2f4ca86
Fixes contributor creation (use mailmapped author names to remove
vulder Nov 1, 2021
10bc43e
Generate correct epub link
vulder Nov 1, 2021
e4b978d
Update ignored spellings
vulder Nov 1, 2021
645d3ac
Fixes broken link
vulder Nov 1, 2021
b038f7b
Update skeleton with madams changes to the format
vulder Nov 1, 2021
6703db4
Adapt checker to new format
vulder Nov 1, 2021
832850b
Adapt teaching modules to new format
vulder Nov 1, 2021
7a9fc05
TEst build without test secs
vulder Nov 1, 2021
8b758a6
Revert "Adapt teaching modules to new format"
vulder Nov 1, 2021
ec7dd07
Try out concepts update
vulder Nov 1, 2021
63bd59d
Test different indent
vulder Nov 1, 2021
0d8aad1
Further adaptions
vulder Nov 1, 2021
3c4ff26
Other updates
vulder Nov 1, 2021
cefd78e
Test rq mod
vulder Nov 1, 2021
926a70c
Check
vulder Nov 1, 2021
c78b821
Test
vulder Nov 1, 2021
c0f021f
Fix section name
vulder Nov 1, 2021
a49ed0e
Next mods
vulder Nov 1, 2021
9b64928
Next test
vulder Nov 1, 2021
1f038ea
Next
vulder Nov 1, 2021
6c7c632
Last comment
vulder Nov 1, 2021
10bf828
Last bit
vulder Nov 1, 2021
69daeee
Revert K -> k
vulder Nov 1, 2021
f8774c7
Adapt updater to new layout
vulder Nov 1, 2021
c4b5710
Removes old Readme
vulder Nov 1, 2021
d60f78c
Updates skeleton table to MD
vulder Nov 1, 2021
4b5b107
Implements main generator to automatically detect all modules
vulder Nov 1, 2021
ebd08c1
Adapt topic_updater tests to new skeleton # indentation
vulder Nov 1, 2021
d505778
Adds tests for the main file generator
vulder Nov 1, 2021
bbfad4d
Add CI action to run python unittests
vulder Nov 1, 2021
9eb7502
Remove commented lines from make_markdown awk script
vulder Nov 2, 2021
0dfdcc6
Makes section wordings consistent
vulder Nov 2, 2021
5a1c00c
remove notes from official released document
vulder Nov 2, 2021
cb886e4
Remove NOTE
vulder Nov 2, 2021
5e69b2b
Remove currently empty sections from the document
vulder Nov 3, 2021
543d219
Fix extra sources in makefile
vulder Nov 3, 2021
32a116d
Adapt pytest config to new format for >=7
vulder Feb 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
run: |
tools/build/build \
-d ${{runner.temp}}/output \
-z ${{github.ref}} \
-v ${GITHUB_REF#refs/*/} \
-s
############################################################
31 changes: 31 additions & 0 deletions .github/workflows/ci_tool_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This action is used to run tests to ensure all tools work like expected.

name: Tool CI

on: [push]

jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -r tools/requirements.txt

- name: Run unittests
run: |
cd tools
pytest
62 changes: 11 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,60 +20,20 @@ jobs:
shell: bash
run: tools/build/prebuild
############################################################
- name: Collect git metadata
id: git_metadata
run: |
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
# The following builds the document in multiple formats for deployment.
- name: Build the document.
shell: bash
run: |
tools/build/build \
-d ${{runner.temp}}/output \
-z ${{github.ref}}
############################################################
# The following deploys to a different branch of the same repository
# using an access token for authentication.
# Note: It is recommended that this approach not be used.
#- name: Deploy the built document to a GitHub Pages branch.
# env:
# DEPLOY_TOKEN: ${{secrets.DEPLOY_TOKEN}}
# shell: bash
# run: |
# tools/build/deploy \
# -f \
# -m token \
# -t ${{runner.temp}}/deploy_tmp \
# -i ${{runner.temp}}/output \
# -r mdadams/SG20 \
# -b gh-pages \
# -z ${{github.ref}}
############################################################
# The following deploys to a different branch of the same repository
# using a deploy (i.e., SSH) key for authentication.
- name: Deploy the built document to a GitHub Pages branch.
env:
DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
shell: bash
run: |
tools/build/deploy \
-f \
-m key \
-t ${{runner.temp}}/deploy_tmp \
-i ${{runner.temp}}/output \
-r mdadams/SG20 \
-b gh-pages \
-z ${{github.ref}}
############################################################
# The following deploys to a branch of a different repository
# using a deploy (i.e., SSH) key authentication.
- name: Deploy the built document to a GitHub Pages branch.
env:
DEPLOY_KEY: ${{secrets.ALT_DEPLOY_KEY}}
shell: bash
run: |
tools/build/deploy \
-f \
-m key \
-t ${{runner.temp}}/deploy_tmp_2 \
-i ${{runner.temp}}/output \
-r mdadams/sg20_guidelines_for_teaching_cpp \
-b gh-pages \
-z ${{github.ref}}
############################################################
-v ${{ steps.git_metadata.outputs.VERSION }}
- name: Deploy generated content to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{runner.temp}}/output
keep_files: true
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
__pycache__/

# Ignore generated files
sources/contributors.md
sources/guidelines.epub
sources/guidelines.html
sources/guidelines.texi
sources/guidelines_html/
sources/knowledge_areas_summary.md
sources/main.gen.md
sources/main.pre.md
sources/spellcheck_expected_sorted.txt
sources/spellcheck_result.txt
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Florian Sattler <vuld3r@gmail.com> <vulder@users.noreply.github.com>
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ This repository contains the source for the document:
When the repository is tagged, this document is automatically built
and made available via GitHub Pages at:

- <https://cplusplus.github.io/SG20/latest> (soon)
- <https://mdadams.github.io/sg20_guidelines_for_teaching_cpp/latest>
(currently)
- <https://mdadams.github.io/SG20/latest> (currently)
- <https://cplusplus.github.io/SG20/latest>

# Prerequisites for Building the Document

Expand Down
7 changes: 0 additions & 7 deletions TODO.txt

This file was deleted.

5 changes: 3 additions & 2 deletions config/spellcheck/ignored_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ expr
Florian
func
Furst
Hinnant
html
Hyland
JC
Krathwohl
Expand All @@ -21,7 +23,6 @@ Sattler
SG
Stroustrup
udl
Vandevoorde
ver
Winkel
Hinnant
Vandevoorde
61 changes: 27 additions & 34 deletions tools/old/skeleton.md → skeleton.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
# Module name: topic name
## Module name: topic name

_Skeleton descriptions are typeset in italic text,_
_so please don't remove these descriptions when editing the topic._

## Overview
### Overview

_Provides a short natural language abstract of the module’s contents._
_Specifies the different levels of teaching._

<table>
<thead>
<th>Level</th>
<th>Objectives</th>
</thead>
<tr>
<td>Foundational</td>
<td></td>
</tr>
<tr>
<td>Main</td>
<td></td>
</tr>
<tr>
<td>Advanced</td>
<td></td>
</tr>
</table>

## Motivation
------------------------------------------------------------------------
Level Objective
----------------- ------------------------------------------------------
Foundational ---

Main ---

Advanced ---

------------------------------------------------------------------------

### Motivation

_Why is this important?_
_Why do we want to learn/teach this topic?_

## Topic introduction
### Topic introduction

_Very brief introduction to the topic._

## Foundational: Using *
### Foundational: Using *

### Background/Required Knowledge
#### Background/Required Knowledge

A student:


### Student outcomes
#### Student outcomes

_A list of things "a student should be able to" after the curriculum._
_The next word should be an action word and testable in an exam._
Expand All @@ -56,22 +49,22 @@ A student should be able to:
4.
5.

### Caveats
#### Caveats

_This section mentions subtle points to understand, like anything resulting in
implementation-defined, unspecified, or undefined behavior._

### Points to cover
#### Points to cover

_This section lists important details for each point._

## Main: implementing *
### Main: implementing *

### Background/Required Knowledge
#### Background/Required Knowledge

* All of the above.

### Student outcomes
#### Student outcomes

A student should be able to:

Expand All @@ -81,11 +74,11 @@ A student should be able to:
4.
5.

### Caveats
#### Caveats

### Points to cover
#### Points to cover

## Advanced
### Advanced

_These are important topics that are not expected to be covered but provide
guidance where one can continue to investigate this topic in more depth._
45 changes: 22 additions & 23 deletions sources/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ DOC_SPELLCHECK_MUST_PASS = 1
INSTALL_DIR = $(TOP_DIR)/install

# All of the Markdown source files (that are not generated during build).
SOURCES = \
modules/compile-time-programming/requires-expressions.md \
modules/functions/defaulted-parameters.md \
modules/functions/user-defined-literals.md \
modules/object-model/copy-semantics.md \
course_examples.md \
disclaimer.md \
glossary.md \
SOURCES = $(shell find . -mindepth 2 -name '*.md')

# Special top-level markdown files
EXTRA_SOURCES = glossary.md \
contributing.md \
introduction.md \
main.md \
main_raw.md \
obtaining_document.md \
references.md \

# The Markdown files that are generated during the build process.
GENERATED_MARKDOWN = \
knowledge_areas_summary.md \
main.pre.md \
main.gen.md \
contributors.md \

# Merge extra sources with detected sources for teaching modules
SOURCES += $(EXTRA_SOURCES)

################################################################################
# Define primary targets.
################################################################################
Expand Down Expand Up @@ -96,6 +96,7 @@ install: all
# Some additional configuration.
################################################################################

MAIN_GENERATOR= $(TOP_DIR)/tools/build/generate_main.py
MD_PREPROCESSOR = $(TOP_DIR)/tools/build/preprocessor
MAKE_MARKDOWN = $(TOP_DIR)/tools/build/make_markdown
SPELLCHECK_DIR = $(TOP_DIR)/config/spellcheck
Expand All @@ -104,14 +105,17 @@ SPELLCHECK_DIR = $(TOP_DIR)/config/spellcheck
# Preprocessing setup.
################################################################################

main.gen.md: $(SOURCES) contributors.md main.md
$(MD_PREPROCESSOR) -v $(DOC_VERSION) < main.md > main.gen.md
main.pre.md: $(SOURCES) contributors.md main_raw.md
$(MAIN_GENERATOR) --raw main_raw.md --out main.pre.md --module-folder modules

main.gen.md: $(SOURCES) contributors.md main.pre.md
$(MD_PREPROCESSOR) -v $(DOC_VERSION) < main.pre.md > main.gen.md

knowledge_areas_summary.md: $(SOURCES) knowledge_areas.dat
$(MAKE_MARKDOWN) < knowledge_areas.dat > knowledge_areas_summary.md

contributors.md:
git log --all --pretty="%an" | sort | uniq > contributors.md
git log --all --pretty="%aN" | sort | uniq > contributors.md

################################################################################
# Establish Pandoc settings.
Expand Down Expand Up @@ -163,21 +167,16 @@ guidelines.tex:

spellcheck_result.txt: guidelines.html
rm -f $@
rm -f spellcheck_expected_sorted.txt
sort $(SPELLCHECK_DIR)/ignored_words.txt | \
uniq > spellcheck_expected_sorted.txt
PATH="$(TOP_DIR)/tools/build:$$PATH" pandoc --from $(INPUT_FORMAT) \
--lua-filter $(TOP_DIR)/tools/pandoc_filters/spellcheck.lua \
main.gen.md | sort | uniq > $@
@status=0; \
diff -q spellcheck_expected_sorted.txt $@ || \
status=1; \
if [ $$status -ne 0 ]; then \
echo "SPELLING ERRORS DETECTED:"; \
diff -u spellcheck_expected_sorted.txt $@ | \
grep '^[+-]'; \
if [ -s $@ ]; then \
echo "DETECTED SPELLING ERRORS:"; \
cat $@ | while read line; do echo "Misspelled '$$line' in:"; \
grep -R "$$line" -n --color=auto --include='*.md' --exclude='main.gen.md'; done; \
sync; \
if [ $(DOC_SPELLCHECK_MUST_PASS) -ne 0 ]; then \
echo "ERROR: spelling errors detected"; \
echo "ERROR: spelling errors detected, cannot proceed!"; \
exit 1; \
else \
echo "WARNING: spelling errors detected"; \
Expand Down
5 changes: 0 additions & 5 deletions sources/course_examples.md

This file was deleted.

6 changes: 0 additions & 6 deletions sources/disclaimer.md

This file was deleted.

5 changes: 3 additions & 2 deletions sources/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<head>
<meta http-equiv="refresh" content="0; URL=https://mdadams.github.io/sg20_guidelines_for_teaching_cpp/latest/" />
<meta http-equiv="refresh" content="0; URL=https://cplusplus.github.io/SG20/latest/" />
</head>

<body>
<p>If you are not redirected in five seconds, <a href="https://mdadams.github.io/sg20_guidelines_for_teaching_cpp/latest/">click here</a>.</p>
<p>If you are not redirected in five seconds, <a href="https://cplusplus.github.io/SG20/latest/">click here</a>.</p>
</body>
Loading