Skip to content
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

Merge in progress work #25

Merged
merged 9 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy mdBook to GH Pages
on:
push:
branches:
- 'master'
- "master"

jobs:
deploy:
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Setup mdBook
uses: peaceiris/[email protected]
with:
mdbook-version: 'latest'
mdbook-version: "latest"

- run: mdbook build

Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,27 @@ name: Mark stale issues and pull requests

on:
schedule:
- cron: '0 7 * * *'
- cron: "0 7 * * *"

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
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.'
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.'
stale-issue-label: 'stale'
stale-pr-label: 'stale'
close-issue-label: 'inactivity-closed'
close-pr-label: 'inactivity-closed'
labels-to-add-when-unstale: 'valid'
exempt-issue-labels: 'valid,good first issue'
exempt-pr-labels: 'valid,good first issue'
days-before-stale: 30
days-before-close: 5
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
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."
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."
stale-issue-label: "stale"
stale-pr-label: "stale"
close-issue-label: "inactivity-closed"
close-pr-label: "inactivity-closed"
labels-to-add-when-unstale: "valid"
exempt-issue-labels: "valid,good first issue"
exempt-pr-labels: "valid,good first issue"
days-before-stale: 30
days-before-close: 5
2 changes: 1 addition & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ MD007:
MD013:
line_length: 300
MD033:
allowed_elements: ["iframe", "sup"]
allowed_elements: ["iframe", "sup"]
9 changes: 6 additions & 3 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ enable = true # whether or not to enable section folding
level = 0 # the depth to start folding

[preprocessor.features]
command = "python3 features.java"
command = "python3 features.py"
# Going to start writing the rest of the book
# Assuming this is true
toplevel_anonymous_class = true
# Not ready
simple_io = true
simple_io = false
# Turn on when Java 21 released
java_21 = false
java_21 = false

[output.html.playground]
editable = true
10 changes: 7 additions & 3 deletions features.java → features.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def preprocess_content(context, content):
continue
else:
if options.get("simple_io", False) and options.get("toplevel_anonymous_class", False):
newContent.append(line.replace("System.out.println", "println").replace("System.out.print", "print"))
newContent.append(line.replace("System.out.println", "printLine").replace("System.out.print", "print"))
else:
newContent.append(line)

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

context, book = json.load(sys.stdin)
json_input = json.load(sys.stdin)
context, book = json_input

with open("out.json", "w") as f:
json.dump(json_input, f)

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

print(json.dumps(book))
print(json.dumps(book))
1 change: 1 addition & 0 deletions out.json

Large diffs are not rendered by default.

Loading
Loading