Skip to content

Commit f28b2ed

Browse files
bowbahdoefirasrg
andauthored
Merge in progress work (#25)
* more sections * First feedback round * Update prelude.md * ... * Spelling fix Co-Authored-By: Firas Regaieg <[email protected]> * Arguments chapter * More Challenges * Run prettier * user input --------- Co-authored-by: Firas Regaieg <[email protected]>
1 parent 4c8ea02 commit f28b2ed

File tree

115 files changed

+7596
-1531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+7596
-1531
lines changed

.github/workflows/deploy-gh-pages.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy mdBook to GH Pages
33
on:
44
push:
55
branches:
6-
- 'master'
6+
- "master"
77

88
jobs:
99
deploy:
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup mdBook
1717
uses: peaceiris/[email protected]
1818
with:
19-
mdbook-version: 'latest'
19+
mdbook-version: "latest"
2020

2121
- run: mdbook build
2222

.github/workflows/stale.yml

+15-16
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@ name: Mark stale issues and pull requests
77

88
on:
99
schedule:
10-
- cron: '0 7 * * *'
10+
- cron: "0 7 * * *"
1111

1212
jobs:
1313
stale:
14-
1514
runs-on: ubuntu-latest
1615
permissions:
1716
issues: write
1817
pull-requests: write
1918

2019
steps:
21-
- uses: actions/stale@v4
22-
with:
23-
repo-token: ${{ secrets.GITHUB_TOKEN }}
24-
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.'
25-
stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.'
26-
stale-issue-label: 'stale'
27-
stale-pr-label: 'stale'
28-
close-issue-label: 'inactivity-closed'
29-
close-pr-label: 'inactivity-closed'
30-
labels-to-add-when-unstale: 'valid'
31-
exempt-issue-labels: 'valid,good first issue'
32-
exempt-pr-labels: 'valid,good first issue'
33-
days-before-stale: 30
34-
days-before-close: 5
20+
- uses: actions/stale@v4
21+
with:
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}
23+
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days."
24+
stale-pr-message: "This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days."
25+
stale-issue-label: "stale"
26+
stale-pr-label: "stale"
27+
close-issue-label: "inactivity-closed"
28+
close-pr-label: "inactivity-closed"
29+
labels-to-add-when-unstale: "valid"
30+
exempt-issue-labels: "valid,good first issue"
31+
exempt-pr-labels: "valid,good first issue"
32+
days-before-stale: 30
33+
days-before-close: 5

.markdownlint.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ MD007:
55
MD013:
66
line_length: 300
77
MD033:
8-
allowed_elements: ["iframe", "sup"]
8+
allowed_elements: ["iframe", "sup"]

book.toml

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ enable = true # whether or not to enable section folding
1515
level = 0 # the depth to start folding
1616

1717
[preprocessor.features]
18-
command = "python3 features.java"
18+
command = "python3 features.py"
1919
# Going to start writing the rest of the book
2020
# Assuming this is true
2121
toplevel_anonymous_class = true
2222
# Not ready
23-
simple_io = true
23+
simple_io = false
2424
# Turn on when Java 21 released
25-
java_21 = false
25+
java_21 = false
26+
27+
[output.html.playground]
28+
editable = true

features.java features.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def preprocess_content(context, content):
2929
continue
3030
else:
3131
if options.get("simple_io", False) and options.get("toplevel_anonymous_class", False):
32-
newContent.append(line.replace("System.out.println", "println").replace("System.out.print", "print"))
32+
newContent.append(line.replace("System.out.println", "printLine").replace("System.out.print", "print"))
3333
else:
3434
newContent.append(line)
3535

@@ -47,9 +47,13 @@ def preprocess_section(context, section):
4747
if sys.argv[1] == "supports":
4848
sys.exit(0)
4949

50-
context, book = json.load(sys.stdin)
50+
json_input = json.load(sys.stdin)
51+
context, book = json_input
52+
53+
with open("out.json", "w") as f:
54+
json.dump(json_input, f)
5155

5256
for section in book["sections"]:
5357
preprocess_section(context, section)
5458

55-
print(json.dumps(book))
59+
print(json.dumps(book))

out.json

+1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)