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

docs: webdev & Ruby 3.2 #1728

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

*.min.* binary
*.svg binary
2 changes: 1 addition & 1 deletion .github/actions/prepare-build-site/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
ruby-version:
description: "Version of ruby to prepare"
required: false
default: "3.1"
default: "3.2"

runs:
using: composite
Expand Down
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GEM
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
colorator (1.1.0)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.2)
diff-lcs (1.5.0)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
Expand Down Expand Up @@ -61,8 +61,8 @@ GEM
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
Expand All @@ -79,7 +79,7 @@ GEM
nokogiri (1.14.3-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.3.0)
parser (3.2.1.1)
ast (~> 2.4.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
Expand All @@ -92,7 +92,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.6.1)
regexp_parser (2.7.0)
rexml (3.2.5)
rouge (3.30.0)
rubocop (1.25.1)
Expand All @@ -104,8 +104,8 @@ GEM
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.24.0)
parser (>= 3.1.1.0)
rubocop-ast (1.28.0)
parser (>= 3.2.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-next (0.15.3)
Expand All @@ -115,7 +115,7 @@ GEM
ruby-next-core (0.15.3)
ruby-next-parser (3.1.1.3)
parser (>= 3.0.3.1)
ruby-progressbar (1.11.0)
ruby-progressbar (1.13.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
Expand All @@ -127,9 +127,9 @@ GEM
unparser (0.6.4)
diff-lcs (~> 1.3)
parser (>= 3.1.0)
webrick (1.7.0)
webrick (1.8.1)
yell (2.2.2)
zeitwerk (2.6.6)
zeitwerk (2.6.7)

PLATFORMS
ruby
Expand Down
43 changes: 35 additions & 8 deletions pages/docs/webdev.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,39 @@ You can always click the edit button to make small edits to the website source,

### Installing Ruby

Visit [this page](https://jekyllrb.com/docs/installation/) for information about installing Ruby if your current version is too old; the instructions there form the basis for what you see here, and come in variants for all major operating systems.
You should have Ruby 2.6+ for Jekyll; 3.1 recommended and used in CI. You can use rbenv to manage multiple ruby versions. On macOS with homebrew, you'll want:
Visit [this page](https://jekyllrb.com/docs/installation/) for information
about installing Ruby if your current version is too old; the instructions
there form the basis for what you see here, and come in variants for all major
operating systems. You should have Ruby 2.6+ for Jekyll; 3.1+ recommended and
used in CI. You can use rbenv to manage multiple ruby versions. On macOS with
homebrew, you'll want:

```bash
brew install rbenv
```

You'll need to run `rbenv init` and follow the instructions for your current shell. After you've installed rbenv on your system, use:
You'll need to run:

```bash
rbenv install 3.1.2
rbenv init
```

to get a current version of ruby. Then, inside the main iris-hep website directory, run:
and **then follow the instructions printed for your current shell**. After you've installed rbenv on your system, use:

```bash
rbenv local 3.1.2
rbenv install 3.2.1
henryiii marked this conversation as resolved.
Show resolved Hide resolved
```

This will run the Ruby you just built whenever you enter this directory. You'll want to install bundler too:
to get a current version of Ruby downloaded and built for your system. Then,
inside the main iris-hep website directory, run:

```bash
rbenv local 3.2.1
henryiii marked this conversation as resolved.
Show resolved Hide resolved
```

This will add a file (`.ruby-version`, if you are curious) to your local
directory that rbenv's shell integration will enable whenever you enter this
directory. You'll want to install bundler too:

```bash
gem install bundle
Expand Down Expand Up @@ -75,7 +88,7 @@ If you want to also perform the full link checking without exclusions, you can r
bundle exec rake checkall
```

If you are not familiar with it, `rake` is short for "Ruby make". The `clean` and `clobber` targets are available (the later removes the Inspire-HEP cache as well). You can also run `bundle exec jekyll ...` directly.
If you are not familiar with it, `rake` is short for "Ruby make". The `clean` and `clobber` targets are available (the later removes the Inspire-HEP cache as well). You can see all available tasks with `bundle exec rake --tasks`. You can also run `bundle exec jekyll ...` directly.

### Updating javascript files

Expand All @@ -87,6 +100,20 @@ cat assets/js/myfile.js | openssl dgst -sha384 -binary | openssl base64 -A

Run the site locally and verify no warnings appear in your terminal. Also turn on your browser's debugger and make sure no warnings are emitted.

### Updating Ruby files

If you edit Ruby files, you should run `rubocop` to verify:

```bash
bundle exec rake rubocop
```

If it suggests changes, you can often apply them automatically:

```bash
bundle exec rake rubocop:auto_correct
```

### Styles

Most style changes should be set in `assets/css/style.scss`. Some basic changes, like color variables, are set in the `_sass` directory. Please remember to consider multiple screen widths, printing (for relevant pages), and dark mode when changing or adding styles. You can see the defined colors [here](/docs/logos).
Expand Down
Loading