Skip to content

Commit

Permalink
Refine guideline "Set up a local workspace" (#9355)
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Nov 6, 2022
1 parent abb54b1 commit 03dde20
Show file tree
Hide file tree
Showing 57 changed files with 588 additions and 154 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ concurrency:
group: ${{ github.ref }}
cancel-in-progress: true


jobs:
build:
strategy:
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Deploy Jekyll site to Pages

on:
pull_request:
paths:
- 'docs/**'
- '.github/workflows/pages.yml'
push:
paths:
- 'docs/**'
Expand All @@ -27,19 +31,21 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0' # Not needed with a .ruby-version file
ruby-version: '2.7' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
cache-version: 1 # Increment this number if you need to re-download cached gems
working-directory: docs/
- name: Setup Pages
id: pages
uses: actions/configure-pages@v2
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: docs/
destination: ./_site
run: |
cd docs
bundle exec jekyll build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: docs/_site/

deploy:
if: github.ref == 'refs/heads/main'
Expand Down
14 changes: 0 additions & 14 deletions .idea/runConfigurations/JabRef_Main.xml

This file was deleted.

3 changes: 3 additions & 0 deletions docs/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.jekyll-cache
.jekyll-metadata
_site/
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Gemfile.lock
.jekyll-cache
.jekyll-metadata
_site/
14 changes: 14 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ruby:2.7

ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

EXPOSE 4000

WORKDIR /srv/jekyll
COPY . /srv/jekyll

RUN gem install bundler && bundle install

CMD bundle exec jekyll serve -H 0.0.0.0 -t
17 changes: 15 additions & 2 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
source 'https://rubygems.org'

gem "jekyll", "~> 4.2" # installed by `gem jekyll`
gem "webrick" # required when using Ruby >= 3
gem "jekyll", "~> 4.3" # installed by `gem jekyll`

# Homepage: https://github.com/paulrobertlloyd/jekyll-figure#jekyll-figure
gem 'jekyll-figure'

gem "just-the-docs", "0.4.0.rc3"

gem "jekyll-remote-theme"

# Added, because defualt layout with path "**/*.md" does not work at Jekyll
# Source: https://jekyllrb.com/docs/configuration/front-matter-defaults/#glob-patterns-in-front-matter-defaults
# Homepage: https://github.com/benbalter/jekyll-default-layout#jekyll-default-layout
gem 'jekyll-default-layout'

# Somehow, "title" is set "magically" when on GitHub, but not when running locally
# Homepage: https://github.com/benbalter/jekyll-titles-from-headings#jekyll-titles-from-headings
gem 'jekyll-titles-from-headings'
8 changes: 6 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ and go to <http://localhost:4000/> in your browser.
On **Windows**, using a dockerized environment is recommended:

```terminal
docker run -p 4000:4000 --rm --volume="C:\git-repositories\jabref\docs":/srv/jekyll jekyll/jekyll:4 jekyll serve
docker build . -t jrjekyll
docker run -p 4000:4000 -it --rm --volume="C:\git-repositories\jabref\docs":/srv/jekyll jrjekyll jekyll serve -H 0.0.0.0 -t
```

In case you get errors regarding `Gemfile.lock`, just delete `Gemfile.lock` and rerun.
* With <kbd>Ctrl</kbd>+<kbd>C</kbd> you can stop the server (this is enabled by the `-it` switch).
* In case you get errors regarding `Gemfile.lock`, just delete `Gemfile.lock` and rerun.
* The current `Dockerfile` is based on <https://github.com/just-the-docs/just-the-docs/blob/main/Dockerfile>.
The [Jekyll Docker image](https://github.com/envygeeks/jekyll-docker#jekyll-docker) did not work end of 20222 (because Ruby was too new).
26 changes: 26 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: "Developer Documentation"
remote_theme: just-the-docs/[email protected]
color_scheme: light

exclude: [CNAME, README.md, mkdocs-custom.css]

# Hint by https://github.com/just-the-docs/just-the-docs/issues/374#issuecomment-680273258
# Theme read from https://github.com/StylishThemes/Syntax-Themes/blob/master/pygments/css-github/
# Browse alternative themes at https://stylishthemes.github.io/Syntax-Themes/pygments/
Expand Down Expand Up @@ -34,4 +36,28 @@ baseurl: ""
url: ""

plugins:
- jekyll-default-layout
- jekyll-figure
- jekyll-remote-theme
- jekyll-titles-from-headings

jekyll-figure:
paragraphs: false

callouts_level: quiet # or loud
callouts:
highlight:
title: Summary
color: blue
important:
title: Important
color: yellow
new:
title: New
color: green
note:
title: Note
color: purple
warning:
title: Warning
color: red
8 changes: 8 additions & 0 deletions docs/_sass/custom/custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
figcaption {
font-size: .75em;
font-weight: 550;
}

figcaption:before {
content: "Figure: "
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 03dde20

Please sign in to comment.